config

package
v0.0.0-...-11c8b56 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2018 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config defines the config struct and provides utility methods for querying it. Additionally it handles loading the config.json if present and holds various other global values used in the app.

Index

Constants

This section is empty.

Variables

View Source
var Logger *log.Logger

Functions

func DBName

func DBName() string

DBName will return the appropriate database name

func DBURL

func DBURL() string

DBURL will return the environment variable PRAELATUS_DB if set, otherwise return the default development database url.

func DataDir

func DataDir() string

func LogWriter

func LogWriter() io.Writer

LogWriter will return an io.writer that is created based on environment configuration

func Port

func Port() string

Port will return the port / interfaces for the api to listen on based on the configuration

func SessionURL

func SessionURL() string

SessionURL will get the url to use for redis or file location for boltdb

func WebWorkers

func WebWorkers() int

WebWorkers returns the number of web workers to run for sending http requests from hooks

Types

type AWSConfig

type AWSConfig struct {
	Region  string
	BaseURL *string
}

type Config

type Config struct {
	DBURL        string
	DBName       string
	SessionURL   string
	Port         string
	LogLocations []string
	SessionStore string
	AWS          AWSConfig
}

Config holds much of the configuration for praelatus, if reading from the configuration you should use the helper methods in this package as they do some prequisite processing and return appropriate types.

var Cfg Config

Cfg is the global config variable used in the helper methods of this package

func (Config) String

func (c Config) String() string

Jump to

Keyboard shortcuts

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