connect

package module
v0.0.0-...-e16b544 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Administration

type Administration struct {
	IsEnabled                   bool   `json:"isEnabled"`
	IsLimited                   bool   `json:"isLimited"`
	GroupID                     string `json:"groupId"`
	GroupName                   string `json:"groupName"`
	BuiltInAdminEnabled         bool   `json:"builtInAdminEnabled"`
	BuiltInAdminUsername        string `json:"builtInAdminUsername"`
	BuiltInAdminPassword        string `json:"builtInAdminPassword"`
	BuiltInAdminPasswordIsEmpty bool   `json:"builtInAdminPasswordIsEmpty"`
	BuiltInAdminUsernameCollide bool   `json:"builtInAdminUsernameCollide"`
}

type Application

type Application struct {
	Name    string
	Vendor  string
	Version string
}

func NewApplication

func NewApplication(name, vendor, version string) *Application

NewApplication returns a pointer to structure with application data

type Config

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

func NewConfig

func NewConfig(dest Destination, server string) *Config

NewConfig returns a pointer to structure with the configuration for connecting to the API server Parameters:

dest   - control destination (Admin - for server control, Client - for mail client control)
server - address without schema and port

func (*Config) NewConnection

func (c *Config) NewConnection() (*Connection, error)

type Connection

type Connection struct {
	Config *Config
	Token  *string
	// contains filtered or unexported fields
}

func (*Connection) CallRaw

func (c *Connection) CallRaw(method string, params interface{}) ([]byte, error)

func (*Connection) DomainsCheckPublicFoldersIntegrity

func (c *Connection) DomainsCheckPublicFoldersIntegrity() error

DomainsCheckPublicFoldersIntegrity checks integrity of all public folders. If corrupted folder is found, try to fix it.

func (*Connection) DomainsGet

func (c *Connection) DomainsGet(query SearchQuery) (DomainList, error)

DomainsGet obtains a list of domains.

func (*Connection) DomainsGetDomainFooterPlaceholders

func (c *Connection) DomainsGetDomainFooterPlaceholders() (PlaceHolderList, error)

DomainsGetDomainFooterPlaceholders returns all supported placeholders for domain footer.

func (*Connection) DomainsGetSettings

func (c *Connection) DomainsGetSettings() (*DomainSetting, error)

DomainsGetSettings obtains settings common in all domains.

func (*Connection) DomainsSaveFooterImage

func (c *Connection) DomainsSaveFooterImage(fileID string) (*string, error)

DomainsSaveFooterImage - save a new footer's image.

func (*Connection) Login

func (c *Connection) Login(user, password string, app *Application) error

Login - log in a given user. Please note that with a session to one module you cannot use another one (eg. with admin session you cannot use webmail). Parameters:

user     - login name + domain name (can be omitted if primary) of the user to be logged in,
           e.g. "jdoe" or "jdoe@company.com"
password - password of the user to be logged in
app      - client application description

func (*Connection) Logout

func (c *Connection) Logout() error

Logout - Log out the callee

func (*Connection) ServerGetBrowserLanguages

func (c *Connection) ServerGetBrowserLanguages() ([]string, error)

ServerGetBrowserLanguages returns a list of user-preferred languages set in browser.

func (*Connection) ServerGetClientStatistics

func (c *Connection) ServerGetClientStatistics() (*bool, error)

ServerGetClientStatistics obtains client statistics settings.

func (*Connection) ServerGetColumnList

func (c *Connection) ServerGetColumnList(objectName, methodName string) ([]string, error)

ServerGetColumnList obtains a list of columns dependent on callee role.

func (*Connection) ServerGetConnections

func (c *Connection) ServerGetConnections(query SearchQuery) (ConnectionList, error)

ServerGetConnections obtains a information about active connections.

func (*Connection) ServerGetDirs

func (c *Connection) ServerGetDirs(path string) ([]DirList, error)

ServerGetDirs obtains a list of directories in a particular path.

func (*Connection) ServerGetDownloadProgress

func (c *Connection) ServerGetDownloadProgress() (*int, error)

ServerGetDownloadProgress obtains a progress of installation package downloading.

func (*Connection) ServerGetLicenseExtensionsList

func (c *Connection) ServerGetLicenseExtensionsList() (ExtensionsList, error)

ServerGetLicenseExtensionsList obtains a list of license extensionsList, caller must be authenticated.

func (*Connection) ServerGetNamedConstantList

