internal

package
v4.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OAuthStaticAccessToken added in v4.12.0

func OAuthStaticAccessToken(client *http.Client, accessToken string) *http.Client

Types

type APIError

type APIError struct {
	StatusCode   int    `json:"statusCode"`
	ErrorCode    string `json:"error"`
	ErrorMessage string `json:"message"`
}

func (APIError) Error

func (a APIError) Error() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client a Liara DNS API client.

func NewClient

func NewClient(hc *http.Client) *Client

NewClient creates a new Client.

func (Client) CreateRecord

func (c Client) CreateRecord(ctx context.Context, domainName string, record Record) (*Record, error)

CreateRecord creates a record.

func (Client) DeleteRecord

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

DeleteRecord deletes a record.

func (Client) GetRecord

func (c Client) GetRecord(ctx context.Context, domainName, recordID string) (*Record, error)

GetRecord gets a specific record.

func (Client) GetRecords

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

GetRecords gets the records of a domain. https://dns-service.iran.liara.ir/swagger

type Content

type Content struct {
	Text string `json:"text,omitempty"`
}

type Record

type Record struct {
	ID       string    `json:"id,omitempty"`
	Name     string    `json:"name"`
	Type     string    `json:"type"`
	TTL      int       `json:"ttl"`
	Contents []Content `json:"contents"`
}

type Response added in v4.12.0

type Response[D any] struct {
	Status string `json:"status"`
	Data   D      `json:"data"`
}

Jump to

Keyboard shortcuts

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