internal

package
v4.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APIBaseURL  = "https://api.mythic-beasts.com/dns/v2"
	AuthBaseURL = "https://auth.mythic-beasts.com/login"
)

Default API endpoints.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	APIEndpoint  *url.URL
	AuthEndpoint *url.URL
	HTTPClient   *http.Client
	// contains filtered or unexported fields
}

Client the Mythic Beasts API client.

func NewClient

func NewClient(username string, password string) *Client

NewClient Creates a new Client.

func (*Client) CreateAuthenticatedContext

func (c *Client) CreateAuthenticatedContext(ctx context.Context) (context.Context, error)

func (*Client) CreateTXTRecord

func (c *Client) CreateTXTRecord(ctx context.Context, zone, leaf, value string, ttl int) error

CreateTXTRecord creates a TXT record. https://www.mythic-beasts.com/support/api/dnsv2#ep-get-zoneszonerecords

func (*Client) RemoveTXTRecord

func (c *Client) RemoveTXTRecord(ctx context.Context, zone, leaf, value string) error

RemoveTXTRecord removes a TXT records. https://www.mythic-beasts.com/support/api/dnsv2#ep-delete-zoneszonerecords

type Token

type Token struct {
	// The bearer token for use in API requests
	Token string `json:"access_token"`

	// The maximum lifetime of the token in seconds
	Lifetime int `json:"expires_in"`

	// The token type (must be 'bearer')
	TokenType string `json:"token_type"`

	Deadline time.Time `json:"-"`
}

Jump to

Keyboard shortcuts

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