config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// B represents 1 byte.
	B byteSize = 1

	// KiB is the number of bytes in 1 kibibyte.
	KiB = 1 << (10 * iota)
	// MiB is the number of bytes in 1 mebibyte.
	MiB
	// GiB is the number of bytes in 1 gibibyte.
	GiB
	// TiB is the number of bytes in 1 tebibyte.
	TiB
	// PiB is the number of bytes in 1 pebibyte.
	PiB

	// KB is the number of bytes in 1 kilobyte.
	KB byteSize = 1e3
	// MB is the number of bytes in 1 megabyte.
	MB byteSize = 1e6
	// GB is the number of bytes in 1 gigabyte.
	GB byteSize = 1e9
	// TB is the number of bytes in 1 terabyte.
	TB byteSize = 1e12
	// PB is the number of bytes in 1 petabyte.
	PB byteSize = 1e15
	// EB is the number of bytes in 1 exabyte.
	EB byteSize = 1e18
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Host        string          `toml:"host"`
	Domain      string          `toml:"domain"`
	TLSPort     int             `toml:"tls_port"`
	TLSCertPath string          `toml:"tls_cert"`
	TLSKeyPath  string          `toml:"tls_key"`
	Status      APIStatusConfig `toml:"status"`
}

APIConfig represents the web API configuration.

type APIStatusConfig

type APIStatusConfig struct {
	Path string `toml:"url_path"`
}

APIStatusConfig represents the web API configuration specific to the status page.

type Config

type Config struct {
	API     APIConfig     `toml:"api"`
	HTTPRcv HTTPRcvConfig `toml:"http_receiver"`
	DNSRcv  DNSRcvConfig  `toml:"dns_receiver"`
	Strg    StorageConfig `toml:"storage"`
}

Config represents BOAST's configuration. It contains the structs for each configuration section and is used to unmarshal the TOML configuration file.

type DNSRcvConfig

type DNSRcvConfig struct {
	Domain   string   `toml:"domain"`
	Host     string   `toml:"host"`
	Ports    []int    `toml:"ports"`
	PublicIP string   `toml:"public_ip"`
	Txt      []string `toml:"txt"`
}

DNSRcvConfig represents the DNS protocol receiver configuration.

type ExpireConfig

type ExpireConfig struct {
	TTL           duration `toml:"ttl"`
	CheckInterval duration `toml:"check_interval"`
	MaxRestarts   int      `toml:"max_restarts"`
}

ExpireConfig represents the storage configurations specific to its expiration feature.

type HTTPRcvConfig

type HTTPRcvConfig struct {
	Host     string           `toml:"host"`
	Ports    []int            `toml:"ports"`
	TLS      HTTPRcvConfigTLS `toml:"tls"`
	IPHeader string           `toml:"real_ip_header"`
}

HTTPRcvConfig represents the HTTP protocol receiver configuration.

type HTTPRcvConfigTLS

type HTTPRcvConfigTLS struct {
	Ports    []int  `toml:"ports"`
	CertPath string `toml:"cert"`
	KeyPath  string `toml:"key"`
}

HTTPRcvConfigTLS represents the HTTP protocol receiver configuration specific to its TLS functionalities.

type StorageConfig

type StorageConfig struct {
	MaxEvents       int          `toml:"max_events"`
	MaxEventsByTest int          `toml:"max_events_by_test"`
	MaxDumpSize     byteSize     `toml:"max_dump_size"`
	HMACKey         hmacKey      `toml:"hmac_key"`
	Expire          ExpireConfig `toml:"expire"`
}

StorageConfig represents the storage configuration.

Jump to

Keyboard shortcuts

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