internal

package
v4.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 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 Client

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

Client the Servercow client.

func NewClient

func NewClient(username, password string) *Client

NewClient Creates a Servercow client.

func (*Client) CreateUpdateRecord

func (c *Client) CreateUpdateRecord(ctx context.Context, domain string, data Record) (*Message, error)

CreateUpdateRecord creates or updates a record.

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, domain string, data Record) (*Message, error)

DeleteRecord deletes a record.

func (*Client) GetRecords

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

GetRecords from API.

type Message

type Message struct {
	Message  string `json:"message,omitempty"`
	ErrorMsg string `json:"error,omitempty"`
}

Message is the basic response representation. Can be an error.

func (Message) Error

func (a Message) Error() string

type Record

type Record struct {
	Name string `json:"name"`
	Type string `json:"type"`
	TTL  int    `json:"ttl,omitempty"`

	Content Value `json:"content,omitempty"`
}

Record is the record representation.

type Value

type Value []string

Value is the value of a record. Allows to handle dynamic type (string and string array).

func (Value) MarshalJSON

func (v Value) MarshalJSON() ([]byte, error)

func (*Value) UnmarshalJSON

func (v *Value) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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