internal

package
v4.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 11 Imported by: 0

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"`
}

func (APIErrorResponse) Error added in v4.3.0

func (a APIErrorResponse) Error() string

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.

Jump to

Keyboard shortcuts

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