configuration

package
v0.0.0-...-ee9937f Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuthPair

type BasicAuthPair struct {
	Username string `mapstructure:"user"`
	Password string `mapstructure:"pass"`
}

BasicAuthPair pair of username and password

type Configuration

type Configuration struct {
	Addr    string        `mapstructure:"addr"`
	Timeout uint          `mapstructure:"timeout"`
	Auth    BasicAuthPair `mapstructure:"auth"`
	Storage *Storage      `mapstructure:"storage"`
}

Configuration app configuration

func NewConfiguration

func NewConfiguration(configFilePath string) (*Configuration, error)

NewConfiguration reads configuration from file and environment variables

func (*Configuration) PrintConfiguration

func (c *Configuration) PrintConfiguration()

PrintConfiguration prints configuration to stdout

type Storage

type Storage struct {
	URI            string `mapstructure:"uri"`
	DBName         string `mapstructure:"db_name"`
	CollectionName string `mapstructure:"collection_name"`
	Timeout        uint   `mapstructure:"timeout"`
}

Storage configuration of storage

Jump to

Keyboard shortcuts

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