config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package config describes the configuration of the beacon server.

Index

Constants

View Source
const (
	// DefaultKeepaliveInterval is the default interval between sending
	// interface keepalives.
	DefaultKeepaliveInterval = time.Second
	// DefaultKeepaliveTimeout is the timeout indicating how long an interface
	// can receive no keepalive default until it is considered expired.
	DefaultKeepaliveTimeout = 3 * time.Second
	// DefaultOriginationInterval is the default interval between originating
	// beacons in a core BS.
	DefaultOriginationInterval = 5 * time.Second
	// DefaultPropagationInterval is the default interval between propagating beacons.
	DefaultPropagationInterval = 5 * time.Second
	// DefaultRegistrationInterval is the default interval between registering segments.
	DefaultRegistrationInterval = 5 * time.Second
	// DefaultExpiredCheckInterval is the default interval between checking for
	// expired interfaces.
	DefaultExpiredCheckInterval = 200 * time.Millisecond
	// DefaultRevTTL is the default revocation TTL.
	DefaultRevTTL = path_mgmt.MinRevTTL
	// DefaultRevOverlap specifies the default for how long before the expiry of an existing
	// revocation the revoker can reissue a new revocation.
	DefaultRevOverlap = DefaultRevTTL / 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BSConfig

type BSConfig struct {
	// KeepaliveInterval is the interval between sending interface keepalives.
	KeepaliveInterval util.DurWrap
	// KeepaliveTimeout is the timeout indicating how long an interface can
	// receive no keepalive until it is considered expired.
	KeepaliveTimeout util.DurWrap
	// OriginationInterval is the interval between originating beacons in a core BS.
	OriginationInterval util.DurWrap
	// PropagationInterval is the interval between propagating beacons.
	PropagationInterval util.DurWrap
	// RegistrationInterval is the interval between registering segments.
	RegistrationInterval util.DurWrap
	// ExpiredCheckInterval is the interval between checking whether interfaces
	// have expired and should be revoked.
	ExpiredCheckInterval util.DurWrap
	// RevTTL is the revocation TTL. (default 10s)
	RevTTL util.DurWrap
	// RevOverlap specifies for how long before the expiry of an existing revocation the revoker
	// can reissue a new revocation. (default 5s)
	RevOverlap util.DurWrap
	// Policies contains the policy files.
	Policies Policies
}

BSConfig holds the configuration specific to the beacon server.

func (*BSConfig) ConfigName

func (cfg *BSConfig) ConfigName() string

ConfigName is the toml key for the beacon server specific configuration.

func (*BSConfig) InitDefaults

func (cfg *BSConfig) InitDefaults()

InitDefaults the default values for the durations that are equal to zero.

func (*BSConfig) Sample

func (cfg *BSConfig) Sample(dst io.Writer, path config.Path, ctx config.CtxMap)

Sample generates a sample for the beacon server specific configuration.

func (*BSConfig) Validate

func (cfg *BSConfig) Validate() error

Validate validates that all durations are set.

type Config

type Config struct {
	General        env.General
	Features       env.Features
	Logging        env.Logging
	Metrics        env.Metrics
	Tracing        env.Tracing
	QUIC           env.QUIC `toml:"quic"`
	TrustDB        truststorage.TrustDBConf
	BeaconDB       beaconstorage.BeaconDBConf
	Discovery      idiscovery.Config
	BS             BSConfig
	EnableQUICTest bool
}

Config is the beacon server configuration.

func (*Config) ConfigName

func (cfg *Config) ConfigName() string

ConfigName is the toml key.

func (*Config) InitDefaults

func (cfg *Config) InitDefaults()

InitDefaults initializes the default values for all parts of the config.

func (*Config) Sample

func (cfg *Config) Sample(dst io.Writer, path config.Path, _ config.CtxMap)

Sample generates a sample config file for the beacon server.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates all parts of the config.

type Policies

type Policies struct {
	config.NoDefaulter
	config.NoValidator
	// Propagation contains the file path for the propagation policy. If this
	// is the empty string, the default policy is used.
	Propagation string
	// CoreRegistration contains the file path for the core registration
	// policy. If this is the empty string, the default policy is used. In a
	// non-core beacon server, this field is ignored.
	CoreRegistration string
	// UpRegistration contains the file path for the up registration policy. If
	// this is the empty string, the default policy is used. In a core beacon
	// server, this field is ignored.
	UpRegistration string
	// DownRegistration contains the file path for the down registration policy.
	// If this is the empty string, the default policy is used. In a core beacon
	// server, this field is ignored.
	DownRegistration string
	// HiddenPathRegistration contains the file path for the hidden path registration policy
	// and the corresponding hidden path groups.
	// If this is the empty string, no hidden path functionality is used.
	HiddenPathRegistration string
}

Policies contains the file paths of the policies.

func (*Policies) ConfigName

func (cfg *Policies) ConfigName() string

ConfigName is the toml key for the beacon server specific configuration.

func (*Policies) Sample

func (cfg *Policies) Sample(dst io.Writer, _ config.Path, _ config.CtxMap)

Sample generates a sample for the beacon server specific configuration.

Jump to

Keyboard shortcuts

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