func (c *Connection) ServerGetNamedConstantList() (NamedConstantList, error)

ServerGetNamedConstantList obtains server side list of constants.

func (*Connection) ServerGetOpenedFoldersInfo

func (c *Connection) ServerGetOpenedFoldersInfo(query SearchQuery) (FolderInfoList, error)

ServerGetOpenedFoldersInfo obtains a information about folders opened on server.

func (*Connection) ServerGetProductInfo

func (c *Connection) ServerGetProductInfo() (*ProductInfo, error)

ServerGetProductInfo gets basic information about product and its version.

func (*Connection) ServerGetRemoteAdministration

func (c *Connection) ServerGetRemoteAdministration() (*Administration, error)

ServerGetRemoteAdministration obtains a information about remote administration settings.

func (*Connection) ServerGetServerHash

func (c *Connection) ServerGetServerHash() (string, error)

ServerGetServerHash obtains a hash string created from product name, version, and installation time.

func (*Connection) ServerGetServerIpAddresses

func (c *Connection) ServerGetServerIpAddresses() ([]string, error)

ServerGetServerIpAddresses obtains a list all server IP addresses.

func (*Connection) ServerGetServerTime

func (c *Connection) ServerGetServerTime() (*ServerTimeInfo, error)

ServerGetServerTime obtains server time information.

func (*Connection) ServerGetVersion

func (c *Connection) ServerGetVersion() (*ServerVersion, error)

ServerGetVersion obtains a information about server version.

func (*Connection) ServerGetWebSessions

func (c *Connection) ServerGetWebSessions(query SearchQuery) ([]WebSessionList, error)

ServerGetWebSessions obtains a information about web component sessions.

func (*Connection) ServerPathExists

func (c *Connection) ServerPathExists(username, password, path string) (*string, error)

ServerPathExists checks if the selected path exists and is accessible from the server. Parameters:

path	    - directory name
credentials	- (optional) user name and password required to access network disk
result	    - result of check

func (*Connection) ServerReboot

func (c *Connection) ServerReboot() error

ServerReboot - reboot the host system

func (*Connection) ServerRestart

func (c *Connection) ServerRestart() error

ServerRestart - restart server. The server must run as service.

func (*Connection) ServerUpgrade

func (c *Connection) ServerUpgrade() error

ServerUpgrade - upgrade server to the latest version. The server must run as service.

func (*Connection) SessionGetDomain

func (c *Connection) SessionGetDomain() (*Domain, error)

SessionGetDomain gets domain information of the currently logged user. Only name, displayName, ID, description and password policy related fields are filled.

func (*Connection) SessionWhoAmI

func (c *Connection) SessionWhoAmI() (*UserDetails, error)

SessionWhoAmI determines the currently logged user (caller, e.g. administrator). Fields id and domainId can be empty if built-in administrator is logged-in.

type ConnectionList

type ConnectionList []Connections

type Connections

type Connections struct {
	Proto       string `json:"proto"`
	Extension   string `json:"extension"`
	IsSecure    bool   `json:"isSecure"`
	Time        string `json:"time"`
	From        string `json:"from"`
	User        string `json:"user"`
	Description string `json:"description"`
}

type Constant

type Constant struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type Credentials

type Credentials struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type Destination

type Destination uint8
const (
	Admin Destination = iota
	Client
)

type DirList

type DirList struct {
	Name            string `json:"name"`
	HasSubdirectory bool   `json:"hasSubdirectory"`
}

type Domain

