config

package
v0.0.0-...-d777a83 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(confPath string) error

Init init config

Types

type AppConfig

type AppConfig struct {
	Name      string `json:"name"`
	RunMode   string `json:"run_mode"`
	Addr      string `json:"addr"`
	JwtSecret string `json:"jwt_secret"`
	// JWTExpirationTime day
	JwtExpirationTime int `json:"jwt_expiration_time"`
}

AppConfig ...

type Config

type Config struct {
	// common
	App   AppConfig   `json:"app"`
	DB    DBConfig    `json:"db"`
	Redis RedisConfig `json:"redis"`
}

Config global config include common and biz config

var (
	// Conf ...
	Conf *Config
)

type DBConfig

type DBConfig struct {
	Uri             string `json:"uri"`
	MaxIdleConn     int    `json:"max_idel_conn"`
	MaxOpenConn     int    `json:"max_open_conn"`
	ConnMaxLifeTime int    `json:"conn_max_lifetime"`
}

type RedisConfig

type RedisConfig struct {
	Uri          string `json:"uri"`
	DialTimeout  int    `json:"dial_timeout"`
	ReadTimeout  int    `json:"read_timeout"`
	WriteTimeout int    `json:"write_timeout"`
	PoolSize     int    `json:"pool_size"`
}

Jump to

Keyboard shortcuts

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