Documentation
¶
Index ¶
- Constants
- type Client
- type Provider
- func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)
- func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
- type Record
- type RecordRequest
- type Zone
Constants ¶
const (
DefaultBaseURL = "https://api.neodigit.net/v1"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
BaseURL *url.URL
HTTPClient *http.Client
// contains filtered or unexported fields
}
Client is a Neodigit API client.
type Provider ¶
type Provider struct {
// The neodigit/virtualname api token.
APIToken string `json:"api_token,omitempty"`
APIURL string `json:"api_url,omitempty"`
}
Provider implements DNS record manipulation with neodigit/virtualname.
func (*Provider) AppendRecords ¶
func (p *Provider) AppendRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
AppendRecords adds records to the zone. It returns the records that were added.
func (*Provider) DeleteRecords ¶
func (p *Provider) DeleteRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
DeleteRecords deletes the specified records from the zone. It returns the records that were deleted.
func (*Provider) GetRecords ¶
GetRecords lists all the records in the zone.
func (*Provider) SetRecords ¶
func (p *Provider) SetRecords(ctx context.Context, zone string, records []libdns.Record) ([]libdns.Record, error)
SetRecords sets the records in the zone, either by updating existing records or creating new ones. Per libdns spec: for any (name, type) pair in the input, SetRecords ensures that the only records in the output zone with that (name, type) pair are those provided in the input. It returns the records which were set.
type Record ¶
type Record struct {
ID int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Content string `json:"content,omitempty"`
TTL int `json:"ttl,omitempty"`
Priority int `json:"prio,omitempty"`
}
Record represents a DNS record.
type RecordRequest ¶
type RecordRequest struct {
Record Record `json:"record"`
}
RecordRequest is the request body for creating/updating a record.