config

package
v0.0.0-...-97b5a5e Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address      string        `envconfig:"ADDRESS" default:":8089" required:"true"`
	ReadTimeout  time.Duration `envconfig:"READ_TIMEOUT" default:"5s"`
	WriteTimeout time.Duration `envconfig:"WRITE_TIMEOUT" default:"10s"`
	Debug        bool          `envconfig:"DEBUG" default:"true"`
}

Config application configuration

func FromEnv

func FromEnv(prefix string) (Config, error)

FromEnv load configuration from env vars

type DB

type DB struct {
	DbPath       string `envconfig:"DB_PATH" required:"true"`
	DbConfigPath string `envconfig:"DB_CONFIG_PATH" required:"true"`
	// contains filtered or unexported fields
}

DB represents the application server database (json file)

func NewDatabase

func NewDatabase() (DB, error)

NewDatabase load configuration from env vars

func (*DB) Start

func (d *DB) Start() error

Start starts and initializes the file database

Jump to

Keyboard shortcuts

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