rainsd

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StoreConfig

func StoreConfig(config Config, configPath string) error

StoreConfig stores server configuration

Types

type Caches

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

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

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

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

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

	//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 cache.Assertion

	//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 cache.NegativeAssertion
}

type Config

type Config struct {
	//general
	RootZonePublicKeyPath          string
	AssertionCheckPointInterval    time.Duration //in seconds
	NegAssertionCheckPointInterval time.Duration //in seconds
	ZoneKeyCheckPointInterval      time.Duration //in seconds
	CheckPointPath                 string
	PreLoadCaches                  bool

	//switchboard
	ServerAddress      connection.Info
	MaxConnections     int
	KeepAlivePeriod    time.Duration //in seconds
	TCPTimeout         time.Duration //in seconds
	TLSCertificateFile string
	TLSPrivateKeyFile  string

	//inbox
	PrioBufferSize          int
	NormalBufferSize        int
	NotificationBufferSize  int
	PrioWorkerCount         int
	NormalWorkerCount       int
	NotificationWorkerCount int
	CapabilitiesCacheSize   int
	Capabilities            []message.Capability

	//verify
	ZoneKeyCacheSize            int
	ZoneKeyCacheWarnSize        int
	MaxPublicKeysPerZone        int
	PendingKeyCacheSize         int
	DelegationQueryValidity     time.Duration //in seconds
	ReapZoneKeyCacheInterval    time.Duration //in seconds
	ReapPendingKeyCacheInterval time.Duration //in seconds

	//engine
	AssertionCacheSize            int
	NegativeAssertionCacheSize    int
	PendingQueryCacheSize         int
	QueryValidity                 time.Duration //in seconds
	Authorities                   []ZoneContext
	MaxCacheValidity              util.MaxCacheValidity //in hours
	ReapAssertionCacheInterval    time.Duration         //in seconds
	ReapNegAssertionCacheInterval time.Duration         //in seconds
	ReapPendingQCacheInterval     time.Duration         //in seconds
}

Config lists possible configurations of a rains server

func DefaultConfig

func DefaultConfig() Config

DefaultConfig return the default configuration for the zone publisher.

func LoadConfig

func LoadConfig(configPath string) (Config, error)

LoadConfig loads server configuration

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 util.MsgSectionSender
	Normal chan util.MsgSectionSender
	Notify chan util.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(config Config, 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() net.Addr

Addr returns the server's address

func (*Server) Config

func (s *Server) Config() Config

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, id string) error

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

type ZoneContext

type ZoneContext struct {
	Zone    string
	Context string
}

ZoneContext stores a context and a zone

Jump to

Keyboard shortcuts

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