internal

package
v4.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRequest

type APIRequest struct {
	User    string      `json:"user,omitempty"`
	Auth    string      `json:"auth,omitempty"`
	Command string      `json:"command,omitempty"`
	Data    interface{} `json:"data,omitempty"`
}

type Client

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

func NewClient

func NewClient(username string, password string) *Client

func (*Client) AddRecord

func (c *Client) AddRecord(ctx context.Context, zone string, record DNSRow) error

AddRecord adds a record in the zone, either by updating existing records or creating new ones. https://kb.wedos.com/en/wapi-api-interface/wapi-command-dns-add-row/ https://kb.wedos.com/en/wapi-api-interface/wapi-command-dns-row-update/

func (*Client) Commit

func (c *Client) Commit(ctx context.Context, zone string) error

Commit not really required, all changes will be auto-committed after 5 minutes. https://kb.wedos.com/en/wapi-api-interface/wapi-command-dns-domain-commit/

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, zone string, recordID string) error

DeleteRecord deletes a record from the zone. If a record does not have an ID, it will be looked up. https://kb.wedos.com/en/wapi-api-interface/wapi-command-dns-row-delete/

func (*Client) GetRecords

func (c *Client) GetRecords(ctx context.Context, zone string) ([]DNSRow, error)

GetRecords lists all the records in the zone. https://kb.wedos.com/en/wapi-api-interface/wapi-command-dns-rows-list/

func (*Client) Ping

func (c *Client) Ping(ctx context.Context) error

type DNSRow

type DNSRow struct {
	ID   string      `json:"ID,omitempty"`
	Name string      `json:"name,omitempty"`
	TTL  json.Number `json:"ttl,omitempty" type:"integer"`
	Type string      `json:"rdtype,omitempty"`
	Data string      `json:"rdata"`
}

type DNSRowRequest

type DNSRowRequest struct {
	ID     string      `json:"row_id,omitempty"`
	Domain string      `json:"domain,omitempty"`
	Name   string      `json:"name,omitempty"`
	TTL    json.Number `json:"ttl,omitempty" type:"integer"`
	Type   string      `json:"type,omitempty"`
	Data   string      `json:"rdata"`
}

type ResponsePayload

type ResponsePayload struct {
	Code      int             `json:"code,omitempty"`
	Result    string          `json:"result,omitempty"`
	Timestamp int             `json:"timestamp,omitempty"`
	SvTRID    string          `json:"svTRID,omitempty"`
	Command   string          `json:"command,omitempty"`
	Data      json.RawMessage `json:"data"`
}

Jump to

Keyboard shortcuts

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