Documentation
¶
Index ¶
- func BindConfigToContext(ctx context.Context) context.Context
- func Reload() error
- func Watch(callback func(*Config))
- type Auth
- type Casbin
- type Config
- type Consul
- type DBNode
- type Data
- type Email
- type Extension
- type Frontend
- type GRPC
- type JWT
- type Logger
- type OAuth
- type Observes
- type Sentry
- type Storage
- type Tracer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindConfigToContext ¶
BindConfigToContext binds the configuration to the context.
Types ¶
type Auth ¶
type Auth struct {
JWT *JWT `json:"jwt" yaml:"jwt"`
Casbin *Casbin `json:"casbin" yaml:"casbin"`
Whitelist []string `json:"whitelist" yaml:"whitelist"`
MaxSessions int `json:"max_sessions" yaml:"max_sessions"`
SessionCleanupInterval int `json:"session_cleanup_interval" yaml:"session_cleanup_interval"`
}
Auth auth config struct
type Config ¶
type Config struct {
AppName string `yaml:"app_name" json:"app_name"`
Environment string `yaml:"environment" json:"environment"`
Protocol string `yaml:"protocol" json:"protocol"`
Domain string `yaml:"domain" json:"domain"`
Host string `yaml:"host" json:"host"`
Port int `yaml:"port" json:"port"`
GRPC *GRPC `yaml:"grpc" json:"grpc"`
Consul *Consul `yaml:"consul" json:"consul"`
Observes *Observes `yaml:"observes" json:"observes"`
Extension *Extension `yaml:"extension" json:"extension"`
Frontend *Frontend `yaml:"frontend" json:"frontend"`
Logger *Logger `yaml:"logger" json:"logger"`
Data *Data `yaml:"data" json:"data"`
Auth *Auth `yaml:"auth" json:"auth"`
Storage *Storage `yaml:"storage" json:"storage"`
OAuth *OAuth `yaml:"oauth" json:"oauth"`
Email *Email `yaml:"email" json:"email"`
Viper *viper.Viper `yaml:"-" json:"-"`
}
Config represents the configuration implementation.
func GetConfig ¶
GetConfig returns the configuration. It does not handle errors internally; instead, it returns the error for the caller to handle.
func LoadConfig ¶
LoadConfig loads the configuration from the file.
type Consul ¶
type Consul struct {
Address string `yaml:"address" json:"address"`
Scheme string `yaml:"scheme" json:"scheme"`
Discovery struct {
DefaultTags []string `yaml:"default_tags" json:"default_tags"`
DefaultMeta map[string]string `yaml:"default_meta" json:"default_meta"`
HealthCheck bool `yaml:"health_check" json:"health_check"`
CheckInterval string `yaml:"check_interval" json:"check_interval"`
Timeout string `yaml:"timeout" json:"timeout"`
} `yaml:"discovery" json:"discovery"`
}
Consul config struct
type Frontend ¶
type Frontend struct {
SignInURL string `json:"sign_in_url" yaml:"sign_in_url"`
SignUpURL string `json:"sign_up_url" yaml:"sign_up_url"`
}
Frontend frontend config struct
Click to show internal directories.
Click to hide internal directories.