internal

package
v4.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client the ArvanCloud client.

func NewClient

func NewClient(apiKey string) *Client

NewClient Creates a new Client.

func (*Client) CreateRecord

func (c *Client) CreateRecord(ctx context.Context, domain string, record DNSRecord) (*DNSRecord, error)

CreateRecord creates a DNS record. https://www.arvancloud.ir/docs/api/cdn/4.0#operation/dns_records.create

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(ctx context.Context, domain, id string) error

DeleteRecord deletes a DNS record. https://www.arvancloud.ir/docs/api/cdn/4.0#operation/dns_records.remove

func (*Client) GetTxtRecord

func (c *Client) GetTxtRecord(ctx context.Context, domain, name, value string) (*DNSRecord, error)

GetTxtRecord gets a TXT record.

type DNSRecord

type DNSRecord struct {
	ID            string        `json:"id,omitempty"`
	Type          string        `json:"type"`
	Value         any           `json:"value,omitempty"`
	Name          string        `json:"name,omitempty"`
	TTL           int           `json:"ttl,omitempty"`
	UpstreamHTTPS string        `json:"upstream_https,omitempty"`
	IPFilterMode  *IPFilterMode `json:"ip_filter_mode,omitempty"`
}

DNSRecord a DNS record.

type IPFilterMode

type IPFilterMode struct {
	Count     string `json:"count,omitempty"`
	Order     string `json:"order,omitempty"`
	GeoFilter string `json:"geo_filter,omitempty"`
}

IPFilterMode a DNS ip_filter_mode.

type TXTRecordValue

type TXTRecordValue struct {
	Text string `json:"text,omitempty"` // only for TXT Record.
}

TXTRecordValue represents a TXT record value.

Jump to

Keyboard shortcuts

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