internal

package
v4.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 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 APIError

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

func (APIError) Error

func (a APIError) Error() string

type Client

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

Client the Epik API client.

func NewClient

func NewClient(signature string) *Client

NewClient Creates a new Client.

func (Client) CreateHostRecord

func (c Client) CreateHostRecord(ctx context.Context, domain string, record RecordRequest) (*Data, error)

CreateHostRecord creates a record for a domain. https://docs.userapi.epik.com/v2/#/DNS%20Host%20Records/createHostRecord

func (Client) GetDNSRecords

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

GetDNSRecords gets DNS records for a domain. https://docs.userapi.epik.com/v2/#/DNS%20Host%20Records/getDnsRecord

func (Client) RemoveHostRecord

func (c Client) RemoveHostRecord(ctx context.Context, domain string, recordID string) (*Data, error)

RemoveHostRecord removes a record for a domain. https://docs.userapi.epik.com/v2/#/DNS%20Host%20Records/removeHostRecord

type CreateHostRecords

type CreateHostRecords struct {
	Payload RecordRequest `json:"create_host_records_payload"`
}

type Data

type Data struct {
	Code        int    `json:"code,omitempty"`
	Message     string `json:"message,omitempty"`
	Description string `json:"description,omitempty"`
}

type GetDNSRecordResponse

type GetDNSRecordResponse struct {
	Data struct {
		Name    string   `json:"name"`
		Code    int      `json:"code"`
		Records []Record `json:"records"`
	} `json:"data"`
}

type Record

type Record struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
	Data string `json:"data"`
	AUX  int    `json:"aux"`
	TTL  int    `json:"ttl"`
}

type RecordRequest

type RecordRequest struct {
	Host string `json:"HOST,omitempty"`
	Type string `json:"TYPE,omitempty"`
	Data string `json:"DATA,omitempty"`
	Aux  int    `json:"AUX,omitempty"`
	TTL  int    `json:"TTL,omitempty"`
}

type SetHostRecords

type SetHostRecords struct {
	Payload []RecordRequest `json:"set_host_records_payload"`
}

Jump to

Keyboard shortcuts

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