Help us shape the future of Go! Take the 2026 Go Developer Survey

auroradns

package module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MPL-2.0 Imports: 12 Imported by: 92

README

Go library for accessing the Aurora DNS API

Build Status PkgGoDev Go Report Card

An Aurora DNS API client written in Go.

auroradns is a Go client library for accessing the Aurora DNS API.

Available API methods

Zones:

  • create
  • delete
  • list

Records:

  • create
  • delete
  • list

Example

tr, _ := auroradns.NewTokenTransport("apiKey", "secret")
client, _ := auroradns.NewClient(tr.Client())

zones, _, _ := client.GetZones()

fmt.Println(zones)

API Documentation

Documentation

Index

Constants

View Source
const (
	RecordTypeA     = "A"
	RecordTypeAAAA  = "AAAA"
	RecordTypeCNAME = "CNAME"
	RecordTypeMX    = "MX"
	RecordTypeNS    = "NS"
	RecordTypeSOA   = "SOA"
	RecordTypeSRV   = "SRV"
	RecordTypeTXT   = "TXT"
	RecordTypeDS    = "DS"
	RecordTypePTR   = "PTR"
	RecordTypeSSHFP = "SSHFP"
	RecordTypeTLSA  = "TLS"
)

Record types.

Variables

This section is empty.

Functions

func WithBaseURL

func WithBaseURL(rawBaseURL string) func(*Client) error

WithBaseURL Allows to define a custom base URL.

Types

type Client

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

Client The API client.

func NewClient

func NewClient(httpClient *http.Client, opts ...Option) (*Client, error)

NewClient Creates a new client.

func (*Client) CreateRecord

func (c *Client) CreateRecord(zoneID string, record Record) (*Record, *http.Response, error)

CreateRecord Creates a new record.

func (*Client) CreateRecordWithContext added in v1.2.0

func (c *Client) CreateRecordWithContext(ctx context.Context, zoneID string, record Record) (*Record, *http.Response, error)

CreateRecordWithContext Creates a new record.

func (*Client) CreateZone

func (c *Client) CreateZone(domain string) (*Zone, *http.Response, error)

CreateZone Creates a zone.

func (*Client) CreateZoneWithContext added in v1.2.0

func (c *Client) CreateZoneWithContext(ctx context.Context, domain string) (*Zone, *http.Response, error)

CreateZoneWithContext Creates a zone.

func (*Client) DeleteRecord

func (c *Client) DeleteRecord(zoneID, recordID string) (bool, *http.Response, error)

DeleteRecord Delete a record.

func (*Client) DeleteRecordWithContext added in v1.2.0

func (c *Client) DeleteRecordWithContext(ctx context.Context, zoneID, recordID string) (bool, *http.Response, error)

DeleteRecordWithContext Delete a record.

func (*Client) DeleteZone

func (c *Client) DeleteZone(zoneID string) (bool, *http.Response, error)

DeleteZone Delete a zone.

func (*Client) DeleteZoneWithContext added in v1.2.0

func (c *Client) DeleteZoneWithContext(ctx context.Context, zoneID string) (bool, *http.Response, error)

DeleteZoneWithContext Delete a zone.

func (*Client) ListRecords

func (c *Client) ListRecords(zoneID string) ([]Record, *http.Response, error)

ListRecords returns a list of all records in given zone.

func (*Client) ListRecordsWithContext added in v1.2.0

func (c *Client) ListRecordsWithContext(ctx context.Context, zoneID string) ([]Record, *http.Response, error)

ListRecordsWithContext returns a list of all records in given zone.

func (*Client) ListZones

func (c *Client) ListZones() ([]Zone, *http.Response, error)

ListZones returns a list of all zones.

func (*Client) ListZonesWithContext added in v1.2.0

func (c *Client) ListZonesWithContext(ctx context.Context) ([]Zone, *http.Response, error)

ListZonesWithContext returns a list of all zones.

type ErrorResponse deprecated

type ErrorResponse = ResponseError

ErrorResponse A representation of an API error message.

Deprecated: use ResponseError instead.

type Option

type Option func(*Client) error

Option Type of a client option.

type Record

type Record struct {
	ID         string `json:"id,omitempty"`
	RecordType string `json:"type"`
	Name       string `json:"name"`
	Content    string `json:"content"`
	TTL        int    `json:"ttl,omitempty"`
}

Record a DNS record.

type ResponseError added in v1.1.0

type ResponseError struct {
	ErrorCode string `json:"error"`
	Message   string `json:"errormsg"`
}

ResponseError A representation of an API error message.

func (*ResponseError) Error added in v1.1.0

func (e *ResponseError) Error() string

type TokenTransport

type TokenTransport struct {

	// Transport is the underlying HTTP transport to use when making requests.
	// It will default to http.DefaultTransport if nil.
	Transport http.RoundTripper
	// contains filtered or unexported fields
}

TokenTransport HTTP transport for API authentication.

func NewTokenTransport

func NewTokenTransport(apiKey, secret string) (*TokenTransport, error)

NewTokenTransport Creates a new TokenTransport.

func (*TokenTransport) Client

func (t *TokenTransport) Client() *http.Client

Client Creates a new HTTP client.

func (*TokenTransport) RoundTrip

func (t *TokenTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip executes a single HTTP transaction.

func (*TokenTransport) Wrap

func (t *TokenTransport) Wrap(client *http.Client) *http.Client

Wrap Wraps an HTTP client Transport with the TokenTransport.

type Zone

type Zone struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name"`
}

Zone a DNS zone.

Jump to

Keyboard shortcuts

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