Documentation ¶
Index ¶
- func ReadAndConfirmPassword() (string, error)
- func ReadPassword(prompt string) (string, error)
- func ValidateEmail(email string) error
- func ValidateEmailFromParts(name, domain string) error
- type Account
- type AccountService
- func (s *AccountService) ChangePassword(domain, username, password string) error
- func (s *AccountService) Create(domain, username, password string) error
- func (s *AccountService) Delete(domain, username string) error
- func (s *AccountService) Disable(domain, username string) error
- func (s *AccountService) Enable(domain, username string) error
- func (s *AccountService) Get(domain string, username string) (*Account, error)
- func (s *AccountService) List(domain string) ([]Account, error)
- func (s *AccountService) Rename(domain, old, new string) error
- type Alias
- type AliasService
- func (s *AliasService) Create(domain, alias, email string) error
- func (s *AliasService) Delete(domain, alias, email string) error
- func (s *AliasService) DeleteAll(domain, alias string) error
- func (s *AliasService) Disable(domain, alias, email string) error
- func (s *AliasService) Enable(domain, alias, email string) error
- func (s *AliasService) Get(domain, alias string) ([]Alias, error)
- func (s *AliasService) GetForEmail(domain, alias, email string) (*Alias, error)
- func (s *AliasService) List(domain string) ([]Alias, error)
- func (s *AliasService) Rename(domain, alias, email, newName string) error
- func (s *AliasService) RenameAll(domain, alias, newName string) error
- type AuthResponse
- type AuthService
- type Bcc
- type BccService
- type Client
- type Domain
- type DomainService
- func (s *DomainService) Create(name string) error
- func (s *DomainService) Delete(name string) error
- func (s *DomainService) Disable(name string) error
- func (s *DomainService) Enable(name string) error
- func (s *DomainService) Get(name string) (*Domain, error)
- func (s *DomainService) List() ([]Domain, error)
- func (s *DomainService) Rename(old, new string) error
- type InputBccService
- func (s InputBccService) ChangeRecipient(domain, username, email string) error
- func (s InputBccService) Create(domain, username, email string) error
- func (s InputBccService) Delete(domain, username string) error
- func (s InputBccService) Disable(domain, username string) error
- func (s InputBccService) Enable(domain, username string) error
- func (s InputBccService) Get(domain, username string) (*Bcc, error)
- type OutputBccService
- func (s OutputBccService) ChangeRecipient(domain, username, email string) error
- func (s OutputBccService) Create(domain, username, email string) error
- func (s OutputBccService) Delete(domain, username string) error
- func (s OutputBccService) Disable(domain, username string) error
- func (s OutputBccService) Enable(domain, username string) error
- func (s OutputBccService) Get(domain, username string) (*Bcc, error)
- type Version
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadAndConfirmPassword ¶
ReadAndConfirmPassword reads a password and confirmation from the terminal. Retries three times if the passwords do not match.
func ReadPassword ¶
ReadPassword reads a password from the terminal
func ValidateEmail ¶
ValidateEmail validates the given email address and returns an error if the email address is invalid.
func ValidateEmailFromParts ¶
ValidateEmailFromParts validates the email address using the given username and domain and returns an error if the email address is invalid.
Types ¶
type AccountService ¶
type AccountService service
AccountService handles communication with the account API on the Postfix REST Server.
func (*AccountService) ChangePassword ¶
func (s *AccountService) ChangePassword(domain, username, password string) error
ChangePassword changes the password for the specified account.
func (*AccountService) Create ¶
func (s *AccountService) Create(domain, username, password string) error
Create creates a new account in the specified domain with the given username and password.
func (*AccountService) Delete ¶
func (s *AccountService) Delete(domain, username string) error
Delete deletes the specified account.
func (*AccountService) Disable ¶
func (s *AccountService) Disable(domain, username string) error
Disable disables the specified account.
func (*AccountService) Enable ¶
func (s *AccountService) Enable(domain, username string) error
Enable enables the specified account.
func (*AccountService) Get ¶
func (s *AccountService) Get(domain string, username string) (*Account, error)
Get retrieves the account for domain 'domain' with name 'username'.
func (*AccountService) List ¶
func (s *AccountService) List(domain string) ([]Account, error)
List retrieves all accounts for the specified domain.
func (*AccountService) Rename ¶
func (s *AccountService) Rename(domain, old, new string) error
Rename renames the specified account username from 'old'@domain to 'new'@domain.
type AliasService ¶
type AliasService service
AliasService handles communication with the alias API of the Postfix REST Server.
func (*AliasService) Create ¶
func (s *AliasService) Create(domain, alias, email string) error
Create assignes email to the specified alias.
func (*AliasService) Delete ¶
func (s *AliasService) Delete(domain, alias, email string) error
Delete deletes the specified alias.
func (*AliasService) DeleteAll ¶
func (s *AliasService) DeleteAll(domain, alias string) error
DeleteAll deletes all recipients for a specific alias.
func (*AliasService) Disable ¶
func (s *AliasService) Disable(domain, alias, email string) error
Disable disables the specified alias.
func (*AliasService) Enable ¶
func (s *AliasService) Enable(domain, alias, email string) error
Enable enables the specified alias.
func (*AliasService) Get ¶
func (s *AliasService) Get(domain, alias string) ([]Alias, error)
Get retrieves all recipients for the specified alias.
func (*AliasService) GetForEmail ¶
func (s *AliasService) GetForEmail(domain, alias, email string) (*Alias, error)
GetForEmail retreives a specific alias.
func (*AliasService) List ¶
func (s *AliasService) List(domain string) ([]Alias, error)
List retrieves all aliases for accounts in the specified domain.
func (*AliasService) Rename ¶
func (s *AliasService) Rename(domain, alias, email, newName string) error
Rename changes the username part of the specified alias forwarding to the specified email address.
func (*AliasService) RenameAll ¶
func (s *AliasService) RenameAll(domain, alias, newName string) error
RenameAll renames the username part of the specified aliases (for all recipients attached to the alias).
type AuthResponse ¶
type AuthResponse struct {
*goprsc.AuthResponse
}
AuthResponse is a wrapper for goprsc.AuthResponse
type AuthService ¶
type AuthService service
AuthService handles communication with the authentication API of the Postfix REST Server.
func (*AuthService) Login ¶
func (s *AuthService) Login(login, password string) (*AuthResponse, error)
Login authenticates the user credential and returnes the tokens provided by the Postfix REST Server.
func (*AuthService) Logout ¶
func (s *AuthService) Logout(login, refreshToken string) error
Logout logs out the user, if the provided login and refreshToken are valid.
type BccService ¶
type BccService interface { Get(domain, username string) (*Bcc, error) Create(domain, username, email string) error Delete(domain, username string) error Enable(domain, username string) error Disable(domain, username string) error ChangeRecipient(domain, username, email string) error }
BccService handles communication with the BCC API.
type Client ¶
type Client struct { Auth *AuthService Domains *DomainService Accounts *AccountService Aliases *AliasService InputBccs *InputBccService OutputBccs *OutputBccService // contains filtered or unexported fields }
Client is the Postfix REST server client.
func (*Client) GetAuthToken ¶
GetAuthToken returns the authentication token associated with the client
func (*Client) GetRefreshToken ¶
GetRefreshToken returns the refresh token associated with the client
type DomainService ¶
type DomainService service
DomainService handles communication with the domain API of the Postfix REST Server.
func (*DomainService) Create ¶
func (s *DomainService) Create(name string) error
Create creates a new domain with the specified domain name.
func (*DomainService) Delete ¶
func (s *DomainService) Delete(name string) error
Delete deletes the domain with the specified name.
func (*DomainService) Disable ¶
func (s *DomainService) Disable(name string) error
Disable disables the domain specified by 'name'.
func (*DomainService) Enable ¶
func (s *DomainService) Enable(name string) error
Enable enables the domain specified by 'name'.
func (*DomainService) Get ¶
func (s *DomainService) Get(name string) (*Domain, error)
Get retrieves a domain with the specified domain name
func (*DomainService) List ¶
func (s *DomainService) List() ([]Domain, error)
List retrieves all domains.
func (*DomainService) Rename ¶
func (s *DomainService) Rename(old, new string) error
Rename renames domain with domain name 'old' to 'new'.
type InputBccService ¶
type InputBccService struct {
// contains filtered or unexported fields
}
InputBccService handles communication with the recipient BCC API.
func NewInputBccService ¶
func NewInputBccService(client *goprsc.Client) *InputBccService
NewInputBccService builds a new InputBccServer instance for interacting with the recipient BCC API.
func (InputBccService) ChangeRecipient ¶
type OutputBccService ¶
type OutputBccService struct {
// contains filtered or unexported fields
}
OutputBccService handles communication with the sender BCC API.
func NewOutputBccService ¶
func NewOutputBccService(client *goprsc.Client) *OutputBccService
NewOutputBccService builds a new OutputBccService instance for interacting with the sender BCC API.
func (OutputBccService) ChangeRecipient ¶
type Version ¶
type Version struct { // Major is the major version number Major int // Minor is the minor version number Minor int // Patch is the patch version number Patch int }
Version holds application version information.
func (Version) FullVersion ¶
FullVersion returns the complete version string for emailctl.