Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIErrorResponse

type APIErrorResponse struct {
	Code        string             `json:"code"`
	Description string             `json:"description,omitempty"`
	Context     map[string]string  `json:"context,omitempty"`
	Errors      []APIErrorResponse `json:"errors,omitempty"`
}

type APIResponse

type APIResponse struct {
	Result      string            `json:"result"`
	Data        json.RawMessage   `json:"data,omitempty"`
	ErrResponse *APIErrorResponse `json:"error,omitempty"`
}

type Client

type Client struct {
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

    Client the Infomaniak client.

    func New

    func New(apiEndpoint, apiToken string) *Client

      New Creates a new Infomaniak client.

      func (*Client) CreateDNSRecord

      func (c *Client) CreateDNSRecord(domain *DNSDomain, record Record) (string, error)

      func (*Client) DeleteDNSRecord

      func (c *Client) DeleteDNSRecord(domainID uint64, recordID string) error

      func (*Client) GetDomainByName

      func (c *Client) GetDomainByName(name string) (*DNSDomain, error)

        GetDomainByName gets a Domain object from its name.

        type DNSDomain

        type DNSDomain struct {
        	ID           uint64 `json:"id,omitempty"`
        	CustomerName string `json:"customer_name,omitempty"`
        }

        type Record

        type Record struct {
        	ID     string `json:"id,omitempty"`
        	Source string `json:"source,omitempty"`
        	Type   string `json:"type,omitempty"`
        	TTL    int    `json:"ttl,omitempty"`
        	Target string `json:"target,omitempty"`
        }

          Record a DNS record.