v1

package
v0.7.8 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrModifyRevisionNotFound is returned for Create and Update requests when the zones CurrentRevision is not
	// found in the set of Revisions. This is probably an Engine problem and not your code.
	ErrModifyRevisionNotFound = errors.New("revision not found")

	// ErrModifyRecordNotFound is returned for Create and Update requests when the modified Record is not found in
	// the zones current Revision. This is probably an Engine problem and not your code, but might be a problem in
	// these API bindings.
	ErrModifyRecordNotFound = errors.New("record not found")

	// ErrEmptyRecordNameNotSupported is returned for Create requests when the record has no name set.
	// Instead "@" must be used to target the domain root.
	ErrEmptyRecordNameNotSupported = errors.New("empty record name not supported - use \"@\" instead")
)

Functions

This section is empty.

Types

type DNSServer

type DNSServer struct {
	// Required - DNS Server name (FQDN).
	Server string `json:"server"`

	// DNS Server alias
	Alias string `json:"alias"`
}

type Record

type Record struct {
	Identifier string `json:"identifier,omitempty" anxcloud:"identifier"`
	ZoneName   string `json:"-"`
	Immutable  bool   `json:"immutable,omitempty"`
	// Name of the DNS record.
	// Use "@" to select the domain root. Creation of records with an empty Name field is not supported.
	Name   string `json:"name"`
	RData  string `json:"rdata"`
	Region string `json:"region"`
	TTL    int    `json:"ttl"`
	Type   string `json:"type"`
}

func (*Record) DecodeAPIResponse

func (r *Record) DecodeAPIResponse(ctx context.Context, data io.Reader) error

func (*Record) EndpointURL

func (r *Record) EndpointURL(ctx context.Context) (*url.URL, error)

func (*Record) FilterAPIRequest added in v0.4.6

func (r *Record) FilterAPIRequest(ctx context.Context, req *http.Request) (*http.Request, error)

FilterAPIRequest checks whether a name was set on create operations and returns ErrEmptyRecordNameNotSupported if not.

func (*Record) GetIdentifier added in v0.4.5

func (o *Record) GetIdentifier(ctx context.Context) (string, error)

GetIdentifier returns the primary identifier of a Record object

func (*Record) HasPagination

func (r *Record) HasPagination(ctx context.Context) (bool, error)

type Revision

type Revision struct {
	CreatedAt  time.Time `json:"created_at"`
	Identifier string    `json:"identifier"`
	ModifiedAt time.Time `json:"modified_at"`
	Records    []Record  `json:"records"`
	Serial     int       `json:"serial"`
	State      string    `json:"state"`
}

type Zone

type Zone struct {
	// Zone name
	Name string `json:"name,omitempty" anxcloud:"identifier"`

	// Required - Is master flag
	// Flag designating if CloudDNS operates as master or slave.
	IsMaster bool `json:"master"`

	// Required - DNSSEC mode
	// DNSSEC mode (master-only) ["managed" or "unvalidated"].
	DNSSecMode string `json:"dnssec_mode"`

	// Required - Admin email address
	// Admin email address used in SOA record.
	AdminEmail string `json:"admin_email"`

	// Required - Refresh value
	// Refresh value used in SOA record.
	Refresh int `json:"refresh"`

	// Required - Retry value
	//Retry value used in SOA record.
	Retry int `json:"retry"`

	// Required - Expire value
	// Expire value used in SOA record.
	Expire int `json:"expire"`

	// Required - Time to live
	// Default TTL for NS records.
	TTL int `json:"ttl"`

	// Master Name Server
	MasterNS string `json:"master_ns,omitempty"`

	// IP addresses allowed to initiate domain transfer (DNS NOTIFY).
	NotifyAllowedIPs []string `json:"notify_allowed_ips,omitempty"`

	// Configured DNS servers (empty means default servers).
	DNSServers []DNSServer `json:"dns_servers,omitempty"`

	Customer        string     `json:"customer"`
	CreatedAt       time.Time  `json:"created_at"`
	UpdatedAt       time.Time  `json:"updated_at"`
	PublishedAt     time.Time  `json:"published_at"`
	IsEditable      bool       `json:"is_editable"`
	ValidationLevel int        `json:"validation_level"`
	DeploymentLevel int        `json:"deployment_level"`
	Revisions       []Revision `json:"revisions"`
	CurrentRevision string     `json:"current_revision,omitempty"`
}

func (*Zone) EndpointURL

func (z *Zone) EndpointURL(ctx context.Context) (*url.URL, error)

func (*Zone) FilterAPIRequest

func (z *Zone) FilterAPIRequest(ctx context.Context, req *http.Request) (*http.Request, error)

func (*Zone) FilterAPIRequestBody

func (z *Zone) FilterAPIRequestBody(ctx context.Context) (interface{}, error)

func (*Zone) FilterAPIResponse

func (z *Zone) FilterAPIResponse(ctx context.Context, res *http.Response) (*http.Response, error)

func (*Zone) GetIdentifier added in v0.4.5

func (o *Zone) GetIdentifier(ctx context.Context) (string, error)

GetIdentifier returns the primary identifier of a Zone object

func (*Zone) HasPagination

func (z *Zone) HasPagination(ctx context.Context) (bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