Documentation
¶
Index ¶
Constants ¶
View Source
const DefaultRequestTimeout = 2 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AgentConfig ¶
type AuthConfig ¶
type AuthConfig struct {
JWT JWTConfig `mapstructure:"jwt" validate:"required"`
OpenID OpenIDConfig `mapstructure:"openid"`
}
type Config ¶
type Config struct {
HTTP HTTPConfig `mapstructure:"http" validate:"required"`
DB DbConfig `mapstructure:"db" validate:"required"`
Auth AuthConfig `mapstructure:"auth" validate:"required"`
Page PageConfig `mapstructure:"page" validate:"required"`
Agent AgentConfig `mapstructure:"agent" validate:"required"`
Metrics MetricsConfig `mapstructure:"metrics"`
}
func DefaultConfig ¶
func DefaultConfig() *Config
type DbConfig ¶
type DbConfig struct {
Type string `mapstructure:"type" validate:"required,excludesall=!@#$ "`
LogLevel DbLogLevel `mapstructure:"log_level"`
Config map[string]interface{} `mapstructure:"config"`
}
type DbLogLevel ¶ added in v0.0.2
type DbLogLevel string
DbLogLevel represents the database logging level
const ( DbLogLevelSilent DbLogLevel = "silent" DbLogLevelError DbLogLevel = "error" DbLogLevelWarn DbLogLevel = "warn" DbLogLevelInfo DbLogLevel = "info" )
type HTTPConfig ¶
type HTTPConfig struct {
Listen string `mapstructure:"listen" validate:"required"`
}
type JWTConfig ¶
type JWTConfig struct {
Secret string `mapstructure:"secret" validate:"required,min=32"`
AccessTokenTTL time.Duration `mapstructure:"access_token_ttl" validate:"required,min=1m"`
RefreshTokenTTL time.Duration `mapstructure:"refresh_token_ttl" validate:"required,min=1h"`
Issuer string `mapstructure:"issuer" validate:"required"`
HeaderName string `mapstructure:"header_name"`
}
type MetricsConfig ¶ added in v0.0.2
type OpenIDConfig ¶
type OpenIDConfig struct {
Enabled bool `mapstructure:"enabled"`
Name string `mapstructure:"name"`
Icon string `mapstructure:"icon"`
ProviderURL string `mapstructure:"provider_url" validate:"required_if=Enabled true,omitempty,url"`
ClientID string `mapstructure:"client_id" validate:"required_if=Enabled true"`
ClientSecret string `mapstructure:"client_secret" validate:"required_if=Enabled true"`
RedirectURL string `mapstructure:"redirect_url" validate:"required_if=Enabled true,omitempty,url"`
Scopes []string `mapstructure:"scopes"`
RolesClaim string `mapstructure:"roles_claim"`
}
type PageConfig ¶
Click to show internal directories.
Click to hide internal directories.