config

package
v0.0.0-...-7c0796b Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServerConfig

type ServerConfig struct {
	// IsGrpc on true, use grpc and don't use HTTP
	// Restore on true, loads db from file on start
	// StoreInterval interval in seconds of saving metrics to disk. use 0 to write immediately
	// FileStorage absolute path to json file for db to be saved into. on omission, don't write
	// PayloadSignatureKey used to check authenticity and to sign response hashes
	// TrustedSubnet is a single ip subnet that allowed to make requests in CIDR format
	IsGrpc              bool
	Restore             bool
	StoreInterval       int
	Addr                string
	DBDsn               string
	FileStorage         string
	PayloadSignatureKey string
	PrivateKeyFilePath  string
	TrustedSubnet       *net.IPNet
}

ServerConfig is used to tune server behaviour

func New

func New() *ServerConfig

New gets config from these places, each overwriting the previous one - config file (path taken from CONFIG env var or -config flag) - cli flags - env vars

Jump to

Keyboard shortcuts

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