improvmx

package
v0.0.0-...-f24c7ac Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	BillingEmail   string        `json:"billing_email"`
	CancelsOn      interface{}   `json:"cancels_on"`
	CardBrand      string        `json:"card_brand"`
	CompanyDetails string        `json:"company_details"`
	CompanyName    string        `json:"company_name"`
	CompanyVat     interface{}   `json:"company_vat"`
	Country        string        `json:"country"`
	Created        int64         `json:"created"`
	Email          string        `json:"email"`
	EmailHash      string        `json:"email_hash"`
	IsOtpEnabled   bool          `json:"is_otp_enabled"`
	Last4          string        `json:"last4"`
	Limits         *AccountLimit `json:"limits"`
	LockReason     string        `json:"lock_reason"`
	Locked         bool          `json:"locked"`
	Password       bool          `json:"password"`
	Plan           *AccountPlan  `json:"plan"`
	Premium        bool          `json:"premium"`
	PrivacyLevel   int           `json:"privacy_level"`
	RenewDate      int64         `json:"renew_date"`
}

type AccountLimit

type AccountLimit struct {
	Aliases      int `json:"aliases"`
	API          int `json:"api"`
	Credentials  int `json:"credentials"`
	DailyQuota   int `json:"daily_quota"`
	DailySend    int `json:"daily_send"`
	Destinations int `json:"destinations"`
	Domains      int `json:"domains"`
	Ratelimit    int `json:"ratelimit"`
	Redirections int `json:"redirections"`
	Subdomains   int `json:"subdomains"`
}

type AccountPlan

type AccountPlan struct {
	AliasesLimit int    `json:"aliases_limit"`
	DailyQuota   int    `json:"daily_quota"`
	Display      string `json:"display"`
	DomainsLimit int    `json:"domains_limit"`
	Kind         string `json:"kind"`
	Name         string `json:"name"`
	Price        int    `json:"price"`
	Yearly       bool   `json:"yearly"`
}

type Alias

type Alias struct {
	Alias   string `json:"alias"`
	Forward string `json:"forward,omitempty"`
	ID      int    `json:"id,omitempty"`
}

type Check

type Check struct {
	Provider string      `json:"provider"`
	Advanced bool        `json:"advanced"`
	Dkim1    *Record     `json:"dkim1"`
	Dkim2    *Record     `json:"dkim2"`
	Dmarc    *Record     `json:"dmarc"`
	Mx       *Record     `json:"mx"`
	Spf      *Record     `json:"spf"`
	Valid    bool        `json:"valid"`
	Error    interface{} `json:"error,omitempty"`
}

type Client

type Client interface {
	SetUserAgent(agent string) error
	SetHTTPClient(client *http.Client)

	GetAccount(ctx context.Context) (*Account, error)
	GetWhitelabels(ctx context.Context) (*[]Whitelabel, error)

	ListDomains(ctx context.Context, query *QueryDomain) (*[]Domain, error)
	AddDomain(ctx context.Context, domain *Domain) (*Domain, error)
	GetDomain(ctx context.Context, domain string) (*Domain, error)
	UpdateDomain(ctx context.Context, domain *Domain) (*Domain, error)
	DeleteDomain(ctx context.Context, domain *Domain) error
	CheckDomain(ctx context.Context, domain string) (*Check, error)

	ListAliases(ctx context.Context, domain string) (*[]Alias, error)
	CreateAlias(ctx context.Context, domain string, alias *Alias) (*Alias, error)
	UpdateAlias(ctx context.Context, domain string, alias *Alias) (*Alias, error)
	DeleteAlias(ctx context.Context, domain string, alias *Alias) error

	ListSMTPCredentials(ctx context.Context, domain string) (*[]SMTPCredential, error)
	CreateSMTPCredential(ctx context.Context, domain string, credential *WriteSMTPCredential) (*SMTPCredential, error)
	UpdateSMTPCredential(ctx context.Context, domain string, credential *WriteSMTPCredential) (*SMTPCredential, error)
	DeleteSMTPCredential(ctx context.Context, domain string, credential *SMTPCredential) error

	GetLogs(ctx context.Context, query *QueryLog) (*[]Log, error)
}

func NewClient

func NewClient(
	baseURL,
	apiKey string,
	out io.Writer,
) Client

NewClient constructs a Checly API client.

type Domain

type Domain struct {
	Domain            string   `json:"domain"`
	Active            bool     `json:"active,omitempty"`
	Display           string   `json:"display,omitempty"`
	DkimSelector      string   `json:"dkim_selector,omitempty"`
	NotificationEmail string   `json:"notification_email,omitempty"`
	Webhook           string   `json:"webhook,omitempty"`
	Whitelabel        string   `json:"whitelabel,omitempty"`
	Added             int64    `json:"added,omitempty"`
	Aliases           *[]Alias `json:"aliases,omitempty"`
}

type Log

type Log struct {
	Created    string `json:"created"`
	CreatedRaw string `json:"created_raw"`
	Events     []struct {
		Code    int    `json:"code"`
		Created string `json:"created"`
		ID      string `json:"id"`
		Local   string `json:"local"`
		Message string `json:"message"`
		Server  string `json:"server"`
		Status  string `json:"status"`
	} `json:"events,omitempty"`
	Forward struct {
		Email string `json:"email"`
		Name  string `json:"name"`
	} `json:"forward,omitempty"`
	Hostname  string `json:"hostname"`
	ID        string `json:"id"`
	MessageID string `json:"messageId"`
	Recipient struct {
		Email string `json:"email"`
		Name  string `json:"name"`
	} `json:"recipient,omitempty"`
	Sender struct {
		Email string `json:"email"`
		Name  string `json:"name"`
	} `json:"sender,omitempty"`
	Subject   string `json:"subject"`
	Transport string `json:"transport"`
}

type PaginationOptions

type PaginationOptions struct {
	Limit int `json:"limit,omitempty"`
	Page  int `json:"page,omitempty"`
}

type QueryDomain

type QueryDomain struct {
	Query    string `json:"q,omitempty"`
	IsActive bool   `json:"is_active,omitempty"`
	PaginationOptions
}

type QueryLog

type QueryLog struct {
	Domain *string `json:"domain"`
	Alias  *string `json:"alias"`
}

type Record

type Record struct {
	Expected *RecordValues `json:"expected"`
	Valid    bool          `json:"valid"`
	Values   *RecordValues `json:"values"`
}

type RecordValues

type RecordValues []string

func (RecordValues) Interface

func (values RecordValues) Interface() []interface{}

func (RecordValues) MarshalJSON

func (values RecordValues) MarshalJSON() ([]byte, error)

func (*RecordValues) UnmarshalJSON

func (values *RecordValues) UnmarshalJSON(b []byte) error

type Response

type Response struct {
	Success bool                `json:"success"`
	Errors  map[string][]string `json:"errors,omitempty"`
	Total   int                 `json:"total,omitempty"`
	PaginationOptions
}

type SMTPCredential

type SMTPCredential struct {
	Username string `json:"username"`
	Usage    int    `json:"usage,omitempty"`
	Created  int64  `json:"created,omitempty"`
}

type Whitelabel

type Whitelabel struct {
	Name string `json:"name"`
}

type WriteSMTPCredential

type WriteSMTPCredential struct {
	Username string `json:"username"`
	Password string `json:"password,omitempty"`
}

Jump to

Keyboard shortcuts

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