settings

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: ISC Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZKSIdentityFilename = "brserver.id"
	ZKSCertFilename     = "brserver.crt"
	ZKSKeyFilename      = "brserver.key"
	ZKSRoutedMessages   = "routedmessages"
	ZKSPaidRVs          = "paidrvs"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Settings

type Settings struct {
	// default section
	Root            string        // root directory for brserver
	RoutedMessages  string        // routed messages
	PaidRVs         string        // paid for RVs
	Listen          []string      // listen addresses and port
	InitSessTimeout time.Duration // How long to wait for session on a new connection

	// policy section
	ExpirationDays    int // How many days after which to expire data
	MaxMsgSizeVersion rpc.MaxMsgSizeVersion

	// payment section
	PayScheme           string
	LNRPCHost           string
	LNTLSCert           string
	LNMacaroonPath      string
	MilliAtomsPerByte   uint64
	MilliAtomsPerSub    uint64
	PushPaymentLifetime int // how long a payment to a push is valid
	MaxPushInvoices     int

	// log section
	LogFile    string // log filename
	DebugLevel string // debug level config string
	TimeFormat string // debug file time stamp format
	Profiler   string // go profiler link

	// Postgres config
	PGEnabled         bool
	PGHost            string
	PGPort            string
	PGDBName          string
	PGRoleName        string
	PGPassphrase      string
	PGServerCA        string
	PGIndexTableSpace string
	PGBulkTableSpace  string

	// Versioner is a function that returns the current app version.
	Versioner func() string

	// LogStdOut is the stdout to write the log to. Defaults to os.Stdout.
	LogStdOut io.Writer
}

Settings is the collection of all brserver settings. This is separated out in order to be able to reuse in various tests.

func New

func New() *Settings

New returns a default settings structure.

func (*Settings) Load

func (s *Settings) Load(filename string) error

Load retrieves settings from an ini file. Additionally it expands all ~ to the current user home directory.

Jump to

Keyboard shortcuts

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