Documentation ¶
Index ¶
- type Client
- func (c *Client) Call(serviceMethod string, args []interface{}, reply interface{}) error
- func (c *Client) Delete(URI string, decoded interface{}) (*http.Response, error)
- func (c *Client) DoRest(req *http.Request, decoded interface{}) (*http.Response, error)
- func (c *Client) Get(URI string, decoded interface{}) (*http.Response, error)
- func (c *Client) NewJSONRequest(method string, url string, data interface{}) (*http.Request, error)
- func (c *Client) Patch(URI string, data interface{}, decoded interface{}) (*http.Response, error)
- func (c *Client) Post(URI string, data interface{}, decoded interface{}) (*http.Response, error)
- func (c *Client) Put(URI string, data interface{}, decoded interface{}) (*http.Response, error)
- type SystemType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Key is the API key to provide to gandi Key string // Url is the base URL of the gandi API Url string }
Client holds the configuration of a gandi client
func New ¶
func New(apiKey string, system SystemType) *Client
New creates a new gandi client for the given system
func (*Client) Delete ¶
Delete performs a Delete request to gandi Live DNS api and decodes the returned data if a not null decoded pointer is provided
func (*Client) DoRest ¶
DoRest performs a request to gandi LiveDNS api and optionnally decodes the reply
func (*Client) Get ¶
Get performs a Get request to gandi Live DNS api and decodes the returned data if a not null decoded pointer is provided
func (*Client) NewJSONRequest ¶
NewJSONRequest creates a new authenticated to gandi live DNS REST API. If data is not null, it will be encoded as json and prodived in the request body
func (*Client) Patch ¶
Patch performs a Patch request to gandi Live DNS api - with data encoded as JSON if a not null data pointer is provided - decodes the returned data if a not null decoded pointer is provided - ensures the status code is an HTTP accepted
func (*Client) Post ¶
Post performs a Post request request to gandi Live DNS api - with data encoded as JSON if a not null data pointer is provided - decodes the returned data if a not null decoded pointer is provided - ensures the status code is an HTTP accepted
type SystemType ¶
type SystemType int
SystemType is the type used to resolve gandi API address
const ( // Production is the SystemType to provide to New to use the production XML API Production SystemType = iota // Testing is the SystemType to provide to New to use the test XML API Testing // LiveDNS is the SystemType to provide to New to use the Live DNS REST API // Full documentation of the API is available here: http://doc.livedns.gandi.net/ LiveDNS )