Documentation ¶
Index ¶
- Constants
- func LBAnswer(records []*Record, getRecord SelectRecord, domain string) func(loadBalancer LoadBalancing) GetAnswer
- type Config
- type DNSClient
- type DefaultHealthCheck
- type DoNothingHealthCheck
- type Domain
- type GetAnswer
- type HealthCheck
- type HealthCheckConfig
- type HealthCheckMethod
- type HttpCheckClient
- type IP
- type LoadBalancing
- type Record
- type RelayDNSCLient
- type SelectRecord
- type ServeDNS
Constants ¶
View Source
const WILD_CARD string = "*"
Variables ¶
This section is empty.
Functions ¶
func LBAnswer ¶
func LBAnswer(records []*Record, getRecord SelectRecord, domain string) func(loadBalancer LoadBalancing) GetAnswer
LBAnswer Given ips and ttl configuration, return a Get Answer func
Types ¶
type Config ¶
type DNSClient ¶
type DNSClient interface {
Exchange(m *dns.Msg, address string) (r *dns.Msg, rtt time.Duration, err error)
}
DNSClient An interface of dns client
type DefaultHealthCheck ¶
type DefaultHealthCheck struct { EndPoints []IP Frequency time.Duration CheckHealth HealthCheckMethod SleepFunc sleep // contains filtered or unexported fields }
func (*DefaultHealthCheck) Receive ¶
func (hk *DefaultHealthCheck) Receive() []IP
type DoNothingHealthCheck ¶
type DoNothingHealthCheck struct {
// contains filtered or unexported fields
}
func (*DoNothingHealthCheck) Start ¶
func (hk *DoNothingHealthCheck) Start()
Start empty start method
type HealthCheck ¶
type HealthCheck interface { Start() Receive() []IP }
type HealthCheckConfig ¶
type HealthCheckConfig struct { Type string `json:"type"` PORT int `json:"port"` HTTPS bool `json:"https"` SkipSSL bool `json:"skip_ssl"` PATH string `json:"path"` HTTPStatusCode int `json:"http_status_code"` Fequency string `json:"frequency"` }
HealthCheckConfig Config for health check
type HealthCheckMethod ¶
func Layer4HealthCheck ¶
func Layer4HealthCheck(port int) HealthCheckMethod
func Layer7HealthCheck ¶
func Layer7HealthCheck(check HttpCheckClient, schema string, path string, statusCode int) HealthCheckMethod
type Record ¶
type Record struct { Name string `json:"name"` IPs []IP `json:"ips"` TTL int `json:"ttl"` HealthCheckConfig HealthCheckConfig `json:"health_check"` HealthCheck HealthCheck }
func DefaultSelectRecord ¶
func (*Record) UnmarshalJSON ¶
UnmarshalJSON Record parsing the data
type RelayDNSCLient ¶
type RelayDNSCLient struct {
Client DNSClient
}
RelayDNSClient A client to relay dns request to another DNS server
func (*RelayDNSCLient) RelayAnswer ¶
func (c *RelayDNSCLient) RelayAnswer(server string) GetAnswer
type SelectRecord ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.