config

package
v0.0.0-...-e7290c6 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: MIT Imports: 6 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 {
	Name        string `yaml:"name" validate:"required"`
	HTTPPort    int    `yaml:"httpPort" validate:"required"`
	MetricsPort int    `yaml:"metricsPort" validate:"required"`
}

type Config

type Config struct {
	App *AppConfig          `yaml:"app" validate:"required"`
	DB  *libconfig.DBConfig `yaml:"db" validate:"required"`
	// Auth     *AuthConfig              `yaml:"auth" validate:"required"`
	Trace    *libconfig.TraceConfig   `yaml:"trace" validate:"required"`
	CORS     *libconfig.CORSConfig    `yaml:"cors" validate:"required"`
	Shutdown *ShutdownConfig          `yaml:"shutdown" validate:"required"`
	Log      *libconfig.LogConfig     `yaml:"log" validate:"required"`
	Swagger  *libconfig.SwaggerConfig `yaml:"swagger" validate:"required"`
	Debug    *DebugConfig             `yaml:"debug"`
}

func LoadConfig

func LoadConfig(env string) (*Config, error)

type DebugConfig

type DebugConfig struct {
	GinMode bool `yaml:"ginMode"`
	Wait    bool `yaml:"wait"`
}

type ShutdownConfig

type ShutdownConfig struct {
	TimeSec1 int `yaml:"timeSec1" validate:"gte=1"`
	TimeSec2 int `yaml:"timeSec2" validate:"gte=1"`
}

Jump to

Keyboard shortcuts

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