settings

package
v0.0.0-...-ea08b5a Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2017 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package settings handles the BitMonster settings.

Index

Constants

View Source
const (
	ENVPrefix = "BM"

	// The socket types
	SocketTypeTCP  = "tcp"
	SocketTypeUnix = "unix"
)

Variables

View Source
var (
	// Create the initial settings value with default values.
	Settings = settings{
		AutoCatchInterrupts: true,

		ListenAddress: ":9000",
		SocketType:    SocketTypeTCP,

		DBAddress: "localhost:28015",
		DBName:    "test",
		DBAuthKey: "",
		DBMaxIdle: 50,
		DBMaxOpen: 50,
		DBTimeout: time.Minute,

		AuthHashKey:       defaultAuthHashKey,
		AuthBlockKey:      defaultAuthBlockKey,
		AuthSessionMaxAge: 60 * 60 * 24 * 14,
	}
)

Functions

func Load

func Load(path string) error

Load the settings from a settings file.

func LoadFromENV

func LoadFromENV() error

LoadFromENV loads the settings from the environment variables.

func Prepare

func Prepare() error

Prepare the settings and validate them.

Types

type FileServer

type FileServer map[string]string

Jump to

Keyboard shortcuts

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