Documentation
¶
Index ¶
- Variables
- type Provider
- func (p *Provider) AppendRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (*Provider) CaddyModule() caddy.ModuleInfo
- func (p *Provider) DeleteRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)
- func (p *Provider) Provision(ctx caddy.Context) error
- func (p *Provider) SetRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrZoneNotFound is returned when the requested DNS zone does not exist // in the Sakura Cloud account. ErrZoneNotFound = errors.New("sakuracloud: zone not found") // ErrRetriesExhausted is returned when a mutation fails after all retry // attempts due to update conflicts. ErrRetriesExhausted = errors.New("sakuracloud: update retries exhausted") // ErrEmptySettingsHash is returned when the API returns an empty SettingsHash, // which would silently skip the optimistic concurrency check. ErrEmptySettingsHash = errors.New("sakuracloud: empty SettingsHash") )
Functions ¶
This section is empty.
Types ¶
type Provider ¶
type Provider struct {
// API credentials — set via Caddyfile, JSON config, or environment variables.
APIToken string `json:"api_token,omitempty"`
APISecret string `json:"api_secret,omitempty"`
// contains filtered or unexported fields
}
Provider implements the libdns interfaces for Sakura Cloud DNS.
func (*Provider) AppendRecords ¶
func (p *Provider) AppendRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
AppendRecords adds records to the zone, skipping duplicates (matched on Name+Type+RData).
func (*Provider) CaddyModule ¶
func (*Provider) CaddyModule() caddy.ModuleInfo
func (*Provider) DeleteRecords ¶
func (p *Provider) DeleteRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
DeleteRecords removes records from the zone. Records are matched on Name, and optionally on Type, TTL, and Data (empty values act as wildcards per libdns spec). Only records that actually existed are returned.
func (*Provider) GetRecords ¶
GetRecords returns all DNS records in the zone.
func (*Provider) SetRecords ¶
func (p *Provider) SetRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
SetRecords creates or updates records in the zone. For any (name, type) pair in the input, all existing records with that pair are replaced by the input records.
Click to show internal directories.
Click to hide internal directories.