conf

package
v0.9.22 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2017 License: BSD-2-Clause Imports: 7 Imported by: 33

Documentation

Overview

Package conf parses start up args and config file

Index

Constants

View Source
const VERSION string = "[% VERSION %]"

Variables

View Source
var (
	// Admin
	ADMIN_EMAIL string
	ADMIN_USERS string
	AdminUsers  []string

	// Permissions for anonymous user
	ANON_READ   bool
	ANON_WRITE  bool
	ANON_DELETE bool

	// Address
	API_IP   string
	API_PORT int
	API_URL  string // for external address only

	// Auth
	AUTH_BASIC              bool
	AUTH_GLOBUS_TOKEN_URL   string
	AUTH_GLOBUS_PROFILE_URL string
	AUTH_OAUTH_URL_STR      string
	AUTH_OAUTH_BEARER_STR   string
	AUTH_CACHE_TIMEOUT      int
	AUTH_OAUTH              = make(map[string]string)
	OAUTH_DEFAULT           string // first value in AUTH_OAUTH_URL_STR

	// Default Chunksize for size virtual index
	CHUNK_SIZE int64 = 1048576

	// Config File
	CONFIG_FILE string

	// Runtime
	EXPIRE_WAIT   int // wait time for reaper in minutes
	GOMAXPROCS    string
	MAX_REVISIONS int // max number of node revisions to keep; values < 0 mean keep all

	// Logs
	LOG_PERF   bool // Indicates whether performance logs should be stored
	LOG_ROTATE bool // Indicates whether logs should be rotated daily
	LOG_OUTPUT string

	// Mongo information
	MONGODB_HOSTS             string
	MONGODB_DATABASE          string
	MONGODB_USER              string
	MONGODB_PASSWORD          string
	MONGODB_ATTRIBUTE_INDEXES string

	// Node Indices
	NODE_IDXS map[string]idxOpts = nil

	// Paths
	PATH_SITE    string
	PATH_DATA    string
	PATH_LOGS    string
	PATH_LOCAL   string
	PATH_PIDFILE string

	// Reload
	RELOAD string

	// SSL
	SSL      bool
	SSL_KEY  string
	SSL_CERT string

	// Versions
	VERSIONS = make(map[string]int)

	PRINT_HELP   bool // full usage
	SHOW_HELP    bool // simple usage
	SHOW_VERSION bool

	// internal config control
	FAKE_VAR = false
)
View Source
var LOG_OUTPUTS = [3]string{"file", "console", "both"}

Functions

func Bool

func Bool(s string) bool

Bool is a convenience wrapper around strconv.ParseBool

func Initialize

func Initialize() (err error)

Initialize is an explicit init. Enables outside use of shock-server packages. Parses config and populates the conf variables.

func Print

func Print()

Print prints the configuration loads to stdout

Types

type Config_store added in v0.9.22

type Config_store struct {
	Store []*Config_value
	Fs    *flag.FlagSet
	Con   *config.Config
}

func NewCS added in v0.9.22

func NewCS(c *config.Config) *Config_store

func (*Config_store) AddBool added in v0.9.22

func (this *Config_store) AddBool(target *bool,
	default_value bool,
	section string,
	key string,
	descr_short string,
	descr_long string)

func (*Config_store) AddInt added in v0.9.22

func (this *Config_store) AddInt(target *int,
	default_value int,
	section string,
	key string,
	descr_short string,
	descr_long string)

func (*Config_store) AddString added in v0.9.22

func (this *Config_store) AddString(target *string,
	default_value string,
	section string,
	key string,
	descr_short string,
	descr_long string)

func (Config_store) Parse added in v0.9.22

func (this Config_store) Parse()

func (Config_store) PrintHelp added in v0.9.22

func (this Config_store) PrintHelp()

type Config_value added in v0.9.22

type Config_value struct {
	Conf_type string
	Conf_str  *Config_value_string
	Conf_int  *Config_value_int
	Conf_bool *Config_value_bool
}

type Config_value_bool added in v0.9.22

type Config_value_bool struct {
	Target        *bool
	Default_value bool
	Section       string
	Key           string
	Descr_short   string
	Descr_long    string
}

type Config_value_int added in v0.9.22

type Config_value_int struct {
	Target        *int
	Default_value int
	Section       string
	Key           string
	Descr_short   string
	Descr_long    string
}

type Config_value_string added in v0.9.22

type Config_value_string struct {
	Target        *string
	Default_value string
	Section       string
	Key           string
	Descr_short   string
	Descr_long    string
}

Jump to

Keyboard shortcuts

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