astigandi

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2020 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

// TODO

Documentation

Index

Constants

View Source
const (
	RrsetTypeA     = "A"
	RrsetTypeCNAME = "CNAME"
	RrsetTypeMX    = "MX"
	RrsetTypeTXT   = "TXT"
)

Rrset types

Variables

View Source
var (
	APIKey = flag.String("gandi-api-key", "", "the API key")
)

Flags

Functions

This section is empty.

Types

type Client

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

Client represents the client

func New

func New(c Configuration) *Client

New creates a new client

func (*Client) CreateDomainRecord

func (c *Client) CreateDomainRecord(fqdn string, r Record) (err error)

CreateDomainRecord creates a domain's record

func (*Client) Domain

func (c *Client) Domain(fqdn string) (d Domain, err error)

Domain gets a domain

func (*Client) DomainRecords

func (c *Client) DomainRecords(fqdn string) (rs []Record, err error)

DomainRecords list the domain's records

func (*Client) Domains

func (c *Client) Domains() (ds []Domain, err error)

Domains list the domains

func (*Client) RemoveDomainRecords

func (c *Client) RemoveDomainRecords(fqdn string, filter Record) (err error)

RemoveDomainRecords removes the domain's records

type Configuration

type Configuration struct {
	APIKey string `toml:"api_key"`
	Sender astikit.HTTPSenderOptions
}

Configuration represents the lib's configuration

func FlagConfig

func FlagConfig() Configuration

FlagConfig generates a Configuration based on flags

type Domain

type Domain struct {
	DomainHref        string `json:"domain_href,omitempty"`
	DomainKeysHref    string `json:"domain_keys_href,omitempty"`
	DomainRecordsHref string `json:"domain_records_href,omitempty"`
	FQDN              string `json:"fqdn,omitempty"`
	ZoneHref          string `json:"zone_href,omitempty"`
	ZoneRecordsHref   string `json:"zone_records_href,omitempty"`
	ZoneUUID          string `json:"zone_uuid,omitempty"`
}

Domain represents a domain

type Error

type Error struct {
	Cause   string `json:"cause"`
	Code    int    `json:"code"`
	Message string `json:"message"`
	Object  string `json:"object"`
}

Error represents an error

func (Error) Error

func (e Error) Error() string

Error implements the error interface

type Record

type Record struct {
	RrsetHref   string   `json:"rrset_href,omitempty"`
	RrsetName   string   `json:"rrset_name,omitempty"`
	RrsetTTL    int      `json:"rrset_ttl,omitempty"`
	RrsetType   string   `json:"rrset_type,omitempty"`
	RrsetValues []string `json:"rrset_values,omitempty"`
}

Record represents a record

Jump to

Keyboard shortcuts

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