internal

package
v4.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OAuthStaticAccessToken added in v4.12.0

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

Types

type APIError

type APIError struct {
	Message    string         `json:"message,omitempty"`
	Errors     map[string]any `json:"errors,omitempty"`
	StatusCode int            `json:"-"`
}

func (APIError) Error

func (a APIError) Error() string

type Client

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

Client a Hosttech client.

func NewClient

func NewClient(hc *http.Client) *Client

NewClient creates a new Client.

func (Client) AddRecord

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

AddRecord Adds a new record to the zone and returns the newly created record. https://api.ns1.hosttech.eu/api/documentation/#/Records/post_api_user_v1_zones__zoneId__records

func (Client) DeleteRecord

func (c Client) DeleteRecord(ctx context.Context, zoneID, recordID string) error

DeleteRecord Deletes a single record for the given id. https://api.ns1.hosttech.eu/api/documentation/#/Records/delete_api_user_v1_zones__zoneId__records__recordId_

func (Client) GetRecords

func (c Client) GetRecords(ctx context.Context, zoneID, recordType string) ([]Record, error)

GetRecords Returns a list of all records for the given zone. https://api.ns1.hosttech.eu/api/documentation/#/Records/get_api_user_v1_zones__zoneId__records

func (Client) GetZones

func (c Client) GetZones(ctx context.Context, query string, limit, offset int) ([]Zone, error)

GetZones Get a list of all zones. https://api.ns1.hosttech.eu/api/documentation/#/Zones/get_api_user_v1_zones

type Record

type Record struct {
	ID      int    `json:"id,omitempty"`
	Type    string `json:"type,omitempty"`
	Name    string `json:"name,omitempty"`
	Zone    string `json:"zone,omitempty"`
	Text    string `json:"text,omitempty"`
	TTL     int    `json:"ttl,omitempty"`
	Comment string `json:"comment,omitempty"`
}

type Zone

type Zone struct {
	ID          int    `json:"id"`
	Name        string `json:"name,omitempty"`
	Email       string `json:"email,omitempty"`
	TTL         int    `json:"ttl,omitempty"`
	Nameserver  string `json:"nameserver,omitempty"`
	Dnssec      bool   `json:"dnssec,omitempty"`
	DnssecEmail string `json:"dnssec_email,omitempty"`
}

Jump to

Keyboard shortcuts

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