Documentation ¶
Index ¶
- func ParseKeyFile(file string) (*dns.DNSKEY, dns.PrivateKey, error)
- type AddCallbackCommand
- type AddServiceCommand
- type RemoveServiceCommand
- type Server
- func (s *Server) DNSAddr() string
- func (s *Server) HTTPAddr() string
- func (s *Server) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (s *Server) IsLeader() bool
- func (s *Server) Join(members []string) error
- func (s *Server) KeyTag() uint16
- func (s *Server) Leader() string
- func (s *Server) Members() (members []string)
- func (s *Server) PrivateKey() dns.PrivateKey
- func (s *Server) PublicKey() *dns.DNSKEY
- func (s *Server) ServeDNS(w dns.ResponseWriter, req *dns.Msg)
- func (s *Server) ServeDNSForward(w dns.ResponseWriter, req *dns.Msg)
- func (s *Server) SetKeys(k *dns.DNSKEY, p dns.PrivateKey)
- func (s *Server) Start() (*sync.WaitGroup, error)
- func (s *Server) Stop()
- type UpdateTTLCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseKeyFile ¶
ParseKeyFile read a DNSSEC keyfile as generated by dnssec-keygen or other utilities. It add ".key" for the public key and ".private" for the private key.
Types ¶
type AddCallbackCommand ¶
func NewAddCallbackCommand ¶
func NewAddCallbackCommand(s msg.Service, c msg.Callback) *AddCallbackCommand
func (*AddCallbackCommand) Apply ¶
func (c *AddCallbackCommand) Apply(server raft.Server) (interface{}, error)
func (*AddCallbackCommand) CommandName ¶
func (c *AddCallbackCommand) CommandName() string
type AddServiceCommand ¶
Command for adding service to registry
func NewAddServiceCommand ¶
func NewAddServiceCommand(s msg.Service) *AddServiceCommand
Creates a new AddServiceCommand
func (*AddServiceCommand) Apply ¶
func (c *AddServiceCommand) Apply(server raft.Server) (interface{}, error)
Adds service to registry
func (*AddServiceCommand) CommandName ¶
func (c *AddServiceCommand) CommandName() string
Name of command
type RemoveServiceCommand ¶
type RemoveServiceCommand struct {
UUID string
}
func NewRemoveServiceCommand ¶
func NewRemoveServiceCommand(uuid string) *RemoveServiceCommand
Creates a new RemoveServiceCommand
func (*RemoveServiceCommand) Apply ¶
func (c *RemoveServiceCommand) Apply(server raft.Server) (interface{}, error)
Removes service from the registry
func (*RemoveServiceCommand) CommandName ¶
func (c *RemoveServiceCommand) CommandName() string
Name of command
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(members []string, domain string, dnsAddr string, httpAddr string, dataDir string, rt, wt time.Duration, secret string, nameservers []string, roundrobin bool, tlskey string, tlspem string) (s *Server)
Newserver returns a new Server.
func (*Server) HandleFunc ¶
HandleFunc proxies HTTP handlers to Gorilla's mux.Router.
func (*Server) PrivateKey ¶
func (s *Server) PrivateKey() dns.PrivateKey
PrivateKey returns the private key of the server.
func (*Server) ServeDNS ¶
func (s *Server) ServeDNS(w dns.ResponseWriter, req *dns.Msg)
ServeDNS is the handler for DNS requests, responsible for parsing DNS request, possibly forwarding it to a real dns server and returning a response.
func (*Server) ServeDNSForward ¶
func (s *Server) ServeDNSForward(w dns.ResponseWriter, req *dns.Msg)
ServeDNSForward forwards a request to a nameservers and returns the response.
type UpdateTTLCommand ¶
func NewUpdateTTLCommand ¶
func NewUpdateTTLCommand(uuid string, ttl uint32) *UpdateTTLCommand
NewUpdateTTLCommands returns a new UpdateTTLCommand
func (*UpdateTTLCommand) Apply ¶
func (c *UpdateTTLCommand) Apply(server raft.Server) (interface{}, error)
Updates TTL in registry
func (*UpdateTTLCommand) CommandName ¶
func (c *UpdateTTLCommand) CommandName() string
Name of command