relaycfg

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package relaycfg describes the configuration file format and data types used by wireleap-relay.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type C

type C struct {
	// Address is the wireleap:// listening address.
	Address *string `json:"address,omitempty"`
	// AutoSubmitInterval is the retry interval for autosubmission.
	// Autosubmission is disabled if it is 0.
	AutoSubmitInterval duration.T `json:"auto_submit_interval,omitempty"`
	// ArchiveDir is the path of the archived sharetoken store directory.
	ArchiveDir *string `json:"archive_dir,omitempty"`
	// MaxTime is the maximum time for a single connection.
	MaxTime duration.T `json:"maxtime,omitempty"`
	// Timeout is the dial timeout.
	Timeout duration.T `json:"timeout,omitempty"`
	// BufSize is the size in bytes of transmit/receive buffers.
	BufSize int `json:"bufsize,omitempty"`
	// NetUsage is the allocated bandwith per time period.
	// NetUsage is disabled if UsageCap.Duration is 0.
	NetUsage NetUsage `json:"network_usage,omitempty"`
	// Contracts is the map of service contracts used by this wireleap-relay.
	Contracts map[texturl.URL]*relayentry.T `json:"contracts,omitempty"`
	// AutoUpgrade sets whether this relay should attempt auto-upgrades.
	AutoUpgrade bool `json:"auto_upgrade,omitempty"`
	// Those are expert settings. Take care.
	DangerZone DangerZone `json:"danger_zone,omitempty"`
}

C is the type of the config struct describing the config file format.

func Defaults

func Defaults() C

Defaults provides a config with sane defaults whenever possible.

func (*C) Validate

func (c *C) Validate() error

Validate validates the config. It can change between wireleap-relay releases.

type DangerZone

type DangerZone struct {
	AllowLoopback bool `json:"allow_loopback,omitempty"`
}

type NetUsage added in v0.6.0

type NetUsage struct {
	// Duration defines the time period.
	Timeframe duration.T `json:"timeframe"`
	// GlobaLimit is disabled if it is 0.
	GlobalLimit datasize.ByteSize `json:"global_limit"`
	// WriteInterval defines how often the metrics are stored on disk
	WriteInterval *duration.T `json:"write_interval"`
	// ArchiveDir is the path of the archived statistics directory.
	ArchiveDir *string `json:"archive_dir,omitempty"`
}

Network usage soft-cap Soft-cap per contract defined in relayentry.T

Jump to

Keyboard shortcuts

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