Documentation ¶
Index ¶
- Constants
- type Addresser
- type Client
- func (c *Client) CreateIdentity(ctx context.Context, local_part string, new_identity *Identity) (*Identity, error)
- func (c *Client) CreateIdentityNoAuth(ctx context.Context, local_part, name, id string) (*Identity, error)
- func (c *Client) CreateIdentityWithPassword(ctx context.Context, local_part, name, id, password string) (*Identity, error)
- func (c *Client) CreateMailbox(ctx context.Context, new_mailbox *Mailbox) (*Mailbox, error)
- func (c *Client) CreateMailboxWithInvite(ctx context.Context, name, local_part, password_recovery_email string, ...) (*Mailbox, error)
- func (c *Client) CreateMailboxWithPassword(ctx context.Context, name, local_part, password string, is_internal bool) (*Mailbox, error)
- func (c *Client) Delete(ctx context.Context, path string) ([]byte, error)
- func (c *Client) DeleteIdentity(ctx context.Context, local_part, id string) error
- func (c *Client) DeleteMailbox(ctx context.Context, local_part string) error
- func (c *Client) Get(ctx context.Context, path string) ([]byte, error)
- func (c *Client) GetIdentities(ctx context.Context, local_part string) (*[]Identity, error)
- func (c *Client) GetIdentity(ctx context.Context, local_part, id string) (*Identity, error)
- func (c *Client) GetMailbox(ctx context.Context, local_part string) (*Mailbox, error)
- func (c *Client) GetMailboxes(ctx context.Context) (*[]Mailbox, error)
- func (c *Client) Post(ctx context.Context, path string, json_body []byte) ([]byte, error)
- func (c *Client) Put(ctx context.Context, path string, json_body []byte) ([]byte, error)
- func (c *Client) UpdateIdentity(ctx context.Context, local_part, id string, identity_params *Identity) (*Identity, error)
- func (c *Client) UpdateMailbox(ctx context.Context, local_part string, mailbox_params *Mailbox) (*Mailbox, error)
- type CustomTime
- type ErrorRequestStatus
- type Identity
- type Mailbox
Constants ¶
const BaseEndpoint = "https://api.migadu.com/v1/"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { User string Token string Endpoint string Domain string HttpClient *http.Client }
func NewClient ¶
Timeout will be used as the client's timeout duration and will overrule any context timeout duration (if longer). When the timeout of the client making the request is reached, it is treated as if the context of the request has ended.
func (*Client) CreateIdentity ¶
func (*Client) CreateIdentityNoAuth ¶
func (c *Client) CreateIdentityNoAuth(ctx context.Context, local_part, name, id string) (*Identity, error)
Convience function to create an identity that will not be used for authentication (i.e. login)
func (*Client) CreateIdentityWithPassword ¶
func (c *Client) CreateIdentityWithPassword(ctx context.Context, local_part, name, id, password string) (*Identity, error)
Convience function to create an identity with a password. The password can be a custom password as passed, or left as an empty string to use the mailbox password
func (*Client) CreateMailbox ¶
Create mailbox using Mailbox object
func (*Client) CreateMailboxWithInvite ¶
func (c *Client) CreateMailboxWithInvite( ctx context.Context, name, local_part, password_recovery_email string, is_internal bool) (*Mailbox, error)
Convience function to create a mailbox that sets the password via invitation link
func (*Client) CreateMailboxWithPassword ¶
func (c *Client) CreateMailboxWithPassword( ctx context.Context, name, local_part, password string, is_internal bool) (*Mailbox, error)
Convience function to create a mailbox with a password set
func (*Client) DeleteIdentity ¶
func (*Client) DeleteMailbox ¶
func (*Client) GetIdentities ¶
func (*Client) GetIdentity ¶
func (*Client) GetMailbox ¶
Get mailbox local_part at domain associated with the client
func (*Client) GetMailboxes ¶
Get all mailboxes on the domain associated with the client
func (*Client) UpdateIdentity ¶
type CustomTime ¶
func (*CustomTime) MarshalJSON ¶
func (t *CustomTime) MarshalJSON() ([]byte, error)
func (*CustomTime) UnmarshalJSON ¶
func (t *CustomTime) UnmarshalJSON(b []byte) (err error)
type ErrorRequestStatus ¶
func (ErrorRequestStatus) Error ¶
func (e ErrorRequestStatus) Error() string
type Identity ¶
type Identity struct { LocalPart string `json:"local_part,omitempty"` Domain string `json:"domain,omitempty"` Address string `json:"address,omitempty"` Name string `json:"name,omitempty"` MaySend bool `json:"may_send,omitempty"` MayReceive bool `json:"may_receive,omitempty"` MayAccessImap bool `json:"may_access_imap,omitempty"` MayAccessPop3 bool `json:"may_access_pop3,omitempty"` MayAccessManagesieve bool `json:"may_access_managesieve,omitempty"` Password string `json:"password,mayomitempty"` PasswordUse string `json:"password_use,omitempty"` // leaked info on new documentation (!!!) from https://github.com/metio/migadu-client.go/pull/9 }
func (Identity) GetAddress ¶
type Mailbox ¶
type Mailbox struct { LocalPart string `json:"local_part,omitempty"` Domain string `json:"domain,omitempty"` Address string `json:"address,omitempty"` Name string `json:"name,omitempty"` IsInternal bool `json:"is_internal,omitempty"` MaySend bool `json:"may_send,omitempty"` MayReceive bool `json:"may_receive,omitempty"` MayAccessImap bool `json:"may_access_imap,omitempty"` MayAccessPop3 bool `json:"may_access_pop3,omitempty"` MayAccessManagesieve bool `json:"may_access_managesieve,omitempty"` PasswordMethod string `json:"password_method,omitempty"` Password string `json:"password,omitempty"` PasswordRecoveryEmail string `json:"password_recovery_email,omitempty"` SpamAction string `json:"spam_action,omitempty"` SpamAggressiveness string `json:"spam_aggressiveness"` SenderDenylist []string `json:"sender_denylist,omitempty"` SenderAllowlist []string `json:"sender_allowlist,omitempty"` RecipientDenylist []string `json:"recipient_denylist,omitempty"` AutorespondActive bool `json:"autorespond_active,omitempty"` AutorespondSubject string `json:"autorespond_subject,omitempty"` AutorespondBody string `json:"autorespond_body,omitempty"` AutorespondExpiresOn time.Time `json:"autorespond_expires_on,omitempty"` Identities []Identity `json:"identities,omitempty"` }