Documentation
¶
Index ¶
- func ProviderName(module caddy.Module) string
- type BaseProvider
- type Handler
- type IPPrefixList
- type Provider
- type ReturnCode
- type StaticZonesProvider
- func (s *StaticZonesProvider) AppendRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (StaticZonesProvider) CaddyModule() caddy.ModuleInfo
- func (s *StaticZonesProvider) DeleteRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (s *StaticZonesProvider) GetRecords(ctx context.Context, zone string) ([]libdns.Record, error)
- func (s *StaticZonesProvider) ListZones(ctx context.Context) ([]libdns.Zone, error)
- func (p *StaticZonesProvider) Provision(ctx caddy.Context) error
- func (s *StaticZonesProvider) SetRecords(ctx context.Context, zone string, recs []libdns.Record) ([]libdns.Record, error)
- func (p *StaticZonesProvider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- type WaitableLocker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ProviderName ¶
Types ¶
type BaseProvider ¶
type BaseProvider interface {
libdns.RecordSetter
libdns.RecordDeleter
libdns.RecordAppender
libdns.RecordGetter
}
type Handler ¶
type Handler struct {
// The provider configurations with which will be used
// to update records incoming reqeust.
ProvidersRaw []json.RawMessage `json:"providers,omitempty" caddy:"namespace=dns.providers inline_key=name"`
// List of trusted remotes which will be used to determine
// the client ip based on x-forwarded-for header
TrustedRemotes *IPPrefixList `json:"trusted_remotes"`
// When true, we only satisfy by a public ip when trying
// to determine the client ip. This means when no ip is
// found, it will try to resolve "this" remote ip
NoLocalIp bool `json:"no_local_ip"`
// Because https://help.dyn.com/return-codes.html specifies
// that we return "badauth" (with status 200) we cannot use
// the basic_auth directive as it will return 401 as expected
// in a normal authentication request.
//
// So a username – password map will be used for authentication
// and when left empty, all requests will be allowed.
//
// At this moment the passwords are stored in plain text. Since
// the dns provider API tokens and keys are also plain text,
// there’s currently no real benefit for adding additional
// hashing or encryption mechanisms.
Users map[string]string `json:"users"`
// contains filtered or unexported fields
}
func (Handler) CaddyModule ¶
func (Handler) CaddyModule() caddy.ModuleInfo
type IPPrefixList ¶
type Provider ¶
type Provider interface {
BaseProvider
libdns.ZoneLister
}
type ReturnCode ¶
type ReturnCode string
const ( Good ReturnCode = "good" NoChange ReturnCode = "nochg" NotFullyQualifiedDomainName ReturnCode = "notfqdn" DNSError ReturnCode = "dnserr" NoHost ReturnCode = "nohost" BadAuthentication ReturnCode = "badauth" )
type StaticZonesProvider ¶
type StaticZonesProvider struct {
ZonesRaw []string `json:"zones,omitempty"`
ProviderRaw json.RawMessage `json:"provider,omitempty" caddy:"namespace=dns.providers inline_key=name"`
// contains filtered or unexported fields
}
func (*StaticZonesProvider) AppendRecords ¶
func (StaticZonesProvider) CaddyModule ¶
func (StaticZonesProvider) CaddyModule() caddy.ModuleInfo
func (*StaticZonesProvider) DeleteRecords ¶
func (*StaticZonesProvider) GetRecords ¶
func (*StaticZonesProvider) Provision ¶
func (p *StaticZonesProvider) Provision(ctx caddy.Context) error
func (*StaticZonesProvider) SetRecords ¶
func (*StaticZonesProvider) UnmarshalCaddyfile ¶
func (p *StaticZonesProvider) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
UnmarshalCaddyfile sets up the Wrapped DNS provider from Caddyfile tokens. Syntax:
ddns.static_zones {
provider <name> ...
zones <zone ...>
}
type WaitableLocker ¶
func NewSemaphore ¶
func NewSemaphore(x int) WaitableLocker
Click to show internal directories.
Click to hide internal directories.