internal

package
v4.13.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2023 License: MIT Imports: 13 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 {
	Code    int    `json:"code"`
	Status  string `json:"status"`
	Message string `json:"error"`
}

func (APIError) Error

func (a APIError) Error() string

type AddRecord

type AddRecord struct {
	Response AddRecordResponse `json:"response"`
	Record   string            `json:"record"`
	Code     int               `json:"code"`
	Status   string            `json:"status"`
	Error    string            `json:"error"`
}

type AddRecordResponse

type AddRecordResponse struct {
	ZoneType []string `json:"zonetype"`
	Signed   []int    `json:"signed"`
}

type Client

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

Client a BrandIT DNS API client.

func NewClient

func NewClient(apiUsername, apiKey string) (*Client, error)

NewClient creates a new Client.

func (*Client) AddRecord

func (c *Client) AddRecord(ctx context.Context, domainName, account, newRecordID string, record Record) (*AddRecord, error)

AddRecord adds a DNS record. https://portal.brandit.com/apidocv3#addDNSRR

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, domainName, account, dnsRecord, recordID string) error

DeleteRecord deletes a DNS record. https://portal.brandit.com/apidocv3#deleteDNSRR

func (*Client) ListRecords

func (c *Client) ListRecords(ctx context.Context, account, dnsZone string) (*ListRecordsResponse, error)

ListRecords lists all records. https://portal.brandit.com/apidocv3#listDNSRR

func (*Client) StatusDomain

func (c *Client) StatusDomain(ctx context.Context, domain string) (*StatusResponse, error)

StatusDomain returns the status of a domain and account associated with it. https://portal.brandit.com/apidocv3#statusDomain

type ListRecordsResponse

type ListRecordsResponse struct {
	Limit  []int    `json:"limit,omitempty"`
	Column []string `json:"column,omitempty"`
	Count  []int    `json:"count,omitempty"`
	First  []int    `json:"first,omitempty"`
	Total  []int    `json:"total,omitempty"`
	RR     []string `json:"rr,omitempty"`
	Last   []int    `json:"last,omitempty"`
}

type Record

type Record struct {
	ID      int    `json:"id,omitempty"`
	Type    string `json:"type,omitempty"`
	Name    string `json:"name,omitempty"` // subdomain name or @ if you don't want subdomain
	Content string `json:"content,omitempty"`
	TTL     int    `json:"ttl,omitempty"` // default 600
}

type Response added in v4.12.0

type Response[T any] struct {
	Response T      `json:"response,omitempty"`
	Code     int    `json:"code"`
	Status   string `json:"status"`
	Error    string `json:"error"`
}

type StatusResponse

type StatusResponse struct {
	RenewalMode                []string `json:"renewalmode"`
	Status                     []string `json:"status"`
	TransferLock               []int    `json:"transferlock"`
	Registrar                  []string `json:"registrar"`
	PaidUntilDate              []string `json:"paiduntildate"`
	Nameserver                 []string `json:"nameserver"`
	RegistrationExpirationDate []string `json:"registrationexpirationdate"`
	Domain                     []string `json:"domain"`
	RenewalDate                []string `json:"renewaldate"`
	UpdatedDate                []string `json:"updateddate"`
	BillingContact             []string `json:"billingcontact"`
	XDomainRoID                []string `json:"x-domain-roid"`
	AdminContact               []string `json:"admincontact"`
	TechContact                []string `json:"techcontact"`
	DomainIDN                  []string `json:"domainidn"`
	CreatedDate                []string `json:"createddate"`
	RegistrarTransferDate      []string `json:"registrartransferdate"`
	Zone                       []string `json:"zone"`
	Auth                       []string `json:"auth"`
	UpdatedBy                  []string `json:"updatedby"`
	RoID                       []string `json:"roid"`
	OwnerContact               []string `json:"ownercontact"`
	CreatedBy                  []string `json:"createdby"`
	TransferMode               []string `json:"transfermode"`
}

Jump to

Keyboard shortcuts

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