config

package
v0.0.0-...-4d8001c Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	CacheTimer    time.Duration
	ListenPort    uint16
	Logger        *log.Logger
	LogLevel      log.Level
	TemplateCache models.TemplateCache
	UseCache      bool
}

AppConfig contains data to be accessed across the app.

func Initialise

func Initialise() AppConfig

Initialises the app wide AppConfig, loads values from environment, and set up the Logger

type ConfigDatabase

type ConfigDatabase struct {
	CacheTimer time.Duration `env:"CACHETIMER" env-description:"How often to automatically regenerate template cache."`
	LogLevel   string        `env:"LOGLEVEL" env-description:"Logging level. Default: warn, Possible values: debug info warn error fatal none"`
	Port       uint16        `env:"PORT" env-description:"server port"`
	UseCache   bool          `env:"CACHE" env-description:"Use template cache"`
}

ConfigDatabase contains data to be loaded from environmental variables

Jump to

Keyboard shortcuts

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