Documentation ¶
Overview ¶
Package updater pushes IP address updates to dynamic DNS services.
Index ¶
- func AddIP(a net.IP, b net.IP) net.IP
- func MaskIP(ip net.IP, mask int) net.IP
- func RecordTypeString(rtype RecordType) string
- func SlaacBits(mac net.HardwareAddr) net.IP
- type CloudflareService
- func (s *CloudflareService) Identifier() string
- func (s *CloudflareService) Submit(ctx context.Context, rtype RecordType, ip net.IP) (retryAfter time.Duration, err error)
- func (s *CloudflareService) SupportsRecord(rtype RecordType) bool
- func (s *CloudflareService) UnmarshalYAML(value *yaml.Node) error
- type DuckService
- type IPLookup
- type NoIPService
- type RecordService
- type RecordType
- type Updater
- type Updaters
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecordTypeString ¶
func RecordTypeString(rtype RecordType) string
RecordTypeString returns the string equivalent to a RecordType value.
Types ¶
type CloudflareService ¶
type CloudflareService struct {
// contains filtered or unexported fields
}
CloudflareService implements the Cloudflare DNS protocol.
func (*CloudflareService) Identifier ¶
func (s *CloudflareService) Identifier() string
Identifier returns a human readable name for this service given its endpoint.
func (*CloudflareService) Submit ¶
func (s *CloudflareService) Submit(ctx context.Context, rtype RecordType, ip net.IP) (retryAfter time.Duration, err error)
Submit sends the provided IP address to the dynamic DNS service. In case of failure, it returns a retry delay and the error.
func (*CloudflareService) SupportsRecord ¶
func (s *CloudflareService) SupportsRecord(rtype RecordType) bool
SupportsRecord determines whether this service supports the provided DNS record type.
func (*CloudflareService) UnmarshalYAML ¶
func (s *CloudflareService) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML constructs a service from a YAML configuration.
type DuckService ¶
type DuckService struct {
// contains filtered or unexported fields
}
DuckService implements the Duck DNS protocol.
func (*DuckService) Identifier ¶
func (s *DuckService) Identifier() string
Identifier returns a human readable name for this service given its endpoint.
func (*DuckService) Submit ¶
func (s *DuckService) Submit(ctx context.Context, rtype RecordType, ip net.IP) (retryAfter time.Duration, err error)
Submit sends the provided IP address to the dynamic DNS service. In case of failure, it returns a retry delay and the error.
func (*DuckService) SupportsRecord ¶
func (s *DuckService) SupportsRecord(rtype RecordType) bool
SupportsRecord determines whether this service supports the provided DNS record type.
func (*DuckService) UnmarshalYAML ¶
func (s *DuckService) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML constructs a service from a YAML configuration.
type IPLookup ¶
type IPLookup struct {
// contains filtered or unexported fields
}
IPLookup uses an Internet service to look up the machine's source IP address.
func (IPLookup) WebFacingIP ¶
WebFacingIP looks up the machine's source IP address from the provided network interface.
type NoIPService ¶ added in v1.1.0
type NoIPService struct { DefinedEndpoint string // contains filtered or unexported fields }
NoIPService implements the No-IP protocol. It requires an endpoint.
func (*NoIPService) Identifier ¶ added in v1.1.0
func (s *NoIPService) Identifier() string
Identifier returns a human readable name for this service given its endpoint.
func (*NoIPService) Submit ¶ added in v1.1.0
func (s *NoIPService) Submit(ctx context.Context, rtype RecordType, ip net.IP) (retryAfter time.Duration, err error)
Submit sends the provided IP address to the dynamic DNS service. In case of failure, it returns a retry delay and the error.
func (*NoIPService) SupportsRecord ¶ added in v1.1.0
func (s *NoIPService) SupportsRecord(rtype RecordType) bool
SupportsRecord determines whether this service supports the provided DNS record type.
func (*NoIPService) UnmarshalYAML ¶ added in v1.1.0
func (s *NoIPService) UnmarshalYAML(value *yaml.Node) error
UnmarshalYAML constructs a service from a YAML configuration.
type RecordService ¶
type RecordService interface { // Submit a new record value. Submit(context.Context, RecordType, net.IP) (retryAfter time.Duration, err error) // Retrieve a human-readable name for this record. Identifier() string // Determine support for a record type. SupportsRecord(RecordType) bool yaml.Unmarshaler }
A RecordService manages transactions concerning a particular record with a dynamic DNS service.
type RecordType ¶
type RecordType int
RecordType represents a kind of dynamic DNS record.
const ( // ARecord represents an IPv4 DNS record. ARecord RecordType = iota // AAAARecord represents an IPv6 DNS record. AAAARecord )
type Updater ¶
type Updater struct { Type RecordType Interface string Service RecordService IPOffset net.IP IPMaskBits int yaml.Unmarshaler // contains filtered or unexported fields }
An Updater manages a single DNS record.
func (*Updater) UnmarshalYAML ¶
UnmarshalYAML constructs an updater from a YAML configuration.
type Updaters ¶
type Updaters []*Updater
Updaters represents a slice of updaters defined by a YAML configuration. All updaters share the same IP address lookup cache.
func (*Updaters) UnmarshalYAML ¶
UnmarshalYAML constructs a slice of updaters from a YAML configuration.