client

package
v0.0.0-...-4717fdd Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gandi

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

Gandi is the handle used to interact with the Gandi API

func New

func New(apikey string, sharingID string, debug bool, dryRun bool) *Gandi

New instantiates a new Gandi client

func (*Gandi) Delete

func (g *Gandi) Delete(path string, params, recipient interface{}) (http.Header, error)

Delete issues a DELETE request. It takes a subpath rooted in the endpoint. Response data is written to the recipient. Returns the response headers and any error

func (*Gandi) Get

func (g *Gandi) Get(path string, params, recipient interface{}) (http.Header, error)

Get issues a GET request. It takes a subpath rooted in the endpoint. Response data is written to the recipient. Returns the response headers and any error

func (*Gandi) GetBytes

func (g *Gandi) GetBytes(path string, params interface{}) (http.Header, []byte, error)

GetBytes issues a GET request but does not attempt to parse any response into JSON. It returns the response headers, a byteslice of the response, and any error

func (*Gandi) Patch

func (g *Gandi) Patch(path string, params, recipient interface{}) (http.Header, error)

Patch issues a PATCH request. It takes a subpath rooted in the endpoint. Response data is written to the recipient. Returns the response headers and any error

func (*Gandi) Post

func (g *Gandi) Post(path string, params, recipient interface{}) (http.Header, error)

Post issues a POST request. It takes a subpath rooted in the endpoint. Response data is written to the recipient. Returns the response headers and any error

func (*Gandi) Put

func (g *Gandi) Put(path string, params, recipient interface{}) (http.Header, error)

Put issues a PUT request. It takes a subpath rooted in the endpoint. Response data is written to the recipient. Returns the response headers and any error

func (*Gandi) SetEndpoint

func (g *Gandi) SetEndpoint(endpoint string)

SetEndpoint sets the URL to the endpoint. It takes a string defining the subpath under https://api.gandi.net/v5/

type StandardError

type StandardError struct {
	Location    string `json:"location"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

StandardError is embedded in a standard error

type StandardResponse

type StandardResponse struct {
	Code    int             `json:"code,omitempty"`
	Message string          `json:"message,omitempty"`
	UUID    string          `json:"uuid,omitempty"`
	Object  string          `json:"object,omitempty"`
	Cause   string          `json:"cause,omitempty"`
	Status  string          `json:"status,omitempty"`
	Errors  []StandardError `json:"errors,omitempty"`
}

StandardResponse is a standard response

Jump to

Keyboard shortcuts

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