client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Code       string
	Message    string
	Field      string
	HTTPStatus int
}

func (*APIError) Error

func (e *APIError) Error() string

type CatchAll

type CatchAll struct {
	Type        string `json:"type"`
	Address     string `json:"address"`
	Description string `json:"description"`
}

type Client

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

func New

func New(server, username, apiKey string) *Client

func (*Client) AddSpamBlacklistEntry

func (c *Client) AddSpamBlacklistEntry(ctx context.Context, domain, entry string) error

func (*Client) AddSpamWhitelistEntry

func (c *Client) AddSpamWhitelistEntry(ctx context.Context, domain, entry string) error

func (*Client) ChangeResellerUserPackage

func (c *Client) ChangeResellerUserPackage(ctx context.Context, username, packageName string) error

func (*Client) CreateDomain

func (c *Client) CreateDomain(ctx context.Context, name string) (*CreateDomainResponse, error)

func (*Client) CreateDomainPointer

func (c *Client) CreateDomainPointer(ctx context.Context, domain, pointer string, alias bool) error

func (*Client) CreateEmailAccount

func (c *Client) CreateEmailAccount(ctx context.Context, domain string, body CreateEmailAccountRequest) error

func (*Client) CreateForwarder

func (c *Client) CreateForwarder(ctx context.Context, domain, alias string, destinations []string) error

func (*Client) CreateResellerPackage

func (c *Client) CreateResellerPackage(ctx context.Context, body CreateResellerPackageRequest) error

func (*Client) CreateResellerUser

func (c *Client) CreateResellerUser(ctx context.Context, body CreateResellerUserRequest) error

func (*Client) DeleteDomain

func (c *Client) DeleteDomain(ctx context.Context, name string) error

func (*Client) DeleteDomainPointer

func (c *Client) DeleteDomainPointer(ctx context.Context, domain, pointer string) error

func (*Client) DeleteEmailAccount

func (c *Client) DeleteEmailAccount(ctx context.Context, domain, user string) error

func (*Client) DeleteForwarder

func (c *Client) DeleteForwarder(ctx context.Context, domain, alias string) error

func (*Client) DeleteResellerPackage

func (c *Client) DeleteResellerPackage(ctx context.Context, name string) error

func (*Client) DeleteResellerUser

func (c *Client) DeleteResellerUser(ctx context.Context, username string) error

func (*Client) DeleteSpamBlacklistEntry

func (c *Client) DeleteSpamBlacklistEntry(ctx context.Context, domain, entry string) error

func (*Client) DeleteSpamWhitelistEntry

func (c *Client) DeleteSpamWhitelistEntry(ctx context.Context, domain, entry string) error

func (*Client) GetCatchAll

func (c *Client) GetCatchAll(ctx context.Context, domain string) (*CatchAll, error)

func (*Client) GetDNS

func (c *Client) GetDNS(ctx context.Context, domain string) (*DNSInfo, error)

func (*Client) GetDomain

func (c *Client) GetDomain(ctx context.Context, name string) (*GetDomainResponse, error)

func (*Client) GetDomainPointer

func (c *Client) GetDomainPointer(ctx context.Context, domain, pointer string) (*DomainPointer, error)

func (*Client) GetEmailAccount

func (c *Client) GetEmailAccount(ctx context.Context, domain, user string) (*EmailAccount, error)

func (*Client) GetEmailQuota

func (c *Client) GetEmailQuota(ctx context.Context) (*EmailQuota, error)

func (*Client) GetForwarder

func (c *Client) GetForwarder(ctx context.Context, domain, alias string) (*Forwarder, error)

func (*Client) GetQuota

func (c *Client) GetQuota(ctx context.Context) (*Quota, error)

func (*Client) GetResellerPackage

func (c *Client) GetResellerPackage(ctx context.Context, name string) (*ResellerPackage, error)

func (*Client) GetResellerUser

func (c *Client) GetResellerUser(ctx context.Context, username string) (*ResellerUser, error)

func (*Client) GetSpamSettings

func (c *Client) GetSpamSettings(ctx context.Context, domain string) (*SpamSettings, error)

func (*Client) GetVerificationKey

