internal

package
v4.12.1 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultBaseURL = "https://api.digitalocean.com"

DefaultBaseURL default API endpoint.

Variables

This section is empty.

Functions

func OAuthStaticAccessToken

func OAuthStaticAccessToken(client *http.Client, accessToken string) *http.Client

Types

type APIError

type APIError struct {
	ID      string `json:"id"`
	Message string `json:"message"`
}

func (APIError) Error

func (a APIError) Error() string

type Client

type Client struct {
	BaseURL *url.URL
	// contains filtered or unexported fields
}

Client the Digital Ocean API client.

func NewClient

func NewClient(hc *http.Client) *Client

NewClient creates a new Client.

func (*Client) AddTxtRecord

func (c *Client) AddTxtRecord(ctx context.Context, zone string, record Record) (*TxtRecordResponse, error)

func (*Client) RemoveTxtRecord

func (c *Client) RemoveTxtRecord(ctx context.Context, zone string, recordID int) error

type Record

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

type TxtRecordResponse

type TxtRecordResponse struct {
	DomainRecord Record `json:"domain_record"`
}

TxtRecordResponse represents a response from DO's API after making a TXT record.

Jump to

Keyboard shortcuts

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