This repository has been archived on 2026-01-07. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Game/Server/gateway/config/config.go

33 lines
665 B
Go

package config
import "common/config"
const path = "./config"
const KeyUserAccessToken = "user:access:%v"
const KeyUserRefreshToken = "user:refresh:%v"
type Config struct {
App *config.AppConfig `yaml:"app"`
Log *config.LogConfig `yaml:"log"`
Monitor *config.MonitorConfig `yaml:"monitor"`
DB *config.DBConfig `yaml:"db"`
Serve *config.ServeConfig `yaml:"serve"`
Auth *struct {
Secret string `yaml:"secret"`
Expire int64 `yaml:"expire"`
}
}
var cfg *Config
// LoadConfig 加载应用配置
func LoadConfig() error {
c, err := config.LoadConfig(path, cfg)
cfg = c
return err
}
func Get() *Config {
return cfg
}