func (c *Client) GetVerificationKey(ctx context.Context) (*VerificationKey, error)

func (*Client) ListDomainPointers

func (c *Client) ListDomainPointers(ctx context.Context, domain string) ([]DomainPointer, error)

func (*Client) ListDomains

func (c *Client) ListDomains(ctx context.Context) ([]string, error)

func (*Client) ListEmailAccounts

func (c *Client) ListEmailAccounts(ctx context.Context, domain string) ([]EmailAccount, error)

func (*Client) ListForwarders

func (c *Client) ListForwarders(ctx context.Context, domain string) ([]Forwarder, error)

func (*Client) ListResellerPackages

func (c *Client) ListResellerPackages(ctx context.Context) ([]string, error)

func (*Client) ListResellerUsers

func (c *Client) ListResellerUsers(ctx context.Context) ([]string, error)

func (*Client) ListSpamBlacklist

func (c *Client) ListSpamBlacklist(ctx context.Context, domain string) ([]string, error)

func (*Client) ListSpamWhitelist

func (c *Client) ListSpamWhitelist(ctx context.Context, domain string) ([]string, error)

func (*Client) SetCatchAll

func (c *Client) SetCatchAll(ctx context.Context, domain, catchAllType, address string) error

func (*Client) SetMailHosting

func (c *Client) SetMailHosting(ctx context.Context, name string, enabled bool) error

func (*Client) SuspendResellerUser

func (c *Client) SuspendResellerUser(ctx context.Context, username string) error

func (*Client) UnsuspendResellerUser

func (c *Client) UnsuspendResellerUser(ctx context.Context, username string) error

func (*Client) UpdateEmailAccount

func (c *Client) UpdateEmailAccount(ctx context.Context, domain, user string, body UpdateEmailAccountRequest) error

func (*Client) UpdateResellerPackage

func (c *Client) UpdateResellerPackage(ctx context.Context, name string, body UpdateResellerPackageRequest) error

func (*Client) UpdateResellerUser

func (c *Client) UpdateResellerUser(ctx context.Context, username string, body UpdateResellerUserRequest) error

func (*Client) UpdateSpamSettings

func (c *Client) UpdateSpamSettings(ctx context.Context, domain string, highScore int64) error

type CreateDomainResponse

type CreateDomainResponse struct {
	SSLEnabled bool `json:"ssl_enabled"`
}

CreateDomainResponse is the response body of POST /domains.

type CreateEmailAccountRequest

type CreateEmailAccountRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Quota    *int64 `json:"quota,omitempty"`
	Limit    *int64 `json:"limit,omitempty"`
}

type CreateResellerPackageRequest

type CreateResellerPackageRequest struct {
	Name            string  `json:"name"`
	Quota           *string `json:"quota,omitempty"`
	Domains         *string `json:"domains,omitempty"`
	EmailAccounts   *string `json:"email_accounts,omitempty"`
	EmailForwarders *string `json:"email_forwarders,omitempty"`
	DomainPointers  *string `json:"domain_pointers,omitempty"`
}

type CreateResellerUserRequest

type CreateResellerUserRequest struct {
	Username string `json:"username"`
	Email    string `json:"email"`
	Password string `json:"password"`
	Package  string `json:"package"`
}

type DNSInfo

type DNSInfo struct {
	MXRecords    []DNSMXRecord `json:"mx_records"`
	SPF          *DNSRecord    `json:"spf"`
	DKIM         *DNSRecord    `json:"dkim"`
	Verification *DNSRecord    `json:"verification"`
}

type DNSMXRecord

type DNSMXRecord struct {
	Priority    int    `json:"priority"`
	Hostname    string `json:"hostname"`
	Description string `json:"description"`
}

type DNSRecord

type DNSRecord struct {
	Type        string `json:"type"`
	Name        string `json:"name"`
	Value       string `json:"value"`
	Description string `json:"description,omitempty"`
}

type DomainPointer

type DomainPointer struct {
	Pointer string `json:"pointer"`
	Type    string `json:"type"`
	Target  string `json:"target"`
}

type EmailAccount

