Documentation ¶
Index ¶
- func NewWhmImpersonationApi(hostname, username, accessHash, userToImpersonate string, insecure bool) cpanel.CpanelApi
- func NewWhmImpersonationApiTotp(hostname, username, accessHash, userToImpersonate, secret string, ...) cpanel.CpanelApi
- type AccountSummaryApiResponse
- type BaseWhmApiResponse
- type CreateUserSessionApiResponse
- type FetchServiceSslComponentsAPIResponse
- type FetchSslVhostsApiResponse
- type GetTweakSettingApiResponse
- type ListAccountsApiResponse
- type VhostEntry
- type WhmApi
- func (a WhmApi) AccountSummary(username string) (AccountSummaryApiResponse, error)
- func (a WhmApi) CreateUserSession(username, service string) (CreateUserSessionApiResponse, error)
- func (a WhmApi) FetchServiceSslComponents() (FetchServiceSslComponentsAPIResponse, error)
- func (a WhmApi) FetchSslVhosts() (FetchSslVhostsApiResponse, error)
- func (a WhmApi) GetTweakSetting(key, module string) (GetTweakSettingApiResponse, error)
- func (a WhmApi) InstallServiceSslCertificate(service, crt, key, cabundle string) (BaseWhmApiResponse, error)
- func (a WhmApi) ListAccounts() (ListAccountsApiResponse, error)
- func (a WhmApi) RestartService(name string) (BaseWhmApiResponse, error)
- func (a WhmApi) SetTweakSetting(key, module, value string) (BaseWhmApiResponse, error)
- func (c *WhmApi) WHMAPI1(function string, arguments cpanelgo.Args, out interface{}) error
- type WhmImpersonationApi
- func (c *WhmImpersonationApi) API1(module, function string, arguments []string, out interface{}) error
- func (c *WhmImpersonationApi) API2(module, function string, arguments cpanelgo.Args, out interface{}) error
- func (c *WhmImpersonationApi) Close() error
- func (c *WhmImpersonationApi) UAPI(module, function string, arguments cpanelgo.Args, out interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewWhmImpersonationApi ¶
Types ¶
type AccountSummaryApiResponse ¶
type AccountSummaryApiResponse struct { BaseWhmApiResponse Data struct { Account []struct { Email string `json:"email"` Suspended int `json:"suspended"` } `json:"acct"` } `json:"data"` }
func (AccountSummaryApiResponse) Email ¶
func (r AccountSummaryApiResponse) Email() string
func (AccountSummaryApiResponse) HasEmail ¶
func (r AccountSummaryApiResponse) HasEmail() bool
func (AccountSummaryApiResponse) Suspended ¶
func (r AccountSummaryApiResponse) Suspended() bool
type BaseWhmApiResponse ¶
type BaseWhmApiResponse struct { Metadata struct { Reason string `json:"reason"` ResultRaw interface{} `json:"result"` } `json:"metadata"` }
func (BaseWhmApiResponse) Error ¶
func (r BaseWhmApiResponse) Error() error
func (BaseWhmApiResponse) Result ¶
func (r BaseWhmApiResponse) Result() int
WHM randomly returns this as a string, gg
type CreateUserSessionApiResponse ¶
type CreateUserSessionApiResponse struct { BaseWhmApiResponse Data struct { SecurityToken string `json:"cp_security_token"` Expires cpanelgo.MaybeInt64 `json:"expires"` Session string `json:"session"` Url string `json:"url"` } `json:"data"` }
type FetchServiceSslComponentsAPIResponse ¶
type FetchServiceSslComponentsAPIResponse struct { BaseWhmApiResponse Data struct { Services []struct { Service string `json:"service"` Certificate string `json:"certificate"` CABundle string `json:"cabundle"` CertificateInfo struct { IsSelfSigned int `json:"is_self_signed"` NotAfter cpanelgo.MaybeInt64 `json:"not_after"` Domains []string `json:"domains"` } `json:"certificate_info"` } `json:"services"` } `json:"data"` }
func (FetchServiceSslComponentsAPIResponse) Services ¶
func (r FetchServiceSslComponentsAPIResponse) Services() []string
type FetchSslVhostsApiResponse ¶
type FetchSslVhostsApiResponse struct { BaseWhmApiResponse Data struct { Vhosts []VhostEntry `json:"vhosts"` } `json:"data"` }
type GetTweakSettingApiResponse ¶
type GetTweakSettingApiResponse struct { BaseWhmApiResponse Data struct { TweakSetting struct { Key string `json:"key"` Value string `json:"value"` } `json:"tweaksetting"` } `json:"data"` }
type ListAccountsApiResponse ¶
type ListAccountsApiResponse struct { BaseWhmApiResponse Data struct { Accounts []struct { User string `json:"user"` Theme string `json:"theme"` } `json:"acct"` } `json:"data"` }
type VhostEntry ¶
type VhostEntry struct { User string `json:"user"` Docroot string `json:"docroot"` Certificate cpanel.CpanelSslCertificate `json:"crt"` }
type WhmApi ¶
type WhmApi struct { Hostname string Username string AccessHash string Password string Insecure bool TotpSecret string }
This implements a standalone WHM client, not for the cPanel API
func NewWhmApiAccessHash ¶
func NewWhmApiAccessHashTotp ¶
func NewWhmApiPassword ¶
func (WhmApi) AccountSummary ¶
func (a WhmApi) AccountSummary(username string) (AccountSummaryApiResponse, error)
func (WhmApi) CreateUserSession ¶
func (a WhmApi) CreateUserSession(username, service string) (CreateUserSessionApiResponse, error)
func (WhmApi) FetchServiceSslComponents ¶
func (a WhmApi) FetchServiceSslComponents() (FetchServiceSslComponentsAPIResponse, error)
func (WhmApi) FetchSslVhosts ¶
func (a WhmApi) FetchSslVhosts() (FetchSslVhostsApiResponse, error)
func (WhmApi) GetTweakSetting ¶
func (a WhmApi) GetTweakSetting(key, module string) (GetTweakSettingApiResponse, error)
func (WhmApi) InstallServiceSslCertificate ¶
func (a WhmApi) InstallServiceSslCertificate(service, crt, key, cabundle string) (BaseWhmApiResponse, error)
func (WhmApi) ListAccounts ¶
func (a WhmApi) ListAccounts() (ListAccountsApiResponse, error)
func (WhmApi) RestartService ¶
func (a WhmApi) RestartService(name string) (BaseWhmApiResponse, error)
func (WhmApi) SetTweakSetting ¶
func (a WhmApi) SetTweakSetting(key, module, value string) (BaseWhmApiResponse, error)
type WhmImpersonationApi ¶
func (*WhmImpersonationApi) API1 ¶
func (c *WhmImpersonationApi) API1(module, function string, arguments []string, out interface{}) error
func (*WhmImpersonationApi) API2 ¶
func (c *WhmImpersonationApi) API2(module, function string, arguments cpanelgo.Args, out interface{}) error
func (*WhmImpersonationApi) Close ¶
func (c *WhmImpersonationApi) Close() error
Click to show internal directories.
Click to hide internal directories.