server

package
v0.0.0-...-46e535a Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2014 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseKeyFile

func ParseKeyFile(file string) (*dns.DNSKEY, dns.PrivateKey, error)

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

type AddCallbackCommand struct {
	Service  msg.Service
	Callback msg.Callback
}

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

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)

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) (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) KeyTag

func (s *Server) KeyTag() uint16

KeyTag returns the keytag of the DNSKEY record of the server.

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

func (s *Server) PrivateKey() dns.PrivateKey

PrivateKey returns the private key of the server.

func (*Server) PublicKey

func (s *Server) PublicKey() *dns.DNSKEY

PublicKey returns the DNSKEY record 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.

func (*Server) SetKeys

func (s *Server) SetKeys(k *dns.DNSKEY, p dns.PrivateKey)

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