type EmailAccount struct {
	Username  string  `json:"username"`
	Email     string  `json:"email"`
	Quota     int64   `json:"quota"`
	Usage     float64 `json:"usage"`
	Limit     int64   `json:"limit"`
	Sent      int64   `json:"sent"`
	Suspended bool    `json:"suspended"`
}

type EmailQuota

type EmailQuota struct {
	Username string              `json:"username"`
	Accounts []EmailQuotaAccount `json:"accounts"`
}

type EmailQuotaAccount

type EmailQuotaAccount struct {
	EmailAddress string `json:"email_address"`
	SizeBytes    int64  `json:"size_bytes"`
	UpdatedAt    string `json:"updated_at"`
}

type Forwarder

type Forwarder struct {
	Alias        string   `json:"alias"`
	Email        string   `json:"email"`
	Destinations []string `json:"destinations"`
}

type GetDomainResponse

type GetDomainResponse struct {
	Name        string `json:"domain"`
	MailHosting bool   `json:"mail_hosting"`
	SSLEnabled  bool   `json:"ssl_enabled"`
}

GetDomainResponse is the response body of GET /domains/{domain}.

type GracePeriod

type GracePeriod struct {
	DaysRemaining int64  `json:"days_remaining"`
	Deadline      string `json:"deadline"`
}

type Quota

type Quota struct {
	Username    string         `json:"username"`
	TotalUsed   int64          `json:"total_used"`
	TotalLimit  int64          `json:"total_limit"`
	PercentUsed float64        `json:"percent_used"`
	Breakdown   QuotaBreakdown `json:"breakdown"`
	GracePeriod *GracePeriod   `json:"grace_period"`
	UpdatedAt   string         `json:"updated_at"`
}

type QuotaBreakdown

type QuotaBreakdown struct {
	Email     int64 `json:"email"`
	Web       int64 `json:"web"`
	Databases int64 `json:"databases"`
	Backups   int64 `json:"backups"`
	Other     int64 `json:"other"`
}

type ResellerPackage

type ResellerPackage struct {
	Name     string                  `json:"name"`
	Settings ResellerPackageSettings `json:"settings"`
}

type ResellerPackageSettings

type ResellerPackageSettings struct {
	QuotaGB         *float64 `json:"quota_gb"`
	QuotaUnlimited  bool     `json:"quota_unlimited"`
	Domains         *int64   `json:"domains"`
	EmailAccounts   *int64   `json:"email_accounts"`
	EmailForwarders *int64   `json:"email_forwarders"`
	DomainPointers  *int64   `json:"domain_pointers"`
}

type ResellerUser

type ResellerUser struct {
	Username  string            `json:"username"`
	Email     string            `json:"email"`
	Domain    string            `json:"domain"`
	Package   string            `json:"package"`
	Suspended bool              `json:"suspended"`
	Quota     ResellerUserQuota `json:"quota"`
}

type ResellerUserQuota

type ResellerUserQuota struct {
	Limit     *int64  `json:"limit"`
	Used      float64 `json:"used"`
	Unlimited bool    `json:"unlimited"`
}

type SpamSettings

type SpamSettings struct {
	HighScore int64 `json:"high_score"`
}

type UpdateEmailAccountRequest

type UpdateEmailAccountRequest struct {
	Password *string `json:"password,omitempty"`
	Quota    *int64  `json:"quota,omitempty"`
	Limit    *int64  `json:"limit,omitempty"`
}

type UpdateResellerPackageRequest

type UpdateResellerPackageRequest struct {
	Quota           *string `json:"quota,omitempty"`
	Domains         *string `json:"domains,omitempty"`
	EmailAccounts   *string `json:"email_accounts,omitempty"`
	EmailForwarders *string `json:"email_forwarders,omitempty"`
	DomainPointers  *string `json:"domain_pointers,omitempty"`
}

type UpdateResellerUserRequest

type UpdateResellerUserRequest struct {
	Quota    *string `json:"quota,omitempty"`
	Password *string `json:"password,omitempty"`
}

type VerificationKey

type VerificationKey struct {
	Key    string `json:"key"`
	Record struct {
		Type  string `json:"type"`
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"record"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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