arvancloud

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 11 Imported by: 0

README

Arvancloud for libdns

Go Reference

This package implements the libdns interfaces for Arvancloud, allowing you to manage DNS records.

Authenticating

This package uses the Apikey authentication method.

The provided apikey must have the DNS administrator and DOMAIN administrator permissions.

permissions

Example Configuration

p := arvancloud.Provider{
    AuthAPIKey: "apikey",
}

Documentation

Overview

Package arvancloud implements a DNS record management client compatible with the libdns interfaces for ArvanCloud.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ANAMERecordValue

type ANAMERecordValue struct {
	Location   string `json:"location"`
	HostHeader string `json:"host_header,omitempty"`
	Port       int    `json:"port,omitempty"`
}

ANAMERecordValue represents the value structure for ANAME records.

type ARecordValue

type ARecordValue struct {
	IP      string `json:"ip"`
	Port    int    `json:"port,omitempty"`
	Weight  int    `json:"weight,omitempty"`
	Country string `json:"country,omitempty"`
}

ARecordValue represents the value structure for A and AAAA records. Note: The API expects a slice of these for A/AAAA records.

type CAARecordValue

type CAARecordValue struct {
	Value string `json:"value"`
	Tag   string `json:"tag"`
}

CAARecordValue represents the value structure for CAA records.

type CNAMERecordValue

type CNAMERecordValue struct {
	Host       string `json:"host"`
	HostHeader string `json:"host_header,omitempty"`
	Port       int    `json:"port,omitempty"`
}

CNAMERecordValue represents the value structure for CNAME records.

type IPFilter

type IPFilter struct {
	Count     string `json:"count"`
	GeoFilter string `json:"geo_filter"`
	Order     string `json:"order"`
}

IPFilter defines the IP filtering mode for a record.

type MXRecordValue

type MXRecordValue struct {
	Host     string `json:"host"`
	Priority uint16 `json:"priority"`
}

MXRecordValue represents the value structure for MX records.

type NSRecordValue

type NSRecordValue struct {
	Host string `json:"host"`
}

NSRecordValue represents the value structure for NS records.

type PTRRecordValue

type PTRRecordValue struct {
	Domain string `json:"domain"`
}

PTRRecordValue represents the value structure for PTR records.

type Provider

type Provider struct {
	// AuthAPIKey is the API token for ArvanCloud.
	// It can be obtained from the ArvanCloud user panel.
	AuthAPIKey string `json:"auth_api_key,omitempty"`
	// contains filtered or unexported fields
}

Provider facilitates DNS record manipulation with ArvanCloud.

func (*Provider) AppendRecords

func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

AppendRecords adds records to the zone. It returns the records that were added.

func (*Provider) DeleteRecords

func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

DeleteRecords deletes the specified records from the zone. It returns the records that were deleted.

func (*Provider) GetRecords

func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)

GetRecords lists all the records in the zone.

func (*Provider) ListZones

func (p *Provider) ListZones(ctx context.Context) ([]libdns.Zone, error)

func (*Provider) SetRecords

func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)

SetRecords sets the records in the zone, either by updating existing records or creating new ones. It returns the updated records.

type SRVRecordValue

type SRVRecordValue struct {
	Target   string `json:"target"`
	Port     uint16 `json:"port"`
	Priority uint16 `json:"priority"`
	Weight   uint16 `json:"weight"`
}

SRVRecordValue represents the value structure for SRV records.

type TLSARecordValue

type TLSARecordValue struct {
	Usage        string `json:"usage"`
	Selector     string `json:"selector"`
	MatchingType string `json:"matching_type"`
	Certificate  string `json:"certificate"`
}

TLSARecordValue represents the value structure for TLSA records.

type TXTRecordValue

type TXTRecordValue struct {
	Text string `json:"text"`
}

TXTRecordValue represents the value structure for TXT records.

Jump to

Keyboard shortcuts

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