conf

package
v0.0.0-...-4080ac7 Latest Latest
Warning

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

Go to latest
Published: May 26, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Verbose *bool  `mapstructure:"verbose" validate:"required"`
	Debug   *bool  `mapstructure:"debug"   validate:"required"`
	Port    string `mapstructure:"port"    validate:"required"`
}

type Config

type Config struct {
	App     AppConfig     `mapstructure:"app"`
	Log     LogConfig     `mapstructure:"log"`
	Storage StorageConfig `mapstructure:"storage"`
}

func InitConfig

func InitConfig() (*Config, error)

func (*Config) Print

func (cfg *Config) Print(log *zap.Logger)

Print prints the configuration.

func (*Config) Validate

func (cfg *Config) Validate() error

Validate validates the configuration.

type LogConfig

type LogConfig struct {
	Path     string `mapstructure:"path"     validate:"required"`
	Filename string `mapstructure:"filename" validate:"required"`
	Debug    *bool  `mapstructure:"debug"    validate:"required"`
}

type StorageConfig

type StorageConfig struct {
	Type     string `mapstructure:"type"`
	Timeout  int    `mapstructure:"timeout"`
	MongoURI string `mapstructure:"mongo_uri"`
}

Jump to

Keyboard shortcuts

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