internal

package
v4.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

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

func (APIError) Error

func (a APIError) Error() string

type Client

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

Client a Hosttech client.

func NewClient

func NewClient(apiKey string) *Client

NewClient creates a new Client.

func (Client) AddRecord

func (c Client) AddRecord(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(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(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) GetZone

func (c Client) GetZone(zoneID string) (*Zone, error)

GetZone Get a single zone. https://api.ns1.hosttech.eu/api/documentation/#/Zones/get_api_user_v1_zones__zoneId_

func (Client) GetZones

func (c Client) GetZones(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