cgp

package module
v0.0.0-...-570ac70 Latest Latest
Warning

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

Go to latest
Published: May 15, 2017 License: MIT Imports: 5 Imported by: 0

README

CGP

This is a go api wrapper for the excellent Communigate Pro mailserver.

Usage

Create an api client

c := cgp.New("server.hostname.com", "username", "password")

For API instuctions of the client see the go-docs

Contributing

Not all API calls are wrapped yet. I have added the ones that I needed more will be added if need be. Please submit an issue or a pull request.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Domain *Domain
	Name   string
}

Account represents an account under a domain

func (*Account) Alias

func (acc *Account) Alias(name string) *Alias

Alias creates an Alias type from an account

func (*Account) Aliases

func (acc *Account) Aliases() ([]*Alias, error)

Aliases lists the aliases of an account

func (Account) Email

func (a Account) Email() string

Email returns the primary email of the account

func (Account) RealName

func (a Account) RealName() (string, error)

RealName return the real name of the account as registered

type Alias

type Alias struct {
	Name string
	// contains filtered or unexported fields
}

Alias represents an alias of an account

func (Alias) Email

func (a Alias) Email() string

Email returns the alias email on the primary domain name

type CGP

type CGP struct {
	// contains filtered or unexported fields
}

CGP represents a configured go client

func New

func New(url, user, pass string) *CGP

New returns a new Communigate Pro client

func (*CGP) Domain

func (cgp *CGP) Domain(name string) *Domain

Domain creates a domain type with the given name

func (*CGP) Domains

func (cgp *CGP) Domains() ([]*Domain, error)

Domains lists the domains on the server

type Domain

type Domain struct {
	Name string
	// contains filtered or unexported fields
}

Domain represents a single domain

func (*Domain) Account

func (dom *Domain) Account(name string) *Account

Account returns an account type with the given name

func (*Domain) Accounts

func (dom *Domain) Accounts() ([]*Account, error)

Accounts lists the acounts of a domain

func (Domain) Aliases

func (dom Domain) Aliases() ([]string, error)

Aliases returns a list of domain aliases

func (Domain) Exists

func (dom Domain) Exists() (bool, error)

Exists returns true if the domain

func (*Domain) Forwarder

func (dom *Domain) Forwarder(name, to string) *Forwarder

Forwarder returns a forwarder type with the given from and dest

func (*Domain) Forwarders

func (dom *Domain) Forwarders() ([]*Forwarder, error)

Forwarders lists the forwarders of a domain

func (*Domain) GetForwarder

func (dom *Domain) GetForwarder(name string) (*Forwarder, error)

GetForwarder retreives a forwarder with the given name

func (*Domain) GetGroup

func (dom *Domain) GetGroup(name string) (*Group, error)

GetGroup retrieves a group from a domain with the given group name

func (*Domain) Group

func (dom *Domain) Group(name string, members []*Account) *Group

Group creates a Group type from a domain, with the given name and members

func (*Domain) Groups

func (dom *Domain) Groups() ([]*Group, error)

Groups lists the groups of a domain

func (*Domain) MailingList

func (dom *Domain) MailingList(name string) *MailingList

MailingList creates a MailingList type from a domain, with the given name

func (*Domain) MailingLists

func (dom *Domain) MailingLists() ([]*MailingList, error)

MailingLists lists the mailing lists of a domain

type Forwarder

type Forwarder struct {
	Domain *Domain
	Name   string
	To     string
}

Forwarder represents a forwarder

func (Forwarder) Email

func (f Forwarder) Email() string

Email returns the forwarder email on the primary domain

type Group

type Group struct {
	Domain  *Domain
	Name    string
	Members []*Account
}

Group represents a group of a domain

type MailingList

type MailingList struct {
	Domain *Domain
	Name   string
}

MailingList represents a malinglist of a domain

func (*MailingList) Subscriber

func (ml *MailingList) Subscriber(email, name string) *Subscriber

Subscriber create a Subscriber type from a MalingList, with the given email and name

func (*MailingList) Subscribers

func (ml *MailingList) Subscribers() ([]*Subscriber, error)

Subscribers returns a list of subscriber of a mailing list.

type SOAPNotFoundError

type SOAPNotFoundError struct{}

SOAPNotFoundError is returned when we cannot find a soap resource.

func (SOAPNotFoundError) Error

func (err SOAPNotFoundError) Error() string

type Subscriber

type Subscriber struct {
	MailingList *MailingList
	Email       string
	RealName    string
}

Subscriber represents a subscription to a mailinglist

Jump to

Keyboard shortcuts

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