internal

package
v4.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: MIT Imports: 11 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 {
	BaseURL    *url.URL
	HTTPClient *http.Client
	// contains filtered or unexported fields
}

Client Ionos API client.

func NewClient

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

NewClient creates a new Client.

func (*Client) GetRecords

func (c *Client) GetRecords(ctx context.Context, zoneID string, filter *RecordsFilter) ([]Record, error)

GetRecords gets the records of a zones.

func (*Client) ListZones

func (c *Client) ListZones(ctx context.Context) ([]Zone, error)

ListZones gets all zones.

func (*Client) RemoveRecord

func (c *Client) RemoveRecord(ctx context.Context, zoneID, recordID string) error

RemoveRecord removes a record.

func (*Client) ReplaceRecords

func (c *Client) ReplaceRecords(ctx context.Context, zoneID string, records []Record) error

ReplaceRecords replaces some records of a zones.

type ClientError

type ClientError struct {
	StatusCode int
	// contains filtered or unexported fields
}

ClientError a detailed error.

func (ClientError) Error

func (f ClientError) Error() string

func (ClientError) Unwrap

func (f ClientError) Unwrap() error

type CustomerZone

type CustomerZone struct {
	// The zone id.
	ID string `json:"id,omitempty"`

	// The zone name
	Name    string   `json:"name,omitempty"`
	Records []Record `json:"records,omitempty"`

	// Represents the possible zone types.
	Type string `json:"type,omitempty"`
}

CustomerZone defines model for customer-zone.

type Error

type Error struct {
	// The error code.
	Code string `json:"code,omitempty"`

	// The error message.
	Message string `json:"message,omitempty"`
}

Error defines model for error.

func (Error) Error

func (e Error) Error() string

type Record

type Record struct {
	ID string `json:"id,omitempty"`

	Name    string `json:"name,omitempty"`
	Content string `json:"content,omitempty"`

	// Time to live for the record, recommended 3600.
	TTL int `json:"ttl,omitempty"`

	// Holds supported dns record types.
	Type string `json:"type,omitempty"`

	Priority int `json:"prio,omitempty"`

	// When is true, the record is not visible for lookup.
	Disabled bool `json:"disabled,omitempty"`
}

Record defines model for record.

type RecordsFilter

type RecordsFilter struct {
	// The FQDN used to filter all the record names that end with it.
	Suffix string `url:"suffix,omitempty"`

	// The record names that should be included (same as name field of Record)
	RecordName string `url:"recordName,omitempty"`

	// A comma-separated list of record types that should be included
	RecordType string `url:"recordType,omitempty"`
}

type Zone

type Zone struct {
	// The zone id.
	ID string `json:"id,omitempty"`

	// The zone name.
	Name string `json:"name,omitempty"`

	// Represents the possible zone types.
	Type string `json:"type,omitempty"`
}

Zone defines model for zone.

Jump to

Keyboard shortcuts

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