type Domain struct {
	ID                        string `json:"id"`
	Name                      string `json:"name"`
	Description               string `json:"description"`
	IsPrimary                 bool   `json:"isPrimary"`
	UserMaxCount              int    `json:"userMaxCount"`
	PasswordExpirationEnabled bool   `json:"passwordExpirationEnabled"`
	PasswordExpirationDays    int    `json:"passwordExpirationDays"`
	PasswordHistoryCount      int    `json:"passwordHistoryCount"`
	PasswordComplexityEnabled bool   `json:"passwordComplexityEnabled"`
	PasswordMinimumLength     int    `json:"passwordMinimumLength"`
	OutgoingMessageLimit      `json:"outgoingMessageLimit"`
	DeletedItems              struct {
		IsEnabled bool `json:"isEnabled"`
		Days      int  `json:"days"`
	} `json:"deletedItems"`
	JunkEmail struct {
		IsEnabled bool `json:"isEnabled"`
		Days      int  `json:"days"`
	} `json:"junkEmail"`
	SentItems struct {
		IsEnabled bool `json:"isEnabled"`
		Days      int  `json:"days"`
	} `json:"sentItems"`
	AutoDelete struct {
		IsEnabled bool `json:"isEnabled"`
		Days      int  `json:"days"`
	} `json:"autoDelete"`
	KeepForRecovery   `json:"keepForRecovery"`
	AliasList         []interface{} `json:"aliasList"`
	ForwardingOptions `json:"forwardingOptions"`
	Service           struct {
		IsEnabled      bool   `json:"isEnabled"`
		ServiceType    string `json:"serviceType"`
		CustomMapFile  string `json:"customMapFile"`
		Authentication struct {
			Username string `json:"username"`
			Password string `json:"password"`
			IsSecure bool   `json:"isSecure"`
		} `json:"authentication"`
		Hostname       string `json:"hostname"`
		BackupHostname string `json:"backupHostname"`
		DirectoryName  string `json:"directoryName"`
		LdapSuffix     string `json:"ldapSuffix"`
	} `json:"service"`
	DomainFooter struct {
		IsUsed         bool   `json:"isUsed"`
		Text           string `json:"text"`
		IsHTML         bool   `json:"isHtml"`
		IsUsedInDomain bool   `json:"isUsedInDomain"`
	} `json:"domainFooter"`
	KerberosRealm string `json:"kerberosRealm"`
	WinNtName     string `json:"winNtName"`
	PamRealm      string `json:"pamRealm"`
	IPAddressBind struct {
		Enabled bool   `json:"enabled"`
		Value   string `json:"value"`
	} `json:"ipAddressBind"`
		IsUsed bool   `json:"isUsed"`
		URL    string `json:"url"`
	} `json:"logo"`
		IsEnabled bool   `json:"isEnabled"`
		URL       string `json:"url"`
		ID        string `json:"id"`
	} `json:"customClientLogo"`
	CheckSpoofedSender bool `json:"checkSpoofedSender"`
	RenameInfo         `json:"renameInfo"`
	DomainQuota        struct {
		DiskSizeLimit struct {
			IsActive bool `json:"isActive"`
			Limit    struct {
				Value int    `json:"value"`
				Units string `json:"units"`
			} `json:"limit"`
		} `json:"diskSizeLimit"`
		ConsumedSize struct {
			Value int    `json:"value"`
			Units string `json:"units"`
		} `json:"consumedSize"`
		Notification struct {
			Type   string `json:"type"`
			Period struct {
				Value int    `json:"value"`
				Units string `json:"units"`
			} `json:"period"`
		} `json:"notification"`
		WarningLimit int    `json:"warningLimit"`
		Email        string `json:"email"`
		Blocks       bool   `json:"blocks"`
	} `json:"domainQuota"`
	IsDistributed             bool   `json:"isDistributed"`
	IsDkimEnabled             bool   `json:"isDkimEnabled"`
	IsLdapManagementAllowed   bool   `json:"isLdapManagementAllowed"`
	IsInstantMessagingEnabled bool   `json:"isInstantMessagingEnabled"`
	UseRemoteArchiveAddress   bool   `json:"useRemoteArchiveAddress"`
	RemoteArchiveAddress      string `json:"remoteArchiveAddress"`
	ArchiveLocalMessages      bool   `json:"archiveLocalMessages"`
	ArchiveIncomingMessages   bool   `json:"archiveIncomingMessages"`
	ArchiveOutgoingMessages   bool   `json:"archiveOutgoingMessages"`
	ArchiveBeforeFilter       bool   `json:"archiveBeforeFilter"`
}

type DomainInfo

type DomainInfo struct {
	ID                   string `json:"id"`
	Name                 string `json:"name"`
	Description          string `json:"description"`
	IsPrimary            bool   `json:"isPrimary"`
	UserMaxCount         int    `json:"userMaxCount"`
	OutgoingMessageLimit `json:"outgoingMessageLimit"`
	KeepForRecovery      `json:"keepForRecovery"`
	AliasList            []interface{} `json:"aliasList"`
	ForwardingOptions    `json:"forwardingOptions"`
	KerberosRealm        string `json:"kerberosRealm"`
	WinNtName            string `json:"winNtName"`
	PamRealm             string `json:"pamRealm"`
	IPAddressBind        struct {
		Enabled bool   `json:"enabled"`
		Value   string `json:"value"`
	} `json:"ipAddressBind"`
	RenameInfo    `json:"renameInfo"`
	IsDistributed bool `json:"isDistributed"`
}

