client

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 12 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, pat string, apiurl string, sharingID string, debug bool, dryRun bool, timeout time.Duration) *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) GetCollection

func (g *Gandi) GetCollection(path string, params interface{}) (http.Header, []json.RawMessage, error)

GetCollection supports pagination on GET requests. It takes a subpath rooted in the endpoint. Response data is written to the recipient. Returns the response headers and any error

func (*Gandi) GetEndpoint

func (g *Gandi) GetEndpoint() string

GetEndpoint gets the URL of the endpoint.

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/

Jump to

Keyboard shortcuts

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