internal

package
v4.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Errors []ErrorItem `json:"errors"`
}

func (APIError) Error

func (a APIError) Error() string

type Client

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

func NewClient

func NewClient(apiToken string) *Client

func (Client) CreateDNSRecord

func (c Client) CreateDNSRecord(record DNSRecord) (*CreateDNSRecordResponse, error)

func (Client) DeleteDNSRecord

func (c Client) DeleteDNSRecord(id string) (*DeleteRecordResponse, error)

func (Client) GetJob

func (c Client) GetJob(id string) (*GetJobResponse, error)

type CreateDNSRecordRequest

type CreateDNSRecordRequest struct {
	Data Data `json:"data"`
}

type CreateDNSRecordResponse

type CreateDNSRecordResponse struct {
	Data struct {
		Type       string `json:"type"`
		ID         string `json:"id"`
		Attributes struct {
			Status string `json:"status"`
		} `json:"attributes"`
		Links struct {
			QueueJob  string `json:"queue-job"`
			DNSRecord string `json:"dns-record"`
		} `json:"links"`
	} `json:"data"`
}

type DNSRecord

type DNSRecord struct {
	RecordType string `json:"record_type,omitempty"`
	Name       string `json:"name,omitempty"`
	Domain     string `json:"domain,omitempty"`
	Data       string `json:"data,omitempty"`
	TTL        int    `json:"ttl,omitempty"`
}

type Data

type Data struct {
	Type       string    `json:"type"`
	Attributes DNSRecord `json:"attributes"`
}

type DeleteRecordResponse

type DeleteRecordResponse struct {
	Data struct {
		ID         string `json:"id"`
		Type       string `json:"type"`
		Attributes struct {
			JobType string `json:"job_type"`
			Status  string `json:"status"`
		} `json:"attributes"`
		Links struct {
			Self   string `json:"self"`
			Object string `json:"object"`
		} `json:"links"`
	} `json:"data"`
}

type ErrorItem

type ErrorItem struct {
	Status string `json:"status,omitempty"`
	Title  string `json:"title,omitempty"`
	ID     string `json:"id,omitempty"`
}

type GetJobResponse

type GetJobResponse struct {
	Data struct {
		ID         string `json:"id"`
		Type       string `json:"type"`
		Attributes struct {
			JobType string `json:"job_type"`
			Status  string `json:"status"`
		} `json:"attributes"`
		Links struct {
			Self   string `json:"self"`
			Object string `json:"object"`
		} `json:"links"`
	} `json:"data"`
}

Jump to

Keyboard shortcuts

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