config

package
v0.0.0-...-516af6b Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server ServerConfig
	DB     DBConfig
	Redis  RedisConfig
	Cookie CookieConfig
	Logger Logger
}

func LoadConfig

func LoadConfig(path string, name string) (*Config, error)

type CookieConfig

type CookieConfig struct {
	AccessToken  TokenConfig `mapstructure:"access_token"`
	RefreshToken TokenConfig `mapstructure:"refresh_token"`
}

type DBConfig

type DBConfig struct {
	Driver   string
	Host     string
	Port     int
	User     string
	Password string
	Name     string
	SSL      string
}

type Logger

type Logger struct {
	Level string
}

type RedisConfig

type RedisConfig struct {
	Addr         string
	MinIdleConns int `mapstructure:"min_idle_conns"`
	PoolSize     int `mapstructure:"pool_size"`
	PoolTimeout  int `mapstructure:"pool_timeout"`
	Password     string
	DB           int
}

type ServerConfig

type ServerConfig struct {
	Debug            bool
	AppVersion       string `mapstructure:"app_version"`
	Addr             string
	JwtSecret        string `mapstructure:"jwt_secret"`
	JwtRefreshSecret string `mapstructure:"jwt_refresh_secret"`
}

type TokenConfig

type TokenConfig struct {
	MaxAge   int `mapstructure:"max_age"`
	Secure   bool
	HttpOnly bool `mapstructure:"http_only"`
}

Jump to

Keyboard shortcuts

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