Documentation ¶
Index ¶
- Variables
- func BuildTime() time.Time
- func CookieBlockKey() []byte
- func CookieHashKey() []byte
- func CsrfKey() []byte
- func ExtractorDeniedIPs() []*net.IPNet
- func GenerateKey(minLen, maxLen int) string
- func JwtPk() ed25519.PublicKey
- func JwtSk() ed25519.PrivateKey
- func LoadConfiguration(configPath string) error
- func Version() string
- func WriteConfig(filename string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Config = config{ Main: configMain{ LogLevel: "info", DevMode: false, DataDirectory: "data", }, Server: configServer{ Host: "127.0.0.1", Port: 5000, Session: configSession{ CookieName: "sxid", MaxAge: 86400 * 30, }, }, Database: configDB{}, Extractor: configExtractor{ NumWorkers: runtime.NumCPU(), DeniedIPs: []configIPNet{ newConfigIPNet("127.0.0.0/8"), newConfigIPNet("::1/128"), }, }, }
Config holds the configuration data from configuration files or flags.
This variable sets some default values that might be overwritten by a configuration file.
Functions ¶
func BuildTime ¶
BuildTime returns the build time or, if empty, the time when the application started
func CookieBlockKey ¶
func CookieBlockKey() []byte
CookieBlockKey returns the key used by session cookies
func CookieHashKey ¶
func CookieHashKey() []byte
CookieHashKey returns the key used by session cookies
func ExtractorDeniedIPs ¶
ExtractorDeniedIPs returns the value of Config.Extractor.DeniedIPs as a slice of *net.IPNet
func LoadConfiguration ¶
LoadConfiguration loads the configuration file.
func WriteConfig ¶
WriteConfig writes configuration to a file.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.