1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-11-23 21:44:41 +02:00
Files
go-micro/cmd/dashboard/config/config.go
2021-11-24 11:27:23 +08:00

38 lines
548 B
Go

package config
import "time"
type Config struct {
Server ServerConfig
}
type ServerConfig struct {
Address string
Auth AuthConfig
CORS CORSConfig
}
type AuthConfig struct {
Username string
Password string
TokenSecret string
TokenExpiration time.Duration
}
type CORSConfig struct {
Enable bool `toml:"enable"`
Origin string `toml:"origin"`
}
func GetConfig() Config {
return *_cfg
}
func GetServerConfig() ServerConfig {
return _cfg.Server
}
func GetAuthConfig() AuthConfig {
return _cfg.Server.Auth
}