config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init sets up the Viper configuration

Types

type Configuration

type Configuration struct {
	App struct {
		URL string `mapstructure:"url"`
	} `mapstructure:"app"`
	DB struct {
		Prefix   string `mapstructure:"prefix"`
		User     string `mapstructure:"user"`
		Password string `mapstructure:"password"`
		Host     string `mapstructure:"host"`
		Port     int64  `mapstructure:"port"`
		Name     string `mapstructure:"name"`
		Timeout  int64  `mapstructure:"timeout"`
	} `mapstructure:"db"`
	Server struct {
		Port    string `mapstructure:"port"`
		Timeout int64  `mapstructure:"timeout"`
	} `mapstructure:"server"`
	Log struct {
		Debug bool `mapstructure:"debug"`
	} `mapstructure:"log"`
	ShortLink struct {
		APIKey string `mapstructure:"apiKey"`
		Domain string `mapstructure:"domain"`
	} `mapstructure:"shortlink"`
}

Configuration represents the application configuration settings

func Load

func Load(logger log.Logger) (*Configuration, error)

Load attempts to read the app configuration file

func (Configuration) PrettyPrint

func (c Configuration) PrettyPrint()

PrettyPrint outputs a formatted listing of the configuration settings

func (Configuration) String

func (c Configuration) String() string

String displays the configuration settings

Jump to

Keyboard shortcuts

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