Documentation ¶
Overview ¶
Package cfg parses and validates the configuration
Index ¶
Constants ¶
View Source
const ( Username = iota EMail )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllowedFileExts ¶ added in v0.3.1
func (*AllowedFileExts) Unmarshal ¶ added in v0.3.1
func (afe *AllowedFileExts) Unmarshal(value string) error
type Application ¶
type Application struct { Title string `cfg:"application_title"` Language string `cfg:"application_language"` Description string `cfg:"application_description"` Domain string `cfg:"application_domain"` Favicon string `cfg:"application_favicon" default:"assets/favicon.ico"` RobotsTxt string `cfg:"application_robots_txt"` CustomCSS string `cfg:"application_custom_css"` OverwriteCSS bool `cfg:"application_overwrite_default_css" default:"false"` }
type Database ¶
type Database struct {
File string `cfg:"sqlite_file" default:"data/goblog.sqlite"`
}
type File ¶
type File struct { Location string `cfg:"file_location" default:"/srv/goblog/files/"` MaxUploadSize cfg.FileSize `cfg:"file_max_upload_size" default:"10MB"` AllowedFileExtensions AllowedFileExts `cfg:"file_allowed_extensions"` }
type LoginMethod ¶
type LoginMethod int
func (*LoginMethod) Unmarshal ¶
func (lm *LoginMethod) Unmarshal(value string) error
type Session ¶
type Session struct { TTL time.Duration `cfg:"session_time_to_live" default:"2h"` GarbageCollection time.Duration `cfg:"session_garbage_collection" default:"5m"` CookieName string `cfg:"session_cookie_name" default:"goblog"` CookieSecure bool `cfg:"session_cookie_secure" default:"true"` CookiePath string `cfg:"session_cookie_path" default:"/admin"` }
type Settings ¶
type Settings struct { Environment string `cfg:"environment" default:"prod"` BuildVersion string `cfg:"-"` BuildGitHash string `cfg:"-"` Application Blog User File Server Database Mail Session CSRF Log }
func LoadConfig ¶
func (*Settings) CheckConfig ¶
func (*Settings) GenerateCSRF ¶
type User ¶
type User struct { MinPasswordLength int `cfg:"user_min_password_length" default:"12"` InterceptorPlugin string `cfg:"user_interceptor_plugin"` LoginMethod LoginMethod `cfg:"user_login_method" default:"username"` }
Click to show internal directories.
Click to hide internal directories.