mobileconfig

package module
v0.0.0-...-7ea9927 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 1, 2016 License: MIT Imports: 3 Imported by: 0

README

go-apple-mobileconfig

GoDoc

Create Apple mobileconfig configuration files.

Based on Node mobileconfig module.

Usage

package main

import (
	"os"
	"github.com/ProtonMail/go-apple-mobileconfig"
)

func main() {
	c := &mobileconfig.Config{
		DisplayName: "Mail Account",
		EmailAddress: "[email protected]",
		Identifier: "gov.nsa.mail",
		Organization: "NSA",
		Imap: &mobileconfig.Imap{
			Hostname: "mail.nsa.gov",
			Port: 993,
			Tls: true,
			Username: "root",
			Password: "snowden",
		},
		Smtp: &mobileconfig.Smtp{
			Hostname: "mail.nsa.gov",
			Port: 25,
			Tls: false,
			Username: "root",
		},
	}

	if err := c.WriteTo(os.Stdout); err != nil {
		panic(err)
	}
}

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	EmailAddress       string
	DisplayName        string
	Identifier         string
	Organization       string
	AccountDescription string

	Imap *Imap
	Smtp *Smtp

	Description string
	ContentUuid string
	Uuid        string
}

An Apple mobileconfig file.

func (*Config) WriteTo

func (c *Config) WriteTo(w io.Writer) error

type Imap

type Imap struct {
	Hostname string
	Port     int
	Tls      bool

	Username string
	Password string
}

type Smtp

type Smtp struct {
	Hostname string
	Port     int
	Tls      bool

	// Leave Username blank to do not use SMTP authentication.
	Username string
	// Leave Password blank to use IMAP credentials.
	Password string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL