config

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2022 License: MIT Imports: 12 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 `short:"c" long:"configfile" description:"Path to configuration file"`
	DataDir         string `short:"b" long:"datadir" description:"The directory to store poet's data 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 `short:"r" long:"rpclisten" description:"The interface/port/socket to listen for RPC connections"`
	RawRESTListener string `short:"w" long:"restlisten" description:"The interface/port/socket to listen for REST connections"`
	RPCListener     net.Addr
	RESTListener    net.Addr
	GtwConnTimeout  time.Duration `long:"gtw-connection-timeout" description:"Timeout for connecting to gateway"`

	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"`

	CoreServiceMode bool `long:"core" description:"Enable poet in core service mode"`

	CoreService *coreServiceConfig `group:"Core Service" namespace:"core"`
	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 values from a conf file.

func SetupConfig

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

SetupConfig initializes filesystem and network infrastructure.

Jump to

Keyboard shortcuts

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