configs

package
v0.0.0-...-f89e8b1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: MIT Imports: 6 Imported by: 0

README

/configs

Configuration files in this directory define settings and parameters that control the behavior of the application. These settings may include database connection details, API keys, environment-specific configurations, logging settings, etc.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// LogJsonFormat specify json format
	LogJsonFormat string = "json"
)

Set contains project configs

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name     string `mapstructure:"name"`
	Mode     string `mapstructure:"mode"`
	HTTPPort string `mapstructure:"http_port"`
	// contains filtered or unexported fields
}

AppConfig holds the main app configurations

func NewAppConfig

func NewAppConfig(c *Configurator) *AppConfig

NewAppConfig creates app config

func (*AppConfig) IsDebug

func (ac *AppConfig) IsDebug() bool

IsDebug Check is application running in debug mode

func (*AppConfig) IsProduction

func (ac *AppConfig) IsProduction() bool

IsProduction Check is application running in production mode

func (*AppConfig) OnChanged

func (ac *AppConfig) OnChanged(fn func(ac *AppConfig))

OnChanged register callback

type Configurator

type Configurator struct {
	// contains filtered or unexported fields
}

Configurator dummy

func NewConfigurator

func NewConfigurator() *Configurator

NewConfigurator create new Configurator

func (*Configurator) Register

func (c *Configurator) Register(name string, fn func())

Register watcher

func (*Configurator) Watch

func (c *Configurator) Watch()

Watch config

type LoggerConfig

type LoggerConfig struct {
	Level  string `mapstructure:"level"`
	Format string `mapstructure:"format"`
}

LoggerConfig holds logger configurations

func NewLoggerConfig

func NewLoggerConfig(c *Configurator) *LoggerConfig

NewLoggerConfig create logger config

type ProfilerConfig

type ProfilerConfig struct {
	API string `mapstructure:"api"`
}

ProfilerConfig holds profiler configurations

func NewProfilerConfig

func NewProfilerConfig(c *Configurator) *ProfilerConfig

NewProfilerConfig create profiler config

Jump to

Keyboard shortcuts

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