server

package
v0.0.0-...-1f78904 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2013 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddServiceCommand

type AddServiceCommand struct {
	Service msg.Service
}

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) DNSAddr

func (s *Server) DNSAddr() string

DNSAddr returns IP:Port of a DNS Server.

func (*Server) HTTPAddr

func (s *Server) HTTPAddr() string

HTTPAddr returns IP:Port of HTTP Server.

func (*Server) HandleFunc

func (s *Server) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))

HandleFunc proxies HTTP handlers to Gorilla's mux.Router.

func (*Server) IsLeader

func (s *Server) IsLeader() bool

IsLeader returns true if this instance the current leader.

func (*Server) Join

func (s *Server) Join(members []string) error

Join joins an existing SkyDNS cluster.

func (*Server) Leader

func (s *Server) Leader() string

Leader returns the current leader.

func (*Server) Members

func (s *Server) Members() (members []string)

Members returns the current members.

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.

func (*Server) Start

func (s *Server) Start() (*sync.WaitGroup, error)

Start starts a DNS server and blocks waiting to be killed.

func (*Server) Stop

func (s *Server) Stop()

Stop stops a server.

type UpdateTTLCommand

type UpdateTTLCommand struct {
	UUID    string
	TTL     uint32
	Expires time.Time
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL