Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) AddRecord(record Record) error
- func (c *Client) Close()
- func (c *Client) GetIPv4() string
- func (c *Client) GetIPv6() string
- func (c *Client) GetRecordByFQDNAndType(recordFQDN, recordType string) *Record
- func (c *Client) GetRecordByHash(targetHash string) *Record
- func (c *Client) GetRecordForFQDN(targetFQDN, recordType string) *Record
- func (c *Client) GetRecords() []Record
- func (c *Client) GetZone() string
- func (c *Client) HealthCheck() HealthState
- func (c *Client) RemoveRecord(record Record) error
- type ClientConfig
- type DNSConfig
- type GuardMap
- type HealthState
- type MockClient
- func (m *MockClient) AddRecord(record Record) error
- func (m *MockClient) Close()
- func (m *MockClient) GetIPv4() string
- func (m *MockClient) GetIPv6() string
- func (m *MockClient) GetRecordByFQDNAndType(recordFQDN, recordType string) *Record
- func (m *MockClient) GetRecordByHash(targetHash string) *Record
- func (m *MockClient) GetRecordForFQDN(targetFQDN, recordType string) *Record
- func (m *MockClient) GetRecords() []Record
- func (m *MockClient) GetZone() string
- func (m *MockClient) HealthCheck() HealthState
- func (m *MockClient) RemoveRecord(record Record) error
- type Record
- type RecordGuard
- type RecordGuards
- type ServerConfig
- type Service
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrImmutableRecord = errors.New("attempted to modify an immutable record") ErrNotAuthorized = errors.New("not authorized to perform this action") ErrRecordCreation = errors.New("failed to create record") ErrRecordDeletion = errors.New("failed to delete record") )
View Source
var ErrServerNotReachable = errors.New("server not reachable")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { SyncInterval int HealthCheckInterval int // contains filtered or unexported fields }
func (*Client) GetRecordByFQDNAndType ¶
func (*Client) GetRecordByHash ¶
func (*Client) GetRecordForFQDN ¶
func (*Client) GetRecords ¶
func (*Client) HealthCheck ¶
func (c *Client) HealthCheck() HealthState
func (*Client) RemoveRecord ¶
type ClientConfig ¶
type ClientConfig struct { SyncInterval int HealthCheckInterval int Ipv4 string Ipv6 string Guards RecordGuards }
type DNSConfig ¶
type DNSConfig struct { ServerConfig `mapstructure:"server"` ClientConfig `mapstructure:"client"` }
type GuardMap ¶
type GuardMap struct { Immutable map[RecordGuard]bool AdminOnly map[RecordGuard]bool }
type HealthState ¶
type MockClient ¶
type MockClient struct {
// contains filtered or unexported fields
}
func NewMockClient ¶
func NewMockClient() *MockClient
func NewMockClientWithTestRecords ¶
func NewMockClientWithTestRecords() *MockClient
func (*MockClient) AddRecord ¶
func (m *MockClient) AddRecord(record Record) error
func (*MockClient) Close ¶
func (m *MockClient) Close()
func (*MockClient) GetIPv4 ¶
func (m *MockClient) GetIPv4() string
func (*MockClient) GetIPv6 ¶
func (m *MockClient) GetIPv6() string
func (*MockClient) GetRecordByFQDNAndType ¶
func (m *MockClient) GetRecordByFQDNAndType(recordFQDN, recordType string) *Record
func (*MockClient) GetRecordByHash ¶
func (m *MockClient) GetRecordByHash(targetHash string) *Record
func (*MockClient) GetRecordForFQDN ¶
func (m *MockClient) GetRecordForFQDN(targetFQDN, recordType string) *Record
func (*MockClient) GetRecords ¶
func (m *MockClient) GetRecords() []Record
func (*MockClient) GetZone ¶
func (m *MockClient) GetZone() string
func (*MockClient) HealthCheck ¶
func (m *MockClient) HealthCheck() HealthState
func (*MockClient) RemoveRecord ¶
func (m *MockClient) RemoveRecord(record Record) error
type Record ¶
func NewRecordFromHost ¶
type RecordGuard ¶
func NewRecordGuard ¶
func NewRecordGuard(t, fqdn string) RecordGuard
type RecordGuards ¶
type ServerConfig ¶
type Service ¶
type Service interface { HealthCheck() HealthState GetRecords() []Record AddRecord(Record) error RemoveRecord(Record) error GetRecordByHash(string) *Record GetRecordForFQDN(string, string) *Record GetRecordByFQDNAndType(string, string) *Record GetZone() string GetIPv4() string GetIPv6() string Close() }
Click to show internal directories.
Click to hide internal directories.