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 Facebook
- type Frontend
- type Github
- type Google
- 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 Config ¶
type Config struct {
AppName string
RunMode string
Protocol string
Domain string
Host string
Port int
Consul *Consul
Observes *Observes
Extension *Extension
Frontend *Frontend
Logger *Logger
Data *Data
Auth *Auth
Storage *Storage
OAuth *OAuth
Email *Email
Viper *viper.Viper
}
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 `json:"address"`
Scheme string `json:"scheme"`
Discovery struct {
DefaultTags []string `json:"default_tags"`
DefaultMeta map[string]string `json:"default_meta"`
HealthCheck bool `json:"health_check"`
CheckInterval string `json:"check_interval"`
Timeout string `json:"timeout"`
} `json:"discovery"`
}
Consul config struct
type Extension ¶
type Extension struct {
Mode string
Path string
Includes []string
Excludes []string
HotReload bool
}
Extension extension config struct
type Logger ¶
type Logger struct {
Level int
Path string
Format string
Output string
OutputFile string
IndexName string
Meilisearch *dc.Meilisearch
Elasticsearch *dc.Elasticsearch
}
Logger logger config struct
Click to show internal directories.
Click to hide internal directories.