type DomainList

type DomainList []DomainInfo

type DomainSetting

type DomainSetting struct {
	Hostname               string `json:"hostname"`
	PublicFoldersPerDomain bool   `json:"publicFoldersPerDomain"`
	ServerID               string `json:"serverId"`
}

type ErrorReport

type ErrorReport struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    struct {
		MessageParameters struct {
			PositionalParameters []string `json:"positionalParameters"`
			Plurality            int      `json:"plurality"`
		} `json:"messageParameters"`
	} `json:"data"`
}

type ExtensionsList

type ExtensionsList []string

type FolderInfo

type FolderInfo struct {
	FolderName     string   `json:"folderName"`
	ReferenceCount int      `json:"referenceCount"`
	IndexLoaded    bool     `json:"indexLoaded"`
	Users          []string `json:"users"`
}

type FolderInfoList

type FolderInfoList []FolderInfo

type ForwardingOptions

type ForwardingOptions struct {
	IsEnabled   bool   `json:"isEnabled"`
	Host        string `json:"host"`
	Port        int    `json:"port"`
	How         string `json:"how"`
	PreventLoop bool   `json:"preventLoop"`
}

type KeepForRecovery

type KeepForRecovery struct {
	IsEnabled bool `json:"isEnabled"`
	Days      int  `json:"days"`
}

type NamedConstantList

type NamedConstantList []Constant

type OutgoingMessageLimit

type OutgoingMessageLimit struct {
	IsActive bool `json:"isActive"`
	Limit    struct {
		Value int    `json:"value"`
		Units string `json:"units"`
	} `json:"limit"`
}

type PlaceHolderList

type PlaceHolderList []Constant

type ProductInfo

type ProductInfo struct {
	ProductName   string `json:"productName"`
	Version       string `json:"version"`
	BuildNumber   string `json:"buildNumber"`
	OsName        string `json:"osName"`
	Os            string `json:"os"`
	ReleaseType   string `json:"releaseType"`
	DeployedType  string `json:"deployedType"`
	IsDockerImage bool   `json:"isDockerImage"`
	UpdateInfo    struct {
		Result      string `json:"result"`
		Description string `json:"description"`
		DownloadURL string `json:"downloadUrl"`
		InfoURL     string `json:"infoUrl"`
	} `json:"updateInfo"`
	CentralManagementSet bool `json:"centralManagementSet"`
}

type RenameInfo

type RenameInfo struct {
	IsRenamed bool   `json:"isRenamed"`
	OldName   string `json:"oldName"`
	NewName   string `json:"newName"`
}

type SearchQuery

type SearchQuery struct {
	Fields     []string          `json:"fields"`
	Conditions []string          `json:"conditions"`
	Start      int               `json:"start"`
	Limit      int               `json:"limit"`
	OrderBy    map[string]string `json:"orderBy,omitempty"`
}

func NewSearchQuery

func NewSearchQuery(fields []string, conditions []string, start, limit int, orderBy map[string]string) SearchQuery

type ServerTimeInfo

type ServerTimeInfo struct {
	TimezoneOffset int `json:"timezoneOffset"`
	StartTime      int `json:"startTime"`
	CurrentTime    int `json:"currentTime"`
}

type ServerVersion

type ServerVersion struct {
	Product  string `json:"product"`
	Version  string `json:"version"`
	Major    int    `json:"major"`
	Minor    int    `json:"minor"`
	Revision int    `json:"revision"`
	Build    int    `json:"build"`
}

type UserDetails

type UserDetails struct {
	ID            string `json:"id"`
	DomainID      string `json:"domainId"`
	LoginName     string `json:"loginName"`
	FullName      string `json:"fullName"`
	EffectiveRole struct {
		UserRole           string `json:"userRole"`
		PublicFolderRight  bool   `json:"publicFolderRight"`
		ArchiveFolderRight bool   `json:"archiveFolderRight"`
	} `json:"effectiveRole"`
}

type WebSessionList

type WebSessionList struct {
	ID             string `json:"id"`
	UserName       string `json:"userName"`
	ClientAddress  string `json:"clientAddress"`
	ExpirationTime string `json:"expirationTime"`
	ComponentType  string `json:"componentType"`
	IsSecure       bool   `json:"isSecure"`
}

Jump to

Keyboard shortcuts

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