domeneshop

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: ISC, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Version defines a version
	Version = "0.0.0"
)

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(resp *http.Response) error

CheckResponse check an response

Types

type BasicAuthTransport

type BasicAuthTransport struct {
	Token  string
	Secret string

	Transport http.RoundTripper
}

BasicAuthTransport is the struct holding the login

func (*BasicAuthTransport) Client

func (t *BasicAuthTransport) Client() *http.Client

Client returns an *http.Client

func (*BasicAuthTransport) RoundTrip

func (t *BasicAuthTransport) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip creates an auth client

type Client

type Client struct {
	BaseURL string

	UserAgent string

	Domains *DomainsService

	Debug bool
	// contains filtered or unexported fields
}

Client represent Domenshop API client

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new client

func (*Client) Do

func (c *Client) Do(req *http.Request, obj interface{}) (*http.Response, error)

Dog sends API

func (*Client) NewRequest

func (c *Client) NewRequest(method, path string, payload interface{}) (*http.Request, error)

NewRequest creates an API request

type Domain

type Domain struct {
	Domain         string   `json:"domain,omitempty"`
	ExpireDate     string   `json:"expire_date,omitempty"`
	ID             int64    `json:"id,omitempty"`
	Nameservers    []string `json:"nameservers,omitempty"`
	RegisteredDate string   `json:"registered_date,omitempty"`
	Registrant     string   `json:"registrant,omitempty"`
	Renew          bool     `json:"renaw,omitempty"`
	Services       services `json:"services,omitempty"`
	Status         string   `json:"status,omitempty"`
}

Domain main domain

type DomainListOptions

type DomainListOptions struct {
	Domain string `url:"domain,omitempty"`
}

DomainListOptions specifies extra options.

type DomainsService

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

DomainsService handles communication

func (*DomainsService) ListDomains

func (s *DomainsService) ListDomains(options *DomainListOptions) (*domainsResponse, error)

ListDomains Lists all domains

type ErrorResponse

type ErrorResponse struct {
	Response
	Message string `json:"code"`
}

ErrorResponse is an error

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type Response

type Response struct {
	HTTPResponse *http.Response
}

Response responds

Jump to

Keyboard shortcuts

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