Versions in this module Expand all Collapse all v0 v0.1.0 Jun 18, 2024 Changes in this version + var ErrAuthAlreadyDefined = errors.New("only one authorization token may be set at a time") + var ErrAuthTokenRequired = errors.New("one of api key or personal access token must be set") + var ErrEmptySet = errors.New("required set is empty") + var ErrHttpReqFailed = errors.New("failed to get data from Gandi") + var ErrMismatch = errors.New("values do not match") + var ErrMissingRequiredField = errors.New("missing required field") + var ErrParseResFailed = errors.New("failed to parse response from Gandi") + var ErrRecordExists = errors.New("record already exists according to Gandi") + func InterceptorChain(rt http.RoundTripper, interceptors ...Interceptor) http.RoundTripper + type Client struct + BaseUrl url.URL + func New(opts ...Option) (*Client, error) + func (c *Client) AddDomainRecord(fqdn string, record RecordSet) (int, error) + func (c *Client) AddRecordByName(fqdn string, record RecordSet) (int, error) + func (c *Client) AddRecordByNameAndType(fqdn string, record RecordSet) (int, error) + func (c *Client) GetDomainInfo(fqdn string) (*DomainInfo, error) + func (c *Client) GetDomainRecords(fqdn string, rqp *RecordsQueryParams) ([]RecordSet, *PagingDetails, error) + func (c *Client) GetDomains(params *DomainsQueryParams) ([]DomainInfo, *PagingDetails, error) + func (c *Client) GetNameservers(fqdn string) ([]string, error) + func (c *Client) GetRecordTypes() ([]string, error) + func (c *Client) GetRecordsByName(fqdn string, name string) ([]RecordSet, error) + func (c *Client) GetRecordsByNameAndType(fqdn string, name string, kind string) ([]RecordSet, error) + func (c *Client) RemoveAllDomainRecords(fqdn string) (int, error) + func (c *Client) RemoveAllRecordsWithName(fqdn string, name string) (int, error) + func (c *Client) RemoveRecordByNameAndType(fqdn string, record RecordSet) (int, error) + func (c *Client) ReplaceAllRecordsByName(fqdn string, records []RecordSet) (int, error) + func (c *Client) ReplaceDomainRecords(fqdn string, records []RecordSet) (int, error) + func (c *Client) ReplaceRecordByNameAndType(fqdn string, record RecordSet) (int, error) + func (c *Client) UpdateDomainInfo(fqdn string, info DomainInfo) (int, error) + type DomainInfo struct + AutomaticSnapshots bool + Fqdn string + Href string + KeysHref string + RecordsHref string + type DomainsQueryParams struct + Page int + PerPage int + SharingId string + func (dqp *DomainsQueryParams) Values() url.Values + type Interceptor func(http.RoundTripper) InterceptorRT + func AuthInterceptor(authHeader string) Interceptor + type InterceptorRT func(*http.Request) (*http.Response, error) + func (irt InterceptorRT) RoundTrip(req *http.Request) (*http.Response, error) + type Option func(c *Client) error + func WithApiKey(key string) Option + func WithBaseUrl(value url.URL) Option + func WithHttpDebug() Option + func WithPersonalAccessToken(token string) Option + type PagingDetails struct + LastPage *url.URL + NextPage *url.URL + TotalItems int + type QueryParams interface + Values func() url.Values + type RecordSet struct + Href string + Name string + Ttl int + Type string + Values []string + type RecordsQueryParams struct + Page int + PerPage int + SortBy string + Type string + func (rqp *RecordsQueryParams) Values() url.Values