config

package
v0.0.0-...-df3562f Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 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 {
	Name                 string `yaml:"name" validate:"required"`
	HTTPPort             int    `yaml:"httpPort" validate:"required"`
	MetricsPort          int    `yaml:"metricsPort" validate:"required"`
	ReadHeaderTimeoutSec int    `yaml:"readHeaderTimeoutSec" validate:"gte=1"`
}

type Config

type Config struct {
	App          *AppConfig                 `yaml:"app" validate:"required"`
	InternalAuth *InternalAuthConfig        `yaml:"internalAuth" validate:"required"`
	DB           *rslibconfig.DBConfig      `yaml:"db" validate:"required"`
	TTS          *GoogleTextToSpeechConfig  `yaml:"googleTextToSpeech" validate:"required"`
	Trace        *rslibconfig.TraceConfig   `yaml:"trace" validate:"required"`
	CORS         *rslibconfig.CORSConfig    `yaml:"cors" validate:"required"`
	Shutdown     *ShutdownConfig            `yaml:"shutdown" validate:"required"`
	Log          *rslibconfig.LogConfig     `yaml:"log" validate:"required"`
	Swagger      *rslibconfig.SwaggerConfig `yaml:"swagger" validate:"required"`
	Debug        *libconfig.DebugConfig     `yaml:"debug"`
}

func LoadConfig

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

type GoogleTextToSpeechConfig

type GoogleTextToSpeechConfig struct {
	APIKey        string `yaml:"apiKey" validate:"required"`
	APITimeoutSec int    `yaml:"apiTimeoutSec" validate:"gte=5"`
}

type InternalAuthConfig

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

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