client

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2021 License: MIT Imports: 6 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 {
	Token  string
	Secret string
}

func New

func New(token, secret string) *Client

Creates a new Domeneshop Client

func (*Client) Delete

func (s *Client) Delete(endpoint string) ([]byte, error)

Performs a DELETE request

func (*Client) Get

func (s *Client) Get(endpoint string, params interface{}) ([]byte, error)

Performs a GET request

func (*Client) GetDnsRecordById

func (s *Client) GetDnsRecordById(domainId, recordId int) (*Dns, error)

https://api.domeneshop.no/docs/#operation/getRecordById

func (*Client) GetInvoiceByInvoiceNumber

func (s *Client) GetInvoiceByInvoiceNumber(invoiceId int) (*Invoice, error)

https://api.domeneshop.no/docs/#operation/findInvoiceByNumber

func (*Client) ListDnsRecords

func (s *Client) ListDnsRecords(domainId int, params ListDnsRecordsParams) (*[]Dns, error)

https://api.domeneshop.no/docs/#operation/getDnsRecords

func (*Client) Post

func (s *Client) Post(endpoint string, message []byte) ([]byte, error)

Performs a POST request

func (*Client) Put

func (s *Client) Put(endpoint string, message []byte) ([]byte, error)

Performs a PUT request

func (*Client) Request

func (s *Client) Request(options RequestOptions) ([]byte, error)

Base Request func, used by higher level request interfaces

func (*Client) UpdateDDns added in v0.2.0

func (s *Client) UpdateDDns(params UpdateDDnsParams) (*interface{}, error)

https://api.domeneshop.no/docs/#tag/ddns/paths/~1dyndns~1update/get As the api is not ready, assume that it is successfull if no error is returned

type Dns

type Dns struct {
	Host     string `json:"host"`
	Ttl      int16  `json:"ttl"`
	Type     string `json:"type"`
	Data     string `json:"data"`
	Priority int16  `json:"priority"`
	Weight   int16  `json:"weight"`
	Port     int16  `json:"port"`
}

type DnsSaveResponse added in v0.2.0

type DnsSaveResponse struct {
	Id int `json:"id"`
}

type Domain

type Domain struct {
	Id             int            `json:"id"`
	Domain         string         `json:"domain"`
	ExpiryDate     string         `json:"expiry_date"`
	RegisteredDate string         `json:"registered_date"`
	Renew          bool           `json:"renew"`
	Registrant     string         `json:"registrant"`
	Status         string         `json:"status"`
	Nameservers    []string       `json:"nameservers"`
	Services       DomainServices `json:"services"`
}

type DomainServices

type DomainServices struct {
	Registrar bool   `json:"registrar"`
	Dns       bool   `json:"dns"`
	Email     bool   `json:"email"`
	Webhotel  string `json:"webhotel"`
}

type HttpForward

type HttpForward struct {
	Host  string `json:"host"`
	Frame bool   `json:"frame"`
	Url   string `json:"url"`
}

type Invoice

type Invoice struct {
	Id         int    `json:"id"`
	Type       string `json:"type"`
	Amount     int    `json:"amount"`
	Currency   string `json:"currency"`
	DueDate    string `json:"due_date"`
	IssuedDate string `json:"issued_date"`
	PaidDate   string `json:"paid_date"`
	Status     string `json:"status"`
	Url        string `json:"url"`
}

type ListDnsRecordsParams

type ListDnsRecordsParams struct {
	Host string `url:"host,omitempty"`
	Type string `url:"type,omitempty"`
}

type ListDomainsParams

type ListDomainsParams struct {
	Tld string `url:"tld,omitempty"`
}

type ListInvoicesParams

type ListInvoicesParams struct {
	Status string `url:"status,omitempty"`
}

type RequestOptions

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

type UpdateDDnsParams added in v0.2.0

type UpdateDDnsParams struct {
	HostName string `url:"hostname"`
	MyIp     string `url:"myip,omitempty"`
}

Jump to

Keyboard shortcuts

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