appconfig

package
v0.0.0-...-17b6be2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type AppConfig

type AppConfig struct {
	*viper.Viper
	Config
}

func GetConfig

func GetConfig() *AppConfig

type Config

type Config struct {
	Env    string                  `yaml:"envh"`
	Server ServerConfig            `yaml:"server"`
	DB     map[string]*DbConfig    `yaml:"db"`
	Redis  map[string]*RedisConfig `yaml:"redis"`
}

type DbConfig

type DbConfig struct {
	Type    string `yaml:"type"`
	Dsn     string `yaml:"dsn"`
	MaxIdle int    `yaml:"max-idle"`
	MaxConn int    `yaml:"max-conn"`
	ShowSQL bool   `yaml:"show-sql"`
}

type RedisConfig

type RedisConfig struct {
	Addr     string `yaml:"addr"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
}

type ServerConfig

type ServerConfig struct {
	Listen     string   `yaml:"listen"`
	Template   []string `yaml:"template"`
	Static     string   `yaml:"static"`
	AuthSecret string   `yaml:"auth-secret"`
	Accesslog  string   `yaml:"accesslog"`
}

Jump to

Keyboard shortcuts

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