internal

package
v4.16.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 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 {
	// contains filtered or unexported fields
}

Client the API client for Stackpath.

func NewClient

func NewClient(ctx context.Context, stackID, clientID, clientSecret string) *Client

NewClient creates a new Client.

func (*Client) CreateZoneRecord

func (c *Client) CreateZoneRecord(ctx context.Context, zone *Zone, record Record) error

CreateZoneRecord creates a record. https://stackpath.dev/reference/createzonerecord

func (*Client) DeleteZoneRecord

func (c *Client) DeleteZoneRecord(ctx context.Context, zone *Zone, record Record) error

DeleteZoneRecord deletes a record. https://stackpath.dev/reference/deletezonerecord

func (*Client) GetZoneRecords

func (c *Client) GetZoneRecords(ctx context.Context, name string, zone *Zone) ([]Record, error)

GetZoneRecords gets all records. https://stackpath.dev/reference/getzonerecords

func (*Client) GetZones

func (c *Client) GetZones(ctx context.Context, domain string) (*Zone, error)

GetZones gets all zones. https://stackpath.dev/reference/getzones

type ErrorResponse

type ErrorResponse struct {
	Code    int    `json:"code"`
	Message string `json:"error"`
}

ErrorResponse the API error response representation.

func (*ErrorResponse) Error

func (e *ErrorResponse) Error() string

type Record

type Record struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name"`
	Type string `json:"type"`
	TTL  int    `json:"ttl"`
	Data string `json:"data"`
}

Record a DNS record representation.

type Records

type Records struct {
	Records []Record `json:"records"`
}

Records is the response struct from the Stackpath api GetZoneRecords.

type Zone

type Zone struct {
	ID     string
	Domain string
}

Zone a DNS zone representation.

type Zones

type Zones struct {
	Zones []Zone `json:"zones"`
}

Zones is the response struct from the Stackpath api GetZones.

Jump to

Keyboard shortcuts

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