Documentation
¶
Index ¶
- func NewTokenStorage(location string) client.Storage
- type ApiBaseUri
- type Client
- type Provider
- func (p *Provider) AppendRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) DebugOutput() io.Writer
- func (p *Provider) DebugOutputLevel() provider.OutputLevel
- func (p *Provider) DeleteRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) ExpirationTime() client.ExpirationTime
- func (p *Provider) GetBaseUri() *url.URL
- func (p *Provider) GetPrivateKey() (*rsa.PrivateKey, error)
- func (p *Provider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)
- func (p *Provider) GlobalKey() bool
- func (p *Provider) ListZones(ctx context.Context) ([]libdns.Zone, error)
- func (p *Provider) Login() string
- func (p *Provider) ReadOnly() bool
- func (p *Provider) SetDebug(level provider.OutputLevel, writer io.Writer)
- func (p *Provider) SetRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (p *Provider) StorageKey() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTokenStorage ¶ added in v1.0.0
Types ¶
type ApiBaseUri ¶ added in v1.0.0
func DefaultApiBaseUri ¶ added in v1.0.0
func DefaultApiBaseUri() *ApiBaseUri
func (*ApiBaseUri) MarshalJSON ¶ added in v1.0.0
func (a *ApiBaseUri) MarshalJSON() ([]byte, error)
func (*ApiBaseUri) UnmarshalJSON ¶ added in v1.0.0
func (a *ApiBaseUri) UnmarshalJSON(data []byte) error
type Provider ¶
type Provider struct {
// AuthLogin the login used for authentication
AuthLogin string `json:"login"`
// AuthReadOnly set to true to create readonly keys
AuthReadOnly bool `json:"read_only"`
// AuthNotGlobalKey can be set to true to generate keys that are
// restricted to clients with IP addresses included in the whitelist.
AuthNotGlobalKey bool `json:"not_global_key"`
// AuthExpirationTime specifies the time-to-live for an authentication token.
AuthExpirationTime client.ExpirationTime `json:"expiration_time"`
// PrivateKey can be generated here:
// https://www.transip.nl/cp/account/api
//
// It is used for authentication and can be provided either as a
// string containing the key or as a filepath to a file containing
// the private key.
PrivateKey string `json:"private_key"`
// DebugLevel sets the verbosity for logging API requests and responses.
DebugLevel provider.OutputLevel `json:"debug_level"`
// DebugOut defines the output destination for debug logs.
// Defaults to standard output (STDOUT).
DebugOut io.Writer `json:"-"`
// BaseURI is the base URI used for API calls.
// Default: https://api.transip.nl/v6/
BaseUri *ApiBaseUri `json:"base_uri"`
// TokenStorage specifies where tokens are stored and can be reused
// until they expire. It can be set to:
// - "memory" for in-memory storage,
// - a file path for storing keys on disk
// - empty, in which case keys will be stored in a "transip" directory
// in the user's temp folder.
TokenStorage string `json:"token_storage"`
// ClientControl has two modes:
// - RecordLevelControl (default): updates records individually.
// - FullZoneControl: replaces the entire zone in a single call.
// While this is much faster, it can encounter race conditions if
// another program modifies the zone simultaneously, as updates
// may be overwritten.
ClientControl client.ControleMode `json:"client_control_mode"`
// contains filtered or unexported fields
}
func (*Provider) AppendRecords ¶
func (*Provider) DebugOutput ¶ added in v1.0.0
func (*Provider) DebugOutputLevel ¶ added in v1.0.0
func (p *Provider) DebugOutputLevel() provider.OutputLevel
func (*Provider) DeleteRecords ¶
func (*Provider) ExpirationTime ¶ added in v1.0.0
func (p *Provider) ExpirationTime() client.ExpirationTime
func (*Provider) GetBaseUri ¶ added in v1.0.0
func (*Provider) GetPrivateKey ¶ added in v1.0.0
func (p *Provider) GetPrivateKey() (*rsa.PrivateKey, error)
func (*Provider) GetRecords ¶
func (*Provider) SetDebug ¶ added in v1.0.0
func (p *Provider) SetDebug(level provider.OutputLevel, writer io.Writer)
func (*Provider) SetRecords ¶
func (*Provider) StorageKey ¶ added in v1.0.0
Source Files
¶
Click to show internal directories.
Click to hide internal directories.