Documentation
¶
Index ¶
- 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) Leader() string
- func (s *Server) Members() (members []string)
- func (s *Server) ServeDNS(w dns.ResponseWriter, req *dns.Msg)
- func (s *Server) Start() (*sync.WaitGroup, error)
- func (s *Server) Stop()
- type UpdateTTLCommand
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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)
Updates TTL in 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) (s *Server)
Newserver returns a new Server.
func (*Server) HandleFunc ¶
HandleFunc proxies HTTP handlers to Gorilla's mux.Router.
func (*Server) ServeDNS ¶
func (s *Server) ServeDNS(w dns.ResponseWriter, req *dns.Msg)
Handler for DNS requests, responsible for parsing DNS request and returning 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
Click to show internal directories.
Click to hide internal directories.