rainsd

package
v0.0.0-...-682d07f Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2018 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Caches

type Caches struct {
	//connCache stores connections of this server. It is not guaranteed that a returned connection is still active.
	ConnCache connectionCache

	//capabilities stores known hashes of capabilities and for each connInfo what capability the communication partner has.
	Capabilities capabilityCache

	//zoneKeyCache is used to store public keys of zones and a pointer to assertions containing them.
	ZoneKeyCache zonePublicKeyCache

	//pendingSignatures contains all sections that are waiting for a delegation query to arrive such that their signatures can be verified.
	PendingKeys pendingKeyCache

	//pendingQueries contains a mapping from all self issued pending queries to the set of message bodies waiting for it.
	PendingQueries pendingQueryCache

	//assertionCache contains a set of valid assertions where some of them might be expired.
	//An entry is marked as extrenal if it might be evicted by a LRU caching strategy.
	AssertionsCache assertionCache

	//negAssertionCache contains for each zone and context an interval tree to find all shards and zones containing a specific assertion
	//for a zone the range is infinit: range "",""
	//for a shard the range is given as declared in the section.
	//An entry is marked as extrenal if it might be evicted by a LRU caching strategy.
	NegAssertionCache negativeAssertionCache
}

type InputQueues

type InputQueues struct {
	//incoming messages are buffered in one of these channels until they get processed by a worker
	//go routine the prioChannel only contains incoming sections in response to a delegation query
	//issued by this server.
	Prio   chan msgSectionSender
	Normal chan msgSectionSender
	Notify chan msgSectionSender

	//These channels limit the number of go routines working on the different queues to avoid memory
	//exhaustion.
	PrioW   chan struct{}
	NormalW chan struct{}
	NotifyW chan struct{}
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server represents a rainsd server instance.

func New

func New(configPath string, id string) (server *Server, err error)

New returns a pointer to a newly created rainsd server instance with the given config. The server logs with the provided level of logging.

func (*Server) Addr

func (s *Server) Addr() connection.Info

Addr returns the server's address

func (*Server) SetRecursiveResolver

func (s *Server) SetRecursiveResolver(write func(connection.Message))

SetRecursiveResolver adds a channel which handles recursive lookups for this server

func (*Server) SetResolver

func (s *Server) SetResolver(resolver *libresolve.Resolver)

SetResolver adds a resolver which can forward or recursively resolve queries for this server

func (*Server) Shutdown

func (s *Server) Shutdown()

Shutdown closes the input channels and stops the function creating new go routines to handle the input. Already running worker go routines will finish eventually.

func (*Server) Start

func (s *Server) Start(monitorResources bool) error

Start starts up the server and it begins to listen for incoming connections according to its config.

func (*Server) Write

func (s *Server) Write(msg connection.Message)

Write delivers an encoded rains message and a response inputChannel to the server.

type Tracer

type Tracer struct {
	// contains filtered or unexported fields
}

Tracer implements functionality to send metrics to the logging server.

func NewTracer

func NewTracer(serverID, addr string) (*Tracer, error)

NewTracer creates a new instance of a tracer and performs a handshake with the server. To use the tracer the client must run SendLoop() and then call SendMessage().

func (*Tracer) SendLoop

func (t *Tracer) SendLoop()

SendLoop waits for and sends messages to the remote logging server.

func (*Tracer) SendMessage

func (t *Tracer) SendMessage(token token.Token, message string)

SendMessage places a message in the buffer to be sent asynchronously.

Jump to

Keyboard shortcuts

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