Documentation ¶
Index ¶
- Constants
- type API
- type Admin
- type AdminContext
- func (c *AdminContext) ConvertResellerToUser(username string, reseller string) error
- func (c *AdminContext) ConvertUserToReseller(username string) error
- func (c *AdminContext) CreateResellerPackage(pack ResellerPackage) error
- func (c *AdminContext) DeleteResellerPackages(packs ...string) error
- func (c *AdminContext) DisableRedis() error
- func (c *AdminContext) EnableRedis() error
- func (c *AdminContext) GetAllUsers() ([]string, error)
- func (c *AdminContext) GetLicense() (*License, error)
- func (c *AdminContext) GetLoginHistory() ([]*LoginHistory, error)
- func (c *AdminContext) GetResellerPackage(packageName string) (ResellerPackage, error)
- func (c *AdminContext) GetResellerPackages() ([]ResellerPackage, error)
- func (c *AdminContext) GetResellers() ([]string, error)
- func (c *AdminContext) GetResellersWithUsage() ([]string, error)
- func (c *AdminContext) LoginAsMyReseller(username string) (*ResellerContext, error)
- func (c *AdminContext) MoveUserToReseller(username string, reseller string) error
- func (c *AdminContext) RenameResellerPackage(oldPackName string, newPackName string) error
- func (c *AdminContext) RestartDirectAdmin() error
- func (c *AdminContext) UpdateDirectAdmin() error
- func (c *AdminContext) UpdateResellerPackage(pack ResellerPackage) error
- type BasicSysInfo
- type DNSRecord
- type Database
- type DatabaseFormat
- type DatabaseProcess
- type DatabaseUser
- type DatabaseWithUser
- type Domain
- type EmailAccount
- type License
- type LoginHistory
- type LoginKeyURL
- type Package
- type Reseller
- type ResellerContext
- func (c *ResellerContext) CheckUserExists(username string) error
- func (c *ResellerContext) CreatePackage(pack Package) error
- func (c *ResellerContext) CreateUser(user UserConfig, password string, emailUser bool, customPackage *Package) error
- func (c *ResellerContext) DeletePackages(packs ...string) error
- func (c *ResellerContext) DeleteUsers(usernames ...string) error
- func (c *ResellerContext) GetMyUsers() ([]string, error)
- func (c *ResellerContext) GetMyUsersWithUsage() ([]User, error)
- func (c *ResellerContext) GetPackage(packageName string) (Package, error)
- func (c *ResellerContext) GetPackages() ([]Package, error)
- func (c *ResellerContext) GetUserConfig(username string) (*UserConfig, error)
- func (c *ResellerContext) GetUserUsage(username string) (*UserUsage, error)
- func (c *ResellerContext) LoginAsMyUser(username string) (*UserContext, error)
- func (c *ResellerContext) RenamePackage(oldPackName string, newPackName string) error
- func (c *ResellerContext) SuspendUser(username string) error
- func (c *ResellerContext) SuspendUsers(usernames ...string) error
- func (c *ResellerContext) UnsuspendUser(username string) error
- func (c *ResellerContext) UnsuspendUsers(usernames ...string) error
- func (c *ResellerContext) UpdatePackage(pack Package) error
- type ResellerPackage
- type Subdomain
- type SysInfo
- type User
- type UserConfig
- type UserContext
- func (c *UserContext) ChangeWordPressUserPassword(locationId string, userId int, password string) error
- func (c *UserContext) CheckDNSRecordExists(checkField string, domain string, dnsRecord DNSRecord) error
- func (c *UserContext) CheckDomainExists(domain string) error
- func (c *UserContext) CheckFileExists(filePath string) error
- func (c *UserContext) CreateDNSRecord(domain string, dnsRecord DNSRecord) error
- func (c *UserContext) CreateDatabase(database *Database) error
- func (c *UserContext) CreateDatabaseUser(databaseUser *DatabaseUser) error
- func (c *UserContext) CreateDatabaseWithUser(database *DatabaseWithUser) error
- func (c *UserContext) CreateDomain(domain Domain) error
- func (c *UserContext) CreateEmailAccount(emailAccount EmailAccount) error
- func (c *UserContext) CreateEmailForwarder(domain string, user string, emails ...string) error
- func (c *UserContext) CreateFile(uploadToPath string, filePath string) error
- func (c *UserContext) CreateFiles(uploadToPath string, filePaths ...string) error
- func (c *UserContext) CreateLoginURL(loginKeyURL *LoginKeyURL) (*LoginKeyURL, error)
- func (c *UserContext) CreateSubdomain(subdomain Subdomain) error
- func (c *UserContext) CreateWordPressInstall(install WordPressInstall, createDatabase bool) error
- func (c *UserContext) CreateWordPressInstallQuick(install WordPressInstallQuick) error
- func (c *UserContext) DeleteDNSRecords(dnsRecords ...DNSRecord) error
- func (c *UserContext) DeleteDatabase(databaseName string) error
- func (c *UserContext) DeleteDomains(deleteData bool, domains ...string) error
- func (c *UserContext) DeleteEmailAccount(domain string, name string) error
- func (c *UserContext) DeleteEmailForwarders(domain string, names ...string) error
- func (c *UserContext) DeleteFiles(skipTrash bool, files ...string) error
- func (c *UserContext) DeleteSubdomains(deleteData bool, domain string, subdomains ...string) error
- func (c *UserContext) DeleteWordPressInstall(id string) error
- func (c *UserContext) DownloadDatabase(name string, format DatabaseFormat, filePath string) error
- func (c *UserContext) ExportDatabase(databaseName string, gzip bool) ([]byte, error)
- func (c *UserContext) ExtractFile(filePath string, file string) error
- func (c *UserContext) GetBasicSysInfo() (*BasicSysInfo, error)
- func (c *UserContext) GetDNSRecords(domain string) ([]DNSRecord, error)
- func (c *UserContext) GetDatabase(databaseName string) (*Database, error)
- func (c *UserContext) GetDatabaseProcesses() ([]*DatabaseProcess, error)
- func (c *UserContext) GetDatabases() ([]*Database, error)
- func (c *UserContext) GetDomain(domainName string) (Domain, error)
- func (c *UserContext) GetDomains() ([]Domain, error)
- func (c *UserContext) GetEmailAccounts(domain string) ([]EmailAccount, error)
- func (c *UserContext) GetEmailForwarders(domain string) (map[string][]string, error)
- func (c *UserContext) GetLoginURLs() ([]*LoginKeyURL, error)
- func (c *UserContext) GetMyUserConfig() (*UserConfig, error)
- func (c *UserContext) GetMyUserUsage() (*UserUsage, error)
- func (c *UserContext) GetMyUsername() string
- func (c *UserContext) GetSysInfo() (*SysInfo, error)
- func (c *UserContext) GetWordPressInstalls() ([]*WordPressLocation, error)
- func (c *UserContext) GetWordPressSSOLink(locationId string, userId int) (string, error)
- func (c *UserContext) GetWordPressUsers(locationId string) ([]*WordPressUser, error)
- func (c *UserContext) ImportDatabase(databaseName string, emptyExistingDatabase bool, sql []byte) error
- func (c *UserContext) IssueSSL(domain string, hostnamesToCertify ...string) error
- func (c *UserContext) ListDomains() (domainList []string, err error)
- func (c *UserContext) ListSubdomains(domain string) (subdomainList []string, err error)
- func (c *UserContext) Login() error
- func (c *UserContext) SetDefaultDomain(domain string) error
- func (c *UserContext) UpdateDNSRecord(domain string, originalDNSRecord DNSRecord, updatedDNSRecord DNSRecord) error
- func (c *UserContext) UpdateDatabaseUserHosts(username string, hosts []string) error
- func (c *UserContext) UpdateDatabaseUserPassword(username string, password string) error
- func (c *UserContext) UpdateDomain(domain Domain) error
- func (c *UserContext) UpdateEmailAccount(emailAccount EmailAccount) error
- func (c *UserContext) UpdateEmailForwarder(domain string, user string, emails ...string) error
- func (c *UserContext) UpdateSubdomainRoot(subdomain Subdomain) error
- func (c *UserContext) VerifyEmailAccount(address string, password string) error
- type UserUsage
- type WordPressInstall
- type WordPressInstallQuick
- type WordPressLocation
- type WordPressUser
Constants ¶
const ( DatabaseFormatGz = DatabaseFormat("gz") DatabaseFormatSql = DatabaseFormat("sql") )
const ( AccountRoleAdmin = "Admin" AccountRoleReseller = "Reseller" AccountRoleUser = "User" )
const Unlimited int = -1
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) LoginAsAdmin ¶
func (a *API) LoginAsAdmin(username string, passkey string) (*AdminContext, error)
LoginAsAdmin verifies the provided credentials against the DA API, then returns an admin-level context. The passkey can either be the user's password, or a login key
func (*API) LoginAsReseller ¶
func (a *API) LoginAsReseller(username string, passkey string) (*ResellerContext, error)
LoginAsReseller verifies the provided credentials against the DA API, then returns a reseller-level context. The passkey can either be the user's password, or a login key
func (*API) LoginAsUser ¶
func (a *API) LoginAsUser(username string, passkey string) (*UserContext, error)
LoginAsUser verifies the provided credentials against the DA API, then returns a user-level context. The passkey can either be the user's password, or a login key
type AdminContext ¶
type AdminContext struct {
ResellerContext
}
func (*AdminContext) ConvertResellerToUser ¶
func (c *AdminContext) ConvertResellerToUser(username string, reseller string) error
func (*AdminContext) ConvertUserToReseller ¶
func (c *AdminContext) ConvertUserToReseller(username string) error
func (*AdminContext) CreateResellerPackage ¶
func (c *AdminContext) CreateResellerPackage(pack ResellerPackage) error
CreateResellerPackage (admin) creates the provided package
func (*AdminContext) DeleteResellerPackages ¶
func (c *AdminContext) DeleteResellerPackages(packs ...string) error
DeleteResellerPackages (admin) deletes all the specified packs for the session user
func (*AdminContext) DisableRedis ¶
func (c *AdminContext) DisableRedis() error
func (*AdminContext) EnableRedis ¶
func (c *AdminContext) EnableRedis() error
func (*AdminContext) GetAllUsers ¶
func (c *AdminContext) GetAllUsers() ([]string, error)
GetAllUsers (admin) returns an array of all users
func (*AdminContext) GetLicense ¶
func (c *AdminContext) GetLicense() (*License, error)
func (*AdminContext) GetLoginHistory ¶
func (c *AdminContext) GetLoginHistory() ([]*LoginHistory, error)
func (*AdminContext) GetResellerPackage ¶
func (c *AdminContext) GetResellerPackage(packageName string) (ResellerPackage, error)
GetResellerPackage (admin) returns the single specified package
func (*AdminContext) GetResellerPackages ¶
func (c *AdminContext) GetResellerPackages() ([]ResellerPackage, error)
GetResellerPackages (admin) returns all packages belonging to the session user
func (*AdminContext) GetResellers ¶
func (c *AdminContext) GetResellers() ([]string, error)
GetResellers (admin) returns an array of all resellers
func (*AdminContext) GetResellersWithUsage ¶
func (c *AdminContext) GetResellersWithUsage() ([]string, error)
TODO: finish implementation
func (*AdminContext) LoginAsMyReseller ¶
func (c *AdminContext) LoginAsMyReseller(username string) (*ResellerContext, error)
func (*AdminContext) MoveUserToReseller ¶
func (c *AdminContext) MoveUserToReseller(username string, reseller string) error
func (*AdminContext) RenameResellerPackage ¶
func (c *AdminContext) RenameResellerPackage(oldPackName string, newPackName string) error
RenameResellerPackage (admin) renames the provided package
func (*AdminContext) RestartDirectAdmin ¶
func (c *AdminContext) RestartDirectAdmin() error
func (*AdminContext) UpdateDirectAdmin ¶
func (c *AdminContext) UpdateDirectAdmin() error
func (*AdminContext) UpdateResellerPackage ¶
func (c *AdminContext) UpdateResellerPackage(pack ResellerPackage) error
UpdateResellerPackage (admin) accepts a Package object and updates the version on DA with it
type BasicSysInfo ¶
type BasicSysInfo struct { AllowPasswordReset bool `json:"allowPasswordReset"` Hostname string `json:"hostname"` Languages []string `json:"languages"` LicenseError string `json:"licenseError"` LicenseTrial bool `json:"licenseTrial"` LicenseValid bool `json:"licenseValid"` OtpTrustDays int `json:"otpTrustDays"` Time time.Time `json:"time"` }
type Database ¶
type Database struct { Name string `json:"database"` DefaultCharset string `json:"defaultCharset"` DefaultCollation string `json:"defaultCollation"` DefinerIssues int `json:"definerIssues"` EventCount int `json:"eventCount"` RoutineCount int `json:"routineCount"` SizeBytes int `json:"sizeBytes"` TableCount int `json:"tableCount"` TriggerCount int `json:"triggerCount"` UserCount int `json:"userCount"` ViewCount int `json:"viewCount"` }
type DatabaseFormat ¶
type DatabaseFormat string
type DatabaseProcess ¶
type DatabaseUser ¶
type DatabaseWithUser ¶
type Domain ¶
type Domain struct { Active bool `json:"active" yaml:"active"` BandwidthQuota int `json:"bandwidthQuota" yaml:"bandwidthQuota"` BandwidthUsage int `json:"bandwidthUsage" yaml:"bandwidthUsage"` CgiEnabled bool `json:"cgiEnabled" yaml:"cgiEnabled"` DefaultDomain bool `json:"defaultDomain" yaml:"defaultDomain"` DiskQuota int `json:"diskQuota" yaml:"diskQuota"` DiskUsage int `json:"diskUsage" yaml:"diskUsage"` Domain string `json:"domain" yaml:"domain"` IpAddresses []string `json:"ipAddresses" yaml:"ipAddresses"` ModSecurityEnabled bool `json:"modSecurityEnabled" yaml:"modSecurityEnabled"` OpenBaseDirEnabled bool `json:"openBaseDirEnabled" yaml:"openBaseDirEnabled"` PhpEnabled bool `json:"phpEnabled" yaml:"phpEnabled"` PhpSelectorEnabled bool `json:"phpSelectorEnabled" yaml:"phpSelectorEnabled"` PhpVersion string `json:"phpVersion" yaml:"phpVersion"` SafeMode bool `json:"safeMode" yaml:"safeMode"` SslEnabled bool `json:"sslEnabled" yaml:"sslEnabled"` Subdomains []string `json:"subdomains" yaml:"subdomains"` SubdomainUsage int `json:"subdomainUsage" yaml:"subdomainUsage"` Suspended bool `json:"suspended" yaml:"suspended"` Username string `json:"username" yaml:"username"` }
type EmailAccount ¶
type EmailAccount struct { DiskQuota int `json:"diskQuota" yaml:"diskQuota"` DiskUsage int `json:"diskUsage" yaml:"diskUsage"` Domain string `json:"domain" yaml:"domain"` Password string `json:"password" yaml:"password"` SendQuota int `json:"sendQuota" yaml:"sendQuota"` SendUsage int `json:"sendUsage" yaml:"sendUsage"` Suspended bool `json:"suspended" yaml:"suspended"` Username string `json:"username" yaml:"username"` }
type License ¶
type License struct { Expires time.Time `json:"expires"` Lid int `json:"lid"` Limits struct { Legacy bool `json:"legacy"` MaxAdminsOrResellers int `json:"maxAdminsOrResellers"` MaxDomains int `json:"maxDomains"` MaxUsers int `json:"maxUsers"` OnlyVPS bool `json:"onlyVPS"` ProPack bool `json:"proPack"` Trial bool `json:"trial"` } `json:"limits"` Name string `json:"name"` Pid int `json:"pid"` Type string `json:"type"` Uid int `json:"uid"` Usage struct { AdminsOrResellers int `json:"adminsOrResellers"` Domains int `json:"domains"` Users int `json:"users"` } `json:"usage"` }
type LoginHistory ¶
type LoginKeyURL ¶
type Package ¶
type Package struct { AnonymousFtpEnabled bool `json:"anonymousFtpEnabled" yaml:"anonymousFtpEnabled"` BandwidthQuota int `json:"bandwidthQuota" yaml:"bandwidthQuota"` CpuQuota int `json:"cpuQuota" yaml:"cpuQuota"` CatchallEnabled bool `json:"catchallEnabled" yaml:"catchallEnabled"` CgiEnabled bool `json:"cgiEnabled" yaml:"cgiEnabled"` CronEnabled bool `json:"cronEnabled" yaml:"cronEnabled"` DNSControlEnabled bool `json:"dnsControlEnabled" yaml:"dnsControlEnabled"` DomainPointerQuota int `json:"domainPointerQuota" yaml:"domainPointerQuota"` DomainQuota int `json:"domainQuota" yaml:"domainQuota"` EmailAutoresponderQuota int `json:"emailAutoresponderQuota" yaml:"emailAutoresponderQuota"` EmailForwarderQuota int `json:"emailForwarderQuota" yaml:"emailForwarderQuota"` EmailMailingListQuota int `json:"emailMailingListQuota" yaml:"emailMailingListQuota"` EmailQuota int `json:"emailQuota" yaml:"emailQuota"` FtpQuota int `json:"ftp" yaml:"ftpQuota"` GitEnabled bool `json:"gitEnabled" yaml:"gitEnabled"` IoReadBandwidthMax int `json:"ioReadBandwidthMax" yaml:"ioReadBandwidthMax"` IoReadIopsMax int `json:"ioReadIopsMax" yaml:"ioReadIopsMax"` IoWriteBandwidthMax int `json:"ioWriteBandwidthMax" yaml:"ioWriteBandwidthMax"` IoWriteIopsMax int `json:"ioWriteIopsMax" yaml:"ioWriteIopsMax"` InodeQuota int `json:"inodeQuota" yaml:"inodeQuota"` JailEnabled bool `json:"jailEnabled" yaml:"jailEnabled"` Language string `json:"language" yaml:"language"` LoginKeysEnabled bool `json:"loginKeysEnabled" yaml:"loginKeysEnabled"` MemoryHigh int `json:"memoryHigh" yaml:"memoryHigh"` MemoryMax int `json:"memoryMax" yaml:"memoryMax"` MysqlQuota int `json:"mysqlQuota" yaml:"mysqlQuota"` Name string `json:"name" yaml:"name"` NginxEnabled bool `json:"nginxEnabled" yaml:"nginxEnabled"` PhpEnabled bool `json:"phpEnabled" yaml:"phpEnabled"` Quota int `json:"quota" yaml:"quota"` RedisEnabled bool `json:"redisEnabled" yaml:"redisEnabled"` SshEnabled bool `json:"sshEnabled" yaml:"sshEnabled"` Skin string `json:"skin" yaml:"skin"` SpamAssassinEnabled bool `json:"spamAssassinEnabled" yaml:"spamAssassinEnabled"` SslEnabled bool `json:"sslEnabled" yaml:"sslEnabled"` SubdomainQuota int `json:"subdomainQuota" yaml:"subdomainQuota"` SuspendAtLimitEnabled bool `json:"suspendAtLimitEnabled" yaml:"suspendAtLimitEnabled"` SysInfoEnabled bool `json:"sysInfoEnabled" yaml:"sysInfoEnabled"` TasksMax int `json:"tasksMax" yaml:"tasksMax"` WordpressEnabled bool `json:"wordpressEnabled" yaml:"wordpressEnabled"` }
type ResellerContext ¶
type ResellerContext struct {
UserContext
}
func (*ResellerContext) CheckUserExists ¶
func (c *ResellerContext) CheckUserExists(username string) error
CheckUserExists (reseller) checks if the given user exists
func (*ResellerContext) CreatePackage ¶
func (c *ResellerContext) CreatePackage(pack Package) error
CreatePackage (reseller) creates the provided package
func (*ResellerContext) CreateUser ¶
func (c *ResellerContext) CreateUser(user UserConfig, password string, emailUser bool, customPackage *Package) error
CreateUser (reseller) create a user.
The following fields must be populated: Domain, Email, IpAddresses, Package, Username
func (*ResellerContext) DeletePackages ¶
func (c *ResellerContext) DeletePackages(packs ...string) error
DeletePackages (reseller) deletes all the specified packs for the session user
func (*ResellerContext) DeleteUsers ¶
func (c *ResellerContext) DeleteUsers(usernames ...string) error
DeleteUsers (reseller) deletes all the users associated with the given usernames
func (*ResellerContext) GetMyUsers ¶
func (c *ResellerContext) GetMyUsers() ([]string, error)
GetMyUsers (reseller) returns all users belonging to the session user
func (*ResellerContext) GetMyUsersWithUsage ¶
func (c *ResellerContext) GetMyUsersWithUsage() ([]User, error)
GetMyUsersWithUsage (reseller) returns all users belonging to the session user, along with their UserConfig and UserUsage data
func (*ResellerContext) GetPackage ¶
func (c *ResellerContext) GetPackage(packageName string) (Package, error)
GetPackage (reseller) returns the single specified package
func (*ResellerContext) GetPackages ¶
func (c *ResellerContext) GetPackages() ([]Package, error)
GetPackages (reseller) returns all packages belonging to the session user
func (*ResellerContext) GetUserConfig ¶
func (c *ResellerContext) GetUserConfig(username string) (*UserConfig, error)
GetUserConfig (reseller) returns the given user's config
func (*ResellerContext) GetUserUsage ¶
func (c *ResellerContext) GetUserUsage(username string) (*UserUsage, error)
GetUserUsage (reseller) returns the given user's usage.
func (*ResellerContext) LoginAsMyUser ¶
func (c *ResellerContext) LoginAsMyUser(username string) (*UserContext, error)
func (*ResellerContext) RenamePackage ¶
func (c *ResellerContext) RenamePackage(oldPackName string, newPackName string) error
RenamePackage (reseller) renames the provided package
func (*ResellerContext) SuspendUser ¶
func (c *ResellerContext) SuspendUser(username string) error
func (*ResellerContext) SuspendUsers ¶
func (c *ResellerContext) SuspendUsers(usernames ...string) error
func (*ResellerContext) UnsuspendUser ¶
func (c *ResellerContext) UnsuspendUser(username string) error
func (*ResellerContext) UnsuspendUsers ¶
func (c *ResellerContext) UnsuspendUsers(usernames ...string) error
func (*ResellerContext) UpdatePackage ¶
func (c *ResellerContext) UpdatePackage(pack Package) error
UpdatePackage (reseller) accepts a Package object and updates the version on DA with it
type ResellerPackage ¶
type SysInfo ¶
type SysInfo struct { CpuCount int `json:"cpuCount" yaml:"cpuCount"` Cpus map[string]struct { MHz float64 `json:"mhz"` Model string `json:"model"` Vendor string `json:"vendor"` } SystemLoad struct { Last1Minute string `json:"last1Minute"` Last5Minutes string `json:"last5Minutes"` Last15Minutes string `json:"last15Minutes"` } `json:"systemLoad"` MemInfo struct { Active int `json:"active"` ActiveAnon int `json:"activeAnon"` ActiveFile int `json:"activeFile"` AnonHugePages int `json:"anonHugePages"` AnonPages int `json:"anonPages"` Bounce int `json:"bounce"` Buffers int `json:"buffers"` Cached int `json:"cached"` CommitLimit int `json:"commitLimit"` CommittedAS int `json:"committedAs"` DirectMap1G int `json:"directMap1G"` DirectMap2M int `json:"directMap2M"` DirectMap4K int `json:"directMap4K"` Dirty int `json:"Dirty"` FileHugePages int `json:"fileHugePages"` FilePmdMapped int `json:"filePmdMapped"` HardwareCorrupted int `json:"hardwareCorrupted"` HugePagesFree int `json:"hugePagesFree"` HugePagesRsvd int `json:"hugePagesRsvd"` HugePagesSurp int `json:"hugePagesSurp"` HugePagesTotal int `json:"hugePagesTotal"` HugePageSize int `json:"hugePageSize"` HugeTlb int `json:"hugeTlb"` Inactive int `json:"inactive"` InactiveAnon int `json:"inactiveAnon"` InactiveFile int `json:"inactiveFile"` KReclaimable int `json:"kReclaimable"` KernelStack int `json:"kernelStack"` Mapped int `json:"mapped"` MemAvailable int `json:"memAvailable"` MemFree int `json:"memFree"` MemTotal int `json:"memTotal"` MLocked int `json:"mLocked"` NfsUnstable int `json:"nfsUnstable"` PageTables int `json:"pageTables"` PerCpu int `json:"perCpu"` SReclaimable int `json:"sReclaimable"` SUnreclaim int `json:"sUnreclaim"` Shmem int `json:"shmem"` ShmemHugePages int `json:"shmemHugePages"` ShmemPmdMapped int `json:"shmemPmdMapped"` Slab int `json:"slab"` SwapCached int `json:"swapCached"` SwapFree int `json:"swapFree"` SwapTotal int `json:"swapTotal"` Unevictable int `json:"snevictable"` VmallocChunk int `json:"vmallocChunk"` VmallocTotal int `json:"vmallocTotal"` VmallocUsed int `json:"vmallocUsed"` Writeback int `json:"writeback"` WritebackTmp int `json:"writebackTmp"` } `json:"memory"` Services map[string]struct { Name string `json:"name"` Status string `json:"status"` Version string `json:"version"` } `json:"services"` Uptime struct { Days string `json:"days"` Hours string `json:"hours"` Minutes string `json:"minutes"` TotalSeconds string `json:"totalSeconds"` Uptime string `json:"uptime"` } `json:"uptime"` }
type User ¶
type User struct { Config UserConfig `json:"config"` Usage UserUsage `json:"usage"` }
type UserConfig ¶
type UserConfig struct { AftpEnabled bool `json:"aftpEnabled" yaml:"aftpEnabled"` ApiAccessWithPasswordEnabled bool `json:"apiAccessWithPasswordEnabled" yaml:"apiAccessWithPasswordEnabled"` CatchAllEnabled bool `json:"catchAllEnabled" yaml:"catchAllEnabled"` CgiEnabled bool `json:"cgiEnabled" yaml:"cgiEnabled"` ClamAvEnabled bool `json:"clamAvEnabled" yaml:"clamAvEnabled"` Created time.Time `json:"created" yaml:"created"` Creator string `json:"creator" yaml:"creator"` CronEnabled bool `json:"cronEnabled" yaml:"cronEnabled"` Domain string `json:"domain" yaml:"domain"` DNSEnabled bool `json:"dnsEnabled" yaml:"dnsEnabled"` Email string `json:"email" yaml:"email"` GitEnabled bool `json:"gitEnabled" yaml:"gitEnabled"` IpAddresses []string `json:"ipAddresses" yaml:"ipAddresses"` JailEnabled bool `json:"jailEnabled" yaml:"jailEnabled"` Language string `json:"language" yaml:"language"` LoginKeysEnabled bool `json:"loginKeysEnabled" yaml:"loginKeysEnabled"` NginxEnabled bool `json:"nginxEnabled" yaml:"nginxEnabled"` NotifyOnQuestionFailures bool `json:"notifyOnQuestionFailures" yaml:"notifyOnQuestionFailures"` NotifyOnTwoFactorFailures bool `json:"notifyOnTwoFactorFailures" yaml:"notifyOnTwoFactorFailures"` Ns1 string `json:"ns1" yaml:"ns1"` Ns2 string `json:"ns2" yaml:"ns2"` Package string `json:"package" yaml:"package"` PhpEnabled bool `json:"phpEnabled" yaml:"phpEnabled"` RedisEnabled bool `json:"redisEnabled" yaml:"redisEnabled"` SecurityQuestionsEnabled bool `json:"securityQuestionsEnabled" yaml:"securityQuestionsEnabled"` Skin string `json:"skin" yaml:"skin"` SpamEnabled bool `json:"spamEnabled" yaml:"spamEnabled"` SshEnabled bool `json:"sshEnabled" yaml:"sshEnabled"` SslEnabled bool `json:"sslEnabled" yaml:"sslEnabled"` Suspended bool `json:"suspended" yaml:"suspended"` SuspendAtLimitEnabled bool `json:"suspendAtLimitEnabled" yaml:"suspendAtLimitEnabled"` SysInfoEnabled bool `json:"sysInfoEnabled" yaml:"sysInfoEnabled"` TwoFactorAuthenticationEnabled bool `json:"twoFactorAuthenticationEnabled" yaml:"twoFactorAuthenticationEnabled"` Username string `json:"username" yaml:"username"` UserType string `json:"userType" yaml:"userType"` WordPressToolkitEnabled bool `json:"wordPressToolkitEnabled" yaml:"wordPressToolkitEnabled"` }
type UserContext ¶
type UserContext struct { User User // contains filtered or unexported fields }
func (*UserContext) ChangeWordPressUserPassword ¶
func (c *UserContext) ChangeWordPressUserPassword(locationId string, userId int, password string) error
ChangeWordPressUserPassword (user) changes the password of the given wordpress user.
func (*UserContext) CheckDNSRecordExists ¶
func (c *UserContext) CheckDNSRecordExists(checkField string, domain string, dnsRecord DNSRecord) error
CheckDNSRecordExists (user) checks if the given dns record exists on the server
checkField can be either "name" or "value"
func (*UserContext) CheckDomainExists ¶
func (c *UserContext) CheckDomainExists(domain string) error
CheckDomainExists (user) checks if the given domain exists on the server
func (*UserContext) CheckFileExists ¶
func (c *UserContext) CheckFileExists(filePath string) error
CheckFileExists (user) checks if the given file exists on the server
func (*UserContext) CreateDNSRecord ¶
func (c *UserContext) CreateDNSRecord(domain string, dnsRecord DNSRecord) error
CreateDNSRecord (user) creates the provided dns record for the given domain
func (*UserContext) CreateDatabase ¶
func (c *UserContext) CreateDatabase(database *Database) error
func (*UserContext) CreateDatabaseUser ¶
func (c *UserContext) CreateDatabaseUser(databaseUser *DatabaseUser) error
func (*UserContext) CreateDatabaseWithUser ¶
func (c *UserContext) CreateDatabaseWithUser(database *DatabaseWithUser) error
func (*UserContext) CreateDomain ¶
func (c *UserContext) CreateDomain(domain Domain) error
CreateDomain (user) creates the provided domain for the session user
func (*UserContext) CreateEmailAccount ¶
func (c *UserContext) CreateEmailAccount(emailAccount EmailAccount) error
func (*UserContext) CreateEmailForwarder ¶
func (c *UserContext) CreateEmailForwarder(domain string, user string, emails ...string) error
func (*UserContext) CreateFile ¶
func (c *UserContext) CreateFile(uploadToPath string, filePath string) error
CreateFile (user) creates the provided file for the session user
func (*UserContext) CreateFiles ¶
func (c *UserContext) CreateFiles(uploadToPath string, filePaths ...string) error
CreateFiles (user) creates the provided files for the session user
func (*UserContext) CreateLoginURL ¶
func (c *UserContext) CreateLoginURL(loginKeyURL *LoginKeyURL) (*LoginKeyURL, error)
func (*UserContext) CreateSubdomain ¶
func (c *UserContext) CreateSubdomain(subdomain Subdomain) error
CreateSubdomain (user) creates the provided subdomain for the session user. This automatically gets called if subdomains are included in the CreateDomain call. You cannot specify a custom directory here
func (*UserContext) CreateWordPressInstall ¶
func (c *UserContext) CreateWordPressInstall(install WordPressInstall, createDatabase bool) error
func (*UserContext) CreateWordPressInstallQuick ¶
func (c *UserContext) CreateWordPressInstallQuick(install WordPressInstallQuick) error
CreateWordPressInstallQuick (user) creates a new wordpress install and automatically creates a database
func (*UserContext) DeleteDNSRecords ¶
func (c *UserContext) DeleteDNSRecords(dnsRecords ...DNSRecord) error
DeleteDNSRecords (user) deletes all the specified dnss for the session user
func (*UserContext) DeleteDatabase ¶
func (c *UserContext) DeleteDatabase(databaseName string) error
func (*UserContext) DeleteDomains ¶
func (c *UserContext) DeleteDomains(deleteData bool, domains ...string) error
DeleteDomains (user) deletes all the specified domains for the session user
func (*UserContext) DeleteEmailAccount ¶
func (c *UserContext) DeleteEmailAccount(domain string, name string) error
func (*UserContext) DeleteEmailForwarders ¶
func (c *UserContext) DeleteEmailForwarders(domain string, names ...string) error
func (*UserContext) DeleteFiles ¶
func (c *UserContext) DeleteFiles(skipTrash bool, files ...string) error
DeleteFiles (user) deletes all the specified files for the session user
func (*UserContext) DeleteSubdomains ¶
func (c *UserContext) DeleteSubdomains(deleteData bool, domain string, subdomains ...string) error
DeleteSubdomains (user) deletes all the specified subdomain for the session user
func (*UserContext) DeleteWordPressInstall ¶
func (c *UserContext) DeleteWordPressInstall(id string) error
func (*UserContext) DownloadDatabase ¶
func (c *UserContext) DownloadDatabase(name string, format DatabaseFormat, filePath string) error
func (*UserContext) ExportDatabase ¶
func (c *UserContext) ExportDatabase(databaseName string, gzip bool) ([]byte, error)
ExportDatabase (user) returns an export of the given database
func (*UserContext) ExtractFile ¶
func (c *UserContext) ExtractFile(filePath string, file string) error
func (*UserContext) GetBasicSysInfo ¶
func (c *UserContext) GetBasicSysInfo() (*BasicSysInfo, error)
func (*UserContext) GetDNSRecords ¶
func (c *UserContext) GetDNSRecords(domain string) ([]DNSRecord, error)
GetDNSRecords (user) returns the given domain's dns records
func (*UserContext) GetDatabase ¶
func (c *UserContext) GetDatabase(databaseName string) (*Database, error)
GetDatabase (user) returns the given database
func (*UserContext) GetDatabaseProcesses ¶
func (c *UserContext) GetDatabaseProcesses() ([]*DatabaseProcess, error)
GetDatabaseProcesses (admin) returns an array of current database processes
func (*UserContext) GetDatabases ¶
func (c *UserContext) GetDatabases() ([]*Database, error)
GetDatabases (user) returns an array of the session user's databases
func (*UserContext) GetDomain ¶
func (c *UserContext) GetDomain(domainName string) (Domain, error)
GetDomain (user) returns the single specified domain
func (*UserContext) GetDomains ¶
func (c *UserContext) GetDomains() ([]Domain, error)
GetDomains (user) returns the session user's domains
func (*UserContext) GetEmailAccounts ¶
func (c *UserContext) GetEmailAccounts(domain string) ([]EmailAccount, error)
GetEmailAccounts (user) returns an array of email accounts belonging to the provided domain
func (*UserContext) GetEmailForwarders ¶
func (c *UserContext) GetEmailForwarders(domain string) (map[string][]string, error)
GetEmailForwarders (user) returns an array of email forwarders belonging to the provided domain
func (*UserContext) GetLoginURLs ¶
func (c *UserContext) GetLoginURLs() ([]*LoginKeyURL, error)
func (*UserContext) GetMyUserConfig ¶
func (c *UserContext) GetMyUserConfig() (*UserConfig, error)
GetMyUserConfig (user) returns the session user's config
func (*UserContext) GetMyUserUsage ¶
func (c *UserContext) GetMyUserUsage() (*UserUsage, error)
GetMyUserUsage (user) returns the session user's usage
func (*UserContext) GetMyUsername ¶
func (c *UserContext) GetMyUsername() string
GetMyUsername returns the current user's username. This is particularly useful when logging in as another user, as it trims the admin/reseller username automatically
func (*UserContext) GetSysInfo ¶
func (c *UserContext) GetSysInfo() (*SysInfo, error)
func (*UserContext) GetWordPressInstalls ¶
func (c *UserContext) GetWordPressInstalls() ([]*WordPressLocation, error)
func (*UserContext) GetWordPressSSOLink ¶
func (c *UserContext) GetWordPressSSOLink(locationId string, userId int) (string, error)
func (*UserContext) GetWordPressUsers ¶
func (c *UserContext) GetWordPressUsers(locationId string) ([]*WordPressUser, error)
func (*UserContext) ImportDatabase ¶
func (c *UserContext) ImportDatabase(databaseName string, emptyExistingDatabase bool, sql []byte) error
ImportDatabase (user) imports the given database export into the given database
func (*UserContext) IssueSSL ¶
func (c *UserContext) IssueSSL(domain string, hostnamesToCertify ...string) error
IssueSSL (user) requests a lets encrypt certificate for the given hostnames
func (*UserContext) ListDomains ¶
func (c *UserContext) ListDomains() (domainList []string, err error)
ListDomains (user) returns an array of all domains for the session user
func (*UserContext) ListSubdomains ¶
func (c *UserContext) ListSubdomains(domain string) (subdomainList []string, err error)
ListSubdomains (user) returns an array of all subdomains for the given domain
func (*UserContext) Login ¶
func (c *UserContext) Login() error
func (*UserContext) SetDefaultDomain ¶
func (c *UserContext) SetDefaultDomain(domain string) error
SetDefaultDomain (user) sets the default domain for the session user
func (*UserContext) UpdateDNSRecord ¶
func (c *UserContext) UpdateDNSRecord(domain string, originalDNSRecord DNSRecord, updatedDNSRecord DNSRecord) error
UpdateDNSRecord (user) updates the given dns record for the given domain
func (*UserContext) UpdateDatabaseUserHosts ¶
func (c *UserContext) UpdateDatabaseUserHosts(username string, hosts []string) error
UpdateDatabaseUserHosts (user) updates the given database user's hosts
func (*UserContext) UpdateDatabaseUserPassword ¶
func (c *UserContext) UpdateDatabaseUserPassword(username string, password string) error
UpdateDatabaseUserPassword (user) updates the given database user's password
func (*UserContext) UpdateDomain ¶
func (c *UserContext) UpdateDomain(domain Domain) error
UpdateDomain (user) accepts a Domain object and updates the version on DA with it
func (*UserContext) UpdateEmailAccount ¶
func (c *UserContext) UpdateEmailAccount(emailAccount EmailAccount) error
func (*UserContext) UpdateEmailForwarder ¶
func (c *UserContext) UpdateEmailForwarder(domain string, user string, emails ...string) error
func (*UserContext) UpdateSubdomainRoot ¶
func (c *UserContext) UpdateSubdomainRoot(subdomain Subdomain) error
func (*UserContext) VerifyEmailAccount ¶
func (c *UserContext) VerifyEmailAccount(address string, password string) error
VerifyEmailAccount (user) accepts the full email address as well as the password for the account. If the credentials aren't correct, an error will be returned.
type UserUsage ¶
type UserUsage struct { BandwidthQuota int `json:"bandwidthQuota" yaml:"bandwidthQuota"` BandwidthUsage int `json:"bandwidthUsage" yaml:"bandwidthUsage"` DbQuota int `json:"dbQuota" yaml:"dbQuota"` DbUsage int `json:"dbUsage" yaml:"dbUsage"` DiskQuota int `json:"diskQuota" yaml:"diskQuota"` DiskUsage int `json:"diskUsage" yaml:"diskUsage"` Domains []domainUsage `json:"domains" yaml:"domains"` DomainPointersQuota int `json:"domainPointersQuota" yaml:"domainPointersQuota"` DomainPointersUsage int `json:"domainPointersUsage" yaml:"domainPointersUsage"` DomainQuota int `json:"domainQuota" yaml:"domainQuota"` DomainUsage int `json:"domainUsage" yaml:"domainUsage"` EmailQuota int `json:"emailQuota" yaml:"emailQuota"` EmailUsage int `json:"emailUsage" yaml:"emailUsage"` EmailForwardersQuota int `json:"emailForwardersQuota" yaml:"emailForwardersQuota"` EmailForwardersUsage int `json:"emailForwardersUsage" yaml:"emailForwardersUsage"` EmailMailingListQuota int `json:"emailMailingListQuota" yaml:"emailMailingListQuota"` EmailMailingListUsage int `json:"emailMailingListUsage" yaml:"emailMailingListUsage"` FtpQuota int `json:"ftpQuota" yaml:"ftpQuota"` FtpUsage int `json:"ftpUsed" yaml:"ftpUsed"` InodeQuota int `json:"inodeQuota" yaml:"inodeQuota"` InodeUsage int `json:"inodeUsage" yaml:"inodeUsage"` SubdomainQuota int `json:"subdomainQuota" yaml:"subdomainQuota"` SubdomainUsage int `json:"subdomainUsage" yaml:"subdomainUsage"` }
type WordPressInstall ¶
type WordPressInstall struct { AdminEmail string `json:"adminEmail" yaml:"adminEmail"` AdminName string `json:"adminName" yaml:"adminName"` AdminPass string `json:"adminPass" yaml:"adminPass"` DbName string `json:"dbName" yaml:"dbName"` DbPass string `json:"dbPass" yaml:"dbPass"` DbPrefix string `json:"dbPrefix" yaml:"dbPrefix"` DbUser string `json:"dbUser" yaml:"dbUser"` FilePath string `json:"filePath" yaml:"filePath"` Title string `json:"title" yaml:"title"` }
type WordPressInstallQuick ¶
type WordPressLocation ¶
type WordPressLocation struct { FilePath string `json:"filePath"` Host string `json:"host"` Id string `json:"id"` WebPath string `json:"webPath"` Wordpress struct { AutoUpdateMajor bool `json:"autoUpdateMajor"` AutoUpdateMinor bool `json:"autoUpdateMinor"` Error string `json:"error"` SiteURL string `json:"siteURL"` Template string `json:"template"` Title string `json:"title"` Version string `json:"version"` } `json:"wordpress"` }
Source Files ¶
- admin.go
- auth.go
- database.go
- directadmin.go
- dns.go
- dns_raw.go
- domain.go
- domain_raw.go
- email.go
- email_forwarder.go
- file.go
- http.go
- license.go
- package.go
- package_raw.go
- package_reseller.go
- package_reseller_raw.go
- reseller.go
- ssl.go
- subdomain.go
- system.go
- system_raw.go
- types.go
- user.go
- user_raw.go
- wordpress.go