configs

package
v0.0.0-...-d1a9080 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2021 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

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

func BuildTime() time.Time

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 CsrfKey

func CsrfKey() []byte

CsrfKey returns the key used by CSRF protection

func ExtractorDeniedIPs

func ExtractorDeniedIPs() []*net.IPNet

ExtractorDeniedIPs returns the value of Config.Extractor.DeniedIPs as a slice of *net.IPNet

func GenerateKey

func GenerateKey(minLen, maxLen int) string

GenerateKey returns a random key

func JwtPk

func JwtPk() ed25519.PublicKey

JwtPk returns the public key for JWT handlers

func JwtSk

func JwtSk() ed25519.PrivateKey

JwtSk returns the private key for JWT handlers

func LoadConfiguration

func LoadConfiguration(configPath string) error

LoadConfiguration loads the configuration file.

func Version

func Version() string

Version returns the current readeck version

func WriteConfig

func WriteConfig(filename string) error

WriteConfig writes configuration to a file.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL