client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HTTP_TIMEOUT               = 10
	DOMAINS_URL                = "/api/zones/records"
	TERRAFORM_PROVIDER_COMMENT = "Managed by terraform"
)
View Source
const (
	StatusOK           = "ok"
	StatusError        = "error"
	StatusInvalidToken = "invalid-token"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(apiURL string, token string, skipCertificateVerification bool) (*Client, error)

func (Client) AddRecord

func (c Client) AddRecord(ctx context.Context, record model.DNSRecord) error

AddRecord adds DNS record for a given domain.

func (Client) DeleteRecord

func (c Client) DeleteRecord(ctx context.Context, record model.DNSRecord) error

DeleteRecord deletes a DNS record.

func (Client) GetRecords

func (c Client) GetRecords(ctx context.Context, domain model.DNSRecordName) ([]model.DNSRecord, error)

GetRecords retrieves all DNS records for a given domain name (zone is inferred automatically).

func (Client) UpdateRecord

func (c Client) UpdateRecord(ctx context.Context, oldRecord model.DNSRecord, newRecord model.DNSRecord) error

UpdateRecord updates DNS record for a given domain.

Jump to

Keyboard shortcuts

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