email

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateEmailRequest

type CreateEmailRequest struct {
	Login       string   `json:"login"`
	MailboxType string   `json:"mailbox_type"`
	Password    string   `json:"password"`
	Aliases     []string `json:"aliases,omitempty"`
}

CreateEmailRequest create mailbox request

type CreateForwardRequest

type CreateForwardRequest struct {
	Source       string   `json:"source"`
	Destinations []string `json:"destinations"`
}

CreateForwardRequest structure for forwarding request

type Email

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

Email is the API client to the Gandi v5 Email API

func New

func New(config config.Config) *Email

New returns an instance of the Email API client

func NewFromClient

func NewFromClient(g client.Gandi) *Email

NewFromClient returns an instance of the Email API client

func (*Email) CreateEmail

func (e *Email) CreateEmail(domain string, req CreateEmailRequest) (err error)

CreateEmail creates a new mailbox for the given domain

func (*Email) CreateForward

func (e *Email) CreateForward(domain string, req CreateForwardRequest) (err error)

CreateForward creates forwarding

func (*Email) DeleteEmail

func (e *Email) DeleteEmail(domain, mailbox_id string) (err error)

DeleteEmail remove mailbox

func (*Email) DeleteForward

func (e *Email) DeleteForward(domain, source string) (err error)

DeleteForward delete forwarding

func (*Email) GetForwards

func (e *Email) GetForwards(domain string) (forwards []GetForwardRequest, err error)

GetForwards retrieves all forwardings for domain

func (*Email) GetMailbox

func (e *Email) GetMailbox(domain, mailbox_id string) (mailbox MailboxResponse, err error)

GetMailbox returns all the parameters linked to a specific mailbox

func (*Email) ListMailboxes

func (e *Email) ListMailboxes(domain string) (mailboxes []ListMailboxResponse, err error)

ListMailboxes list mailboxes attached to domain

func (*Email) UpdateEmail

func (e *Email) UpdateEmail(domain, mailbox_id string, req UpdateEmailRequest) (err error)

UpdateEmail update mailbox parameters

func (*Email) UpdateForward

func (e *Email) UpdateForward(domain, source string, req UpdateForwardRequest) (err error)

UpdateForward update forwarding

type GetForwardRequest

type GetForwardRequest struct {
	Source       string   `json:"source"`
	Destinations []string `json:"destinations"`
	Href         string   `json:"href"`
}

GetForwardRequest structure for forwarding responses

type ListMailboxResponse

type ListMailboxResponse struct {
	Address   string `json:"address"`
	Antispam  bool   `json:"antispam"`
	Autorenew struct {
		Duration     int    `json:"duration"`
		DurationType string `json:"duration_type"`
		Enabled      bool   `json:"enabled"`
	} `json:"autorenew"`
	Domain      string    `json:"domain"`
	ExpiresAt   time.Time `json:"expires_at"`
	Href        string    `json:"href"`
	ID          string    `json:"id"`
	Login       string    `json:"login"`
	MailboxType string    `json:"mailbox_type"`
	QuotaUsed   int       `json:"quota_used"`
}

ListMailboxResponse describes mailbox

type MailboxResponse

type MailboxResponse struct {
	Address   string   `json:"address"`
	Aliases   []string `json:"aliases"`
	Antispam  bool     `json:"antispam"`
	Autorenew struct {
		Duration     int    `json:"duration"`
		DurationType string `json:"duration_type"`
		Enabled      bool   `json:"enabled"`
	} `json:"autorenew"`
	Domain      string    `json:"domain"`
	ExpiresAt   time.Time `json:"expires_at"`
	Href        string    `json:"href"`
	ID          string    `json:"id"`
	Login       string    `json:"login"`
	MailboxType string    `json:"mailbox_type"`
	QuotaUsed   int       `json:"quota_used"`
	Responder   struct {
		Message string `json:"message"`
		Enabled bool   `json:"enabled"`
	} `json:"responder"`
}

MailboxResponse mailbox parameters

type UpdateEmailRequest

type UpdateEmailRequest struct {
	Login    string   `json:"login,omitempty"`
	Password string   `json:"password,omitempty"`
	Aliases  []string `json:"aliases"`
}

UpdateEmailRequest update mailbox request

type UpdateForwardRequest

type UpdateForwardRequest struct {
	Destinations []string `json:"destinations"`
}

UpdateForwardRequest structure for updating forwarding

Jump to

Keyboard shortcuts

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