internal

package
v0.0.0-...-53741e0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse[T any] struct {
	Meta  *Metadata `json:"meta,omitempty"`
	Data  T         `json:"data,omitempty"`
	Error *Error    `json:"error,omitempty"`
}

type Attributes

type Attributes struct {
	Records map[string]map[string][]Record `json:"records,omitempty"`
}

type Client

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

Client the Abion API client.

func NewAbionClient

func NewAbionClient(apiKey string) *Client

NewAbionClient Creates a new Client.

func (*Client) GetZone

func (c *Client) GetZone(ctx context.Context, name string) (*APIResponse[*Zone], error)

GetZone Returns the full information on a single zone

func (*Client) PatchZone

func (c *Client) PatchZone(ctx context.Context, name string, patch ZoneRequest) (*APIResponse[*Zone], error)

PatchZone Updates a zone by patching it according to JSON Merge Patch format (RFC 7396).

type Error

type Error struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func (*Error) Error

func (e *Error) Error() string

type Metadata

type Metadata struct {
	InvocationID string `json:"invocationId,omitempty"`
}

type Record

type Record struct {
	TTL      int    `json:"ttl,omitempty"`
	Data     string `json:"rdata,omitempty"`
	Comments string `json:"comments,omitempty"`
}

type Zone

type Zone struct {
	Type       string     `json:"type,omitempty"`
	ID         string     `json:"id,omitempty"`
	Attributes Attributes `json:"attributes,omitempty"`
}

type ZoneRequest

type ZoneRequest struct {
	Data Zone `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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