client

package
v1.20241112.540 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: 0BSD Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MigaduClient

type MigaduClient struct {
	HTTPClient *http.Client
	Endpoint   string
	Username   string
	Token      string
}

MigaduClient holds all necessary information to interact with the Migadu API

func New

func New(endpoint, username, token *string, timeout time.Duration) (*MigaduClient, error)

New creates a new MigaduClient

func (*MigaduClient) CreateAlias

func (c *MigaduClient) CreateAlias(ctx context.Context, domain string, alias *model.Alias) (*model.Alias, error)

CreateAlias creates a new alias

func (*MigaduClient) CreateIdentity

func (c *MigaduClient) CreateIdentity(ctx context.Context, domain string, localPart string, identity *model.Identity) (*model.Identity, error)

CreateIdentity creates a new identity

func (*MigaduClient) CreateMailbox

func (c *MigaduClient) CreateMailbox(ctx context.Context, domain string, mailbox *model.Mailbox) (*model.Mailbox, error)

CreateMailbox creates a new mailbox

func (*MigaduClient) CreateRewriteRule

func (c *MigaduClient) CreateRewriteRule(ctx context.Context, domain string, rewrite *model.RewriteRule) (*model.RewriteRule, error)

CreateRewriteRule creates a new rewrite rule

func (*MigaduClient) DeleteAlias

func (c *MigaduClient) DeleteAlias(ctx context.Context, domain string, localPart string) (*model.Alias, error)

DeleteAlias deletes an existing alias

func (*MigaduClient) DeleteIdentity

func (c *MigaduClient) DeleteIdentity(ctx context.Context, domain string, localPart string, id string) (*model.Identity, error)

DeleteIdentity deletes an existing identity

func (*MigaduClient) DeleteMailbox

func (c *MigaduClient) DeleteMailbox(ctx context.Context, domain string, localPart string) (*model.Mailbox, error)

DeleteMailbox deletes an existing mailbox

func (*MigaduClient) DeleteRewriteRule

func (c *MigaduClient) DeleteRewriteRule(ctx context.Context, domain string, slug string) (*model.RewriteRule, error)

DeleteRewriteRule deletes an existing rewrite rule

func (*MigaduClient) GetAlias

func (c *MigaduClient) GetAlias(ctx context.Context, domain string, localPart string) (*model.Alias, error)

GetAlias returns specific alias

func (*MigaduClient) GetAliases

func (c *MigaduClient) GetAliases(ctx context.Context, domain string) (*model.Aliases, error)

GetAliases returns all aliases for a single domain

func (*MigaduClient) GetIdentities

func (c *MigaduClient) GetIdentities(ctx context.Context, domain string, localPart string) (*model.Identities, error)

GetIdentities returns identities for a single mailbox

func (*MigaduClient) GetIdentity

func (c *MigaduClient) GetIdentity(ctx context.Context, domain string, localPart string, id string) (*model.Identity, error)

GetIdentity returns a specific identity

func (*MigaduClient) GetMailbox

func (c *MigaduClient) GetMailbox(ctx context.Context, domain string, localPart string) (*model.Mailbox, error)

GetMailbox returns specific mailbox

func (*MigaduClient) GetMailboxes

func (c *MigaduClient) GetMailboxes(ctx context.Context, domain string) (*model.Mailboxes, error)

GetMailboxes returns mailboxes for a single domain

func (*MigaduClient) GetRewriteRule

func (c *MigaduClient) GetRewriteRule(ctx context.Context, domain string, slug string) (*model.RewriteRule, error)

GetRewriteRule returns a specific rewrite rule

func (*MigaduClient) GetRewriteRules

func (c *MigaduClient) GetRewriteRules(ctx context.Context, domain string) (*model.RewriteRules, error)

GetRewriteRules returns rewrite rules for a single domain

func (*MigaduClient) UpdateAlias

func (c *MigaduClient) UpdateAlias(ctx context.Context, domain string, localPart string, alias *model.Alias) (*model.Alias, error)

UpdateAlias updates an existing alias

func (*MigaduClient) UpdateIdentity

func (c *MigaduClient) UpdateIdentity(ctx context.Context, domain string, localPart string, id string, identity *model.Identity) (*model.Identity, error)

UpdateIdentity updates an existing identity

func (*MigaduClient) UpdateMailbox

func (c *MigaduClient) UpdateMailbox(ctx context.Context, domain string, localPart string, mailbox *model.Mailbox) (*model.Mailbox, error)

UpdateMailbox updates an existing mailbox

func (*MigaduClient) UpdateRewriteRule

func (c *MigaduClient) UpdateRewriteRule(ctx context.Context, domain string, slug string, rewrite *model.RewriteRule) (*model.RewriteRule, error)

UpdateRewriteRule updates an existing rewrite rule

type RequestError

type RequestError struct {
	StatusCode   int
	ResponseBody []byte
}

func (*RequestError) Error

func (e *RequestError) Error() string

Jump to

Keyboard shortcuts

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