internal

package
v4.14.4 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEndpoint = "https://api.checkdomain.de"

DefaultEndpoint the default API endpoint.

Variables

This section is empty.

Functions

func OAuthStaticAccessToken

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

Types

type Client

type Client struct {
	BaseURL *url.URL
	// contains filtered or unexported fields
}

Client the Autodns API client.

func NewClient

func NewClient(hc *http.Client) *Client

NewClient creates a new Client.

func (*Client) CheckNameservers

func (c *Client) CheckNameservers(ctx context.Context, domainID int) error

func (*Client) CleanCache

func (c *Client) CleanCache(fqdn string)

func (*Client) CreateRecord

func (c *Client) CreateRecord(ctx context.Context, domainID int, record *Record) error

func (*Client) DeleteTXTRecord

func (c *Client) DeleteTXTRecord(ctx context.Context, domainID int, recordName, recordValue string) error

DeleteTXTRecord Checkdomain doesn't seem provide a way to delete records but one can replace all records at once. The current solution is to fetch all records and then use that list minus the record deleted as the new record list. TODO: Simplify this function once Checkdomain do provide the functionality.

func (*Client) GetDomainIDByName

func (c *Client) GetDomainIDByName(ctx context.Context, name string) (int, error)

type Domain

type Domain struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

type DomainListingResponse

type DomainListingResponse struct {
	Page     int                `json:"page"`
	Limit    int                `json:"limit"`
	Pages    int                `json:"pages"`
	Total    int                `json:"total"`
	Embedded EmbeddedDomainList `json:"_embedded"`
}

type DomainResponse

type DomainResponse struct {
	ID      int    `json:"id"`
	Name    string `json:"name"`
	Created string `json:"created"`
	PaidUp  string `json:"payed_up"`
	Active  bool   `json:"active"`
}

type EmbeddedDomainList

type EmbeddedDomainList struct {
	Domains []*Domain `json:"domains"`
}

type EmbeddedRecordList

type EmbeddedRecordList struct {
	Records []*Record `json:"records"`
}

type Nameserver

type Nameserver struct {
	Name string `json:"name"`
}

type NameserverGeneral

type NameserverGeneral struct {
	IPv4       string `json:"ip_v4"`
	IPv6       string `json:"ip_v6"`
	IncludeWWW bool   `json:"include_www"`
}

type NameserverResponse

type NameserverResponse struct {
	General     NameserverGeneral `json:"general"`
	Nameservers []*Nameserver     `json:"nameservers"`
	SOA         NameserverSOA     `json:"soa"`
}

type NameserverSOA

type NameserverSOA struct {
	Mail    string `json:"mail"`
	Refresh int    `json:"refresh"`
	Retry   int    `json:"retry"`
	Expiry  int    `json:"expiry"`
	TTL     int    `json:"ttl"`
}

type Record

type Record struct {
	Name     string `json:"name"`
	Value    string `json:"value"`
	TTL      int    `json:"ttl"`
	Priority int    `json:"priority"`
	Type     string `json:"type"`
}

type RecordListingResponse

type RecordListingResponse struct {
	Page     int                `json:"page"`
	Limit    int                `json:"limit"`
	Pages    int                `json:"pages"`
	Total    int                `json:"total"`
	Embedded EmbeddedRecordList `json:"_embedded"`
}

Jump to

Keyboard shortcuts

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