config

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Secret string           `yaml:"Secret"`
	Web    WebConfiguration `yaml:"Web"`
	DB     DBConfiguration  `yaml:"DB"`
}

Configuration holds all the configuration that applies to the shortener application.

func LoadGlobal

func LoadGlobal(filename string) (*Configuration, error)

LoadGlobal loads the configuration from file and env variables.

type DBConfiguration

type DBConfiguration struct {
	Driver   string `yaml:"Driver" required:"true"`
	URL      string `yaml:"URL" required:"true"`
	IDLength int    `yaml:"IDLength" required:"true"`
}

DBConfiguration holds information about database, database driver and connection params

type WebConfiguration

type WebConfiguration struct {
	ListenAddr string `yaml:"ListenAddr`
	BaseURL    string `yaml:"BaseURL"`
	Debug      bool   `yaml:"debug"`
	Redirect   string `yaml:"404Redirect"`
}

WebConfiguration keeps information for our WebService

Jump to

Keyboard shortcuts

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