Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
C = &Config{}
)
Functions ¶
func InitConfigWithViper ¶
func InitConfigWithViper()
Types ¶
type Config ¶
type Config struct { LogLevel string `default:"DEBUG" yaml:"logLevel"` Mode string `default:"debug" yaml:"mode"` Sentry Sentry `yaml:"sentry"` Tracing Tracing `yaml:"tracing"` HTTP HTTP `yaml:"http"` GRPC GRPC `yaml:"grpc"` Database Database `yaml:"database"` NATS NATS `yaml:"nats"` JWT JWT `yaml:"jwt"` OAuth2 OAuth2 `yaml:"oauth2"` Cache Cache `yaml:"cache"` Game Game `yaml:"game"` }
type Database ¶
type Database struct { // refer to https://github.com/go-sql-driver/mysql#dsn-data-source-name for details DSN string `yaml:"dsn"` DBName string `yaml:"dbName"` MaxOpenConns int `default:"32" yaml:"maxOpenConns"` MaxIdleConns int `default:"5" yaml:"maxIdleConns"` ConnMaxIdleTime time.Duration `default:"15m" yaml:"connMaxIdleTime"` ConnMaxLifetime time.Duration `default:"60m" yaml:"connMaxLifetime"` }
type Game ¶
type Game struct { SuperuserGroups []string `yaml:"superuserGroups"` UnemployedJob UnemployedJob `yaml:"unemployedJob"` PublicJobs []string `yaml:"publicJobs"` Livemap Livemap `yaml:"livemap"` DefaultPermissions []Perm `yaml:"defaultPermissions"` }
type OAuth2 ¶
type OAuth2 struct {
Providers []*OAuth2Provider
}
type OAuth2Endpoints ¶
type OAuth2Mapping ¶
type OAuth2Provider ¶
type OAuth2Provider struct { Name string `yaml:"name"` Label string `yaml:"label"` Homepage string `yaml:"homepage"` Type OAuth2ProviderType `yaml:"type"` DefaultAvatar string `yaml:"defaultAvatar"` RedirectURL string `yaml:"redirectURL"` ClientID string `yaml:"clientID"` ClientSecret string `yaml:"clientSecret"` Scopes []string `yaml:"scopes"` Endpoints OAuth2Endpoints `yaml:"endpoints"` Mapping *OAuth2Mapping `yaml:"omitempty,mapping"` }
type OAuth2ProviderType ¶
type OAuth2ProviderType string
const ( OAuth2ProviderGeneric OAuth2ProviderType = "generic" OAuth2ProviderDiscord OAuth2ProviderType = "discord" )
type UnemployedJob ¶
Click to show internal directories.
Click to hide internal directories.