config

package
v0.0.0-...-624ef01 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2018 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// File specifies a file from which to read the config
	// If empty, config will be read from the environment
	File string
)

Functions

func IsMissingConfig

func IsMissingConfig(err error) bool

IsMissingConfig returns true if the the error has to do with missing required configs

Types

type Config

type Config struct {
	Debug bool `envconfig:"debug" json:"debug"`

	DisableWebsocket bool `envconfig:"noweb" json:"noweb"`
	DisableTCP       bool `envconfig:"notcp" default:"true" json:"notcp"`
	WebsocketPort    int  `envconfig:"wsport" default:"8080" json:"wsport"`
	StratumPort      int  `envconfig:"strport" default:"1111" json:"strport"`

	SecureWebsocket bool   `envconfig:"wss" json:"wss"`
	CertFile        string `envconfig:"tlscert" json:"tlscert"`
	KeyFile         string `envconfig:"tlskey" json:"tlskey"`

	// TODO multiple pools for fallback
	PoolAddr     string `envconfig:"url" required:"true" json:"url"`
	PoolLogin    string `envconfig:"login" required:"true" json:"login"`
	PoolPassword string `envconfig:"password" required:"true" json:"password"`

	StatInterval int `envconfig:"stats" default:"60" json:"stats"`

	ShareValidation int `envconfig:"validateshares" json:"validateshares" default:"2"`

	DonateLevel int `envconfig:"donate" default:"2" json:"donate"`

	// LogFile and DiscardLog are mutually exclusive - logfile will be used if present
	LogFile    string `envconfig:"log" json:"log"`
	DiscardLog bool   `envconfig:"nolog" json:"nolog"`

	// not yet implemented
	Background bool `envconfig:"background" json:"background"`
}

Config holds the global application configuration.

func Get

func Get() *Config

Get returns the global configuration singleton.

Jump to

Keyboard shortcuts

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