internal

package
v4.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OAuthStaticAccessToken

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

Types

type APIError

type APIError struct {
	APIResponse
	AddRecordMessage string `json:"add_record"`
	DelRecordMessage string `json:"del_record"`
	AddDomainMessage string `json:"add_domain"`
	DelDomainMessage string `json:"del_domain"`
}

func (APIError) Error

func (a APIError) Error() string

type APIResponse

type APIResponse struct {
	Status string `json:"status"`
	Info   string `json:"info"`
}

type Client

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

func NewClient

func NewClient(hc *http.Client) *Client

func (Client) AddRecord

func (c Client) AddRecord(ctx context.Context, domain, prefix, recordType, content string) error

func (Client) DeleteRecord

func (c Client) DeleteRecord(ctx context.Context, domain, prefix, recordType, content string) error

func (Client) GetDomains

func (c Client) GetDomains(ctx context.Context) (*Domains, error)

type Domains

type Domains struct {
	APIResponse
	APICall    string               `json:"add_domain"`
	Subdomains map[string]Subdomain `json:"subdomains"`
}

type Record

type Record struct {
	RecordID   int    `json:"record_id"`
	Content    string `json:"content"`
	TTL        int    `json:"ttl"`
	Type       string `json:"type"`
	Prefix     string `json:"praefix"`
	LastUpdate string `json:"last_update"`
	RecordKey  string `json:"record_key"`
}

type Subdomain

type Subdomain struct {
	Updates          int      `json:"updates"`
	Wildcard         int      `json:"wildcard"`
	DomainUpdateHash string   `json:"domain_update_hash"`
	Records          []Record `json:"records"`
}

Jump to

Keyboard shortcuts

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