config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 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 {
	Redis  RedisConfig  `yaml:"redis"`
	DB     DBConfig     `yaml:"db"`
	Server ServerConfig `yaml:"server"`
}

Config for App.

func GetConfig

func GetConfig(fileName string) (*Config, error)

Get app config from file.

type DBConfig

type DBConfig struct {
	User     string `yaml:"user"`
	Password string `yaml:"password"`
	Port     string `yaml:"port"`
	Host     string `yaml:"host"`
	DBname   string `yaml:"dbname"`
}

Config for DB.

type RedisConfig

type RedisConfig struct {
	Host     string `yaml:"host"`
	Port     string `yaml:"port"`
	Password string `yaml:"password"`
	DB       int    `yaml:"db"`
}

Config for Redis.

type ServerConfig

type ServerConfig struct {
	Salt          string `yaml:"salt"`
	JWTKey        string `yaml:"jwtkey"`
	TokenLifeTime int    `yaml:"tokenLifeTime"`
}

Config for Server.

Jump to

Keyboard shortcuts

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