config

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ServiceName contains a service name prefix which used in ENV variables
	ServiceName = "BackFriend"

	APIVersion = "v1alpha"

	// StubDriver defines driver name for testing
	StubDriver = "stub"

	// MockDriver defines driver name for testing
	MockDriver = "mock"

	// JSONDriver defines driver name for JSON files DB
	JSONDriver = "json"

	// PGDriver defines driver name for PostgreSQL DB
	PGDriver = "postgresql"
)

Default values: host, port, etc

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Local service host
	LocalHost string `split_words:"true"`
	// Local service port
	LocalPort int `split_words:"true"`
	// Logging level in logger.Level notation
	LogLevel logger.Level `split_words:"true"`
	// Database type
	DbType string `split_words:"true"`
	// Database files location
	DbLocation string `split_words:"true"`
	// Database host
	DbHost string `split_words:"true"`
	// Database port
	DbPort int `split_words:"true"`
	// Database name
	DbName string `split_words:"true"`
	// Database username
	DbUsername string `split_words:"true"`
	// Database password
	DbPassword string `split_words:"true"`
}

Config - Service configuration

func New

func New() *Config

New - returns new config record initialized with default values

func (*Config) LoadFromEnv

func (config *Config) LoadFromEnv() error

LoadFromEnv load configuration parameters from environment

Jump to

Keyboard shortcuts

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