config

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2023 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 Config

type Config struct {
	PoetDir         string  `long:"poetdir"        description:"The base directory that contains poet's data, logs, configuration file, etc."`
	ConfigFile      string  `long:"configfile"     description:"Path to configuration file"                                                   short:"c"`
	DataDir         string  `long:"datadir"        description:"The directory to store poet's data within."                                   short:"b"`
	DbDir           string  `long:"dbdir"          description:"The directory to store DBs within"`
	LogDir          string  `long:"logdir"         description:"Directory to log output."`
	DebugLog        bool    `long:"debuglog"       description:"Enable debug logs"`
	JSONLog         bool    `long:"jsonlog"        description:"Whether to log in JSON format"`
	MaxLogFiles     int     `long:"maxlogfiles"    description:"Maximum logfiles to keep (0 for no rotation)"`
	MaxLogFileSize  int     `long:"maxlogfilesize" description:"Maximum logfile size in MB"`
	RawRPCListener  string  `long:"rpclisten"      description:"The interface/port/socket to listen for RPC connections"                      short:"r"`
	RawRESTListener string  `long:"restlisten"     description:"The interface/port/socket to listen for REST connections"                     short:"w"`
	MetricsPort     *uint16 `long:"metrics-port"   description:"The port to expose metrics"`

	CPUProfile string `long:"cpuprofile" description:"Write CPU profile to the specified file"`
	Profile    string `long:"profile"    description:"Enable HTTP profiling on given port -- must be between 1024 and 65535"`

	Service *service.Config `group:"Service"`
}

Config defines the configuration options for poet.

See loadConfig for further details regarding the configuration loading+parsing process.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with default hardcoded values.

func ParseFlags

func ParseFlags(preCfg *Config) (*Config, error)

ParseFlags reads values from command line arguments.

func ReadConfigFile

func ReadConfigFile(cfg *Config) (*Config, error)

ReadConfigFile reads config from an ini file. It uses the provided `cfg` as a base config and overrides it with the values from the config file.

func SetupConfig

func SetupConfig(cfg *Config) (*Config, error)

SetupConfig expands paths and initializes filesystem.

Jump to

Keyboard shortcuts

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