config

package
v0.0.0-...-b01a591 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2022 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package config contains application config code

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Port     int      `mapstructure:"port"`
	LogLevel string   `mapstructure:"logLevel"`
	Db       DbConfig `mapstructure:"db"`
}

AppConfig root app config

func NewConfig

func NewConfig(logger logger.Logger, fn OnConfigChange) *AppConfig

NewConfig loads new config or run panic on error

func (*AppConfig) PrintConfig

func (cfg *AppConfig) PrintConfig(log logger.Logger)

PrintConfig returns print current config into log output

type DbConfig

type DbConfig struct {
	Type             string `mapstructure:"type"`
	ConnectionString string `mapstructure:"connectionString"`
}

DbConfig service database configuration

type OnConfigChange

type OnConfigChange func(*AppConfig)

OnConfigChange callback for config changes

Jump to

Keyboard shortcuts

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