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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultEndpoint = "https://api.autodns.com/v1/"

DefaultEndpoint default API endpoint.

View Source
const DefaultEndpointContext int = 4

DefaultEndpointContext default API endpoint context.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client the Autodns API client.

func NewClient

func NewClient(username string, password string, clientContext int) *Client

NewClient creates a new Client.

func (*Client) AddTxtRecords

func (c *Client) AddTxtRecords(ctx context.Context, domain string, records []*ResourceRecord) (*Zone, error)

AddTxtRecords adds TXT records.

func (*Client) RemoveTXTRecords

func (c *Client) RemoveTXTRecords(ctx context.Context, domain string, records []*ResourceRecord) error

RemoveTXTRecords removes TXT records.

type DataZoneResponse

type DataZoneResponse struct {
	STID     string             `json:"stid"`
	CTID     string             `json:"ctid"`
	Messages []*ResponseMessage `json:"messages"`
	Status   *ResponseStatus    `json:"status"`
	Object   any                `json:"object"`
	Data     []*Zone            `json:"data"`
}

type ResourceRecord

type ResourceRecord struct {
	Name  string `json:"name"`
	TTL   int64  `json:"ttl"`
	Type  string `json:"type"`
	Value string `json:"value"`
	Pref  int32  `json:"pref,omitempty"`
}

ResourceRecord holds a resource record. https://help.internetx.com/display/APIXMLEN/Resource+Record+Object

type ResponseMessage

type ResponseMessage struct {
	Text     string   `json:"text"`
	Messages []string `json:"messages"`
	Objects  []string `json:"objects"`
	Code     string   `json:"code"`
	Status   string   `json:"status"`
}

type ResponseObject

type ResponseObject struct {
	Type    string `json:"type"`
	Value   string `json:"value"`
	Summary int32  `json:"summary"`
	Data    string
}

type ResponseStatus

type ResponseStatus struct {
	Code string `json:"code"`
	Text string `json:"text"`
	Type string `json:"type"`
}

type Zone

type Zone struct {
	Name              string            `json:"origin"`
	ResourceRecords   []*ResourceRecord `json:"resourceRecords"`
	Action            string            `json:"action"`
	VirtualNameServer string            `json:"virtualNameServer"`
}

Zone is an autodns zone record with all for us relevant fields. https://help.internetx.com/display/APIXMLEN/Zone+Object

type ZoneStream

type ZoneStream struct {
	Adds    []*ResourceRecord `json:"adds"`
	Removes []*ResourceRecord `json:"rems"`
}

ZoneStream body of the requests. https://github.com/InterNetX/domainrobot-api/blob/bdc8fe92a2f32fcbdb29e30bf6006ab446f81223/src/domainrobot.json#L35914-L35932

Jump to

Keyboard shortcuts

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