Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIConfig ¶
type APIConfig struct { Secure bool `json:"secure" default:"true"` RequestIDHeader string `json:"request_id_header" split_words:"true" validate:"required"` ExternalURL string `json:"external_url" split_words:"true"` AllowedLogoutURLs []string `json:"allowed_logout_urls" split_words:"true"` CSRF *CSRFConfig `json:"csrf" validate:"dive"` JWT *JWTConfig `json:"jwt" validate:"dive"` Mailer *MailerConfig `json:"mailer" validate:"dive"` Cookie *CookieConfig `json:"cookie" validate:"dive"` DisableSignup bool `json:"disable_signup" split_words:"true"` }
type CSRFConfig ¶
type CSRFConfig struct { Enabled bool `json:"enabled" default:"true"` AuthKey string `json:"auth_key" split_words:"true" validate:"required,gte=32"` }
CSRFConfig holds all the CSRF related configuration.
type Config ¶
type Config struct { SiteURL string `json:"site_url" split_words:"true"` Logger *logger.Config `json:"logger"` Debug *DebugConfig `json:"debug" validate:"dive"` HTTP *HTTPConfig `json:"http" validate:"dive"` Hashers *HashersConfig `json:"hashers" validate:"dive"` Database *DatabaseConfig `json:"database" validate:"dive"` API *APIConfig `json:"api" validate:"dive"` SMTP *SMTPConfig `json:"smtp" validate:"dive"` }
func (*Config) ApplyDefaults ¶
func (config *Config) ApplyDefaults()
ApplyDefaults sets defaults for a configuration.
type CookieConfig ¶
type DatabaseConfig ¶
type DatabaseConfig struct { Type string `json:"type" validate:"required"` JSONMutexDB *jsonmutexdb.Config `json:"jsonmutexdb"` LevelDB *leveldb.Config `json:"leveldb"` }
type DebugConfig ¶
type EmailContentConfig ¶
type EmailContentConfig struct { Confirmation string `json:"confirmation"` Recovery string `json:"recovery"` EmailChange string `json:"email_change" split_words:"true"` }
EmailContentConfig holds the configuration for emails, both subjects and template URLs.
type HTTPConfig ¶
type HTTPConfig struct {
Addr string `json:"addr" default:":8080"`
}
type HashersConfig ¶
type HashersConfig struct {
Argon2 *hash.HasherArgon2Config `json:"argon2" required:"true"`
}
type JWTConfig ¶
type JWTConfig struct { ClaimsNamespace string `json:"claims_namespace" split_words:"true" validate:"required,gte=3"` Exp int `json:"exp" default:"3600"` Aud string `json:"aud"` AcceptableSkew time.Duration `json:"acceptable_skew" split_words:"true" required:"true" default:"30s"` DefaultKey string `json:"default_key" split_words:"true" validate:"required"` KeysJSON string `json:"-" envconfig:"keys" validate:"required"` }
JWTConfig holds all the JWT related configuration.
type MailerConfig ¶
type MailerConfig struct { Autoconfirm bool `json:"autoconfirm" default:"false"` ValidateHost bool `json:"validate_host" split_words:"true" default:"false"` Subjects EmailContentConfig `json:"subjects"` Templates EmailContentConfig `json:"templates"` URLPaths EmailContentConfig `json:"url_paths" split_words:"true"` }
type SMTPConfig ¶
Click to show internal directories.
Click to hide internal directories.