websupport

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: EUPL-1.2 Imports: 8 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 {
	Config *Config
	// contains filtered or unexported fields
}

func NewClient

func NewClient(config *Config) *Client

func (*Client) BaseUrl

func (client *Client) BaseUrl() string

func (*Client) CreateRecord

func (client *Client) CreateRecord(domainName string, dnsRecord *DnsRecord) error

func (*Client) DeleteRecord

func (client *Client) DeleteRecord(domainName string, dnsRecord *DnsRecord) error

func (*Client) FindDNSRecord

func (client *Client) FindDNSRecord(domainName string, dnsRecord *DnsRecord) (*DnsRecord, error)

func (*Client) GetDNSRecords

func (client *Client) GetDNSRecords(domainName string) (*Domains, error)

func (*Client) NewRequest

func (client *Client) NewRequest(method string, url string, data []byte) (*http.Request, error)

func (*Client) Request

func (client *Client) Request(method string, url string, data []byte) (*http.Response, error)

func (*Client) UpdateRecord

func (client *Client) UpdateRecord(domainName string, oldDnsRecord *DnsRecord, newDnsRecord *DnsRecord) error

type Config

type Config struct {
	ApiKey    string
	ApiSecret string
}

type DnsRecord

type DnsRecord struct {
	Type    string `json:"type"`
	Name    string `json:"name"`
	Content string `json:"content"`
	Ttl     int    `json:"ttl"`
	Id      int    `json:"id"`
}

type Domains

type Domains struct {
	Items []DnsRecord `json:"items"`
}

type HttpErrorContent

type HttpErrorContent struct {
	Content []string `json:"content"`
}

type WebsupportError

type WebsupportError struct {
	Item   DnsRecord        `json:"item"`
	Status string           `json:"status"`
	Errors HttpErrorContent `json:"errors"`
}

func (*WebsupportError) Error

func (e *WebsupportError) Error() string

Jump to

Keyboard shortcuts

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