config

package
v0.0.0-...-04b3042 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 5 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"`
	GRPCPort    int    `yaml:"grpcPort" validate:"required"`
	MetricsPort int    `yaml:"metricsPort" validate:"required"`
}

type AuthConfig

type AuthConfig struct {
	Username string `yaml:"username" validate:"required"`
	Password string `yaml:"password" validate:"required"`
}

type AzureConfig

type AzureConfig struct {
	SubscriptionKey string `yaml:"subscriptionKey" 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"`
	Azure    *AzureConfig             `yaml:"azure" 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"`
	Debug    *DebugConfig             `yaml:"debug"`
	Swagger  *libconfig.SwaggerConfig `yaml:"swagger" validate:"required"`
}

func LoadConfig

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

type DebugConfig

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

type HTTPServer

type HTTPServer struct {
	Port                 int `yaml:"port" validate:"required"`
	ShutdownTimeSec      int `yaml:"shutdownTimeSec" validate:"gte=1"`
	ReadHeaderTimeoutSec int `yaml:"readHeaderTimeoutSec" validate:"gte=1"`
}

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