config

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: May 19, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitConfig

func InitConfig()

InitConfig initializes the config, sets defaults etc.

func InitDefaultConfig

func InitDefaultConfig()

InitDefaultConfig sets default config values This is an extra function so we can call it when initializing tests without initializing the full config

Types

type Key

type Key string

Key is used as a config key

const (
	// #nosec
	ServiceJWTSecret             Key = `service.JWTSecret`
	ServiceInterface             Key = `service.interface`
	ServiceFrontendurl           Key = `service.frontendurl`
	ServiceEnableCaldav          Key = `service.enablecaldav`
	ServiceRootpath              Key = `service.rootpath`
	ServiceMaxItemsPerPage       Key = `service.maxitemsperpage`
	ServiceEnableMetrics         Key = `service.enablemetrics`
	ServiceMotd                  Key = `service.motd`
	ServiceEnableLinkSharing     Key = `service.enablelinksharing`
	ServiceEnableRegistration    Key = `service.enableregistration`
	ServiceEnableTaskAttachments Key = `service.enabletaskattachments`
	ServiceTimeZone              Key = `service.timezone`
	ServiceEnableTaskComments    Key = `service.enabletaskcomments`

	DatabaseType                  Key = `database.type`
	DatabaseHost                  Key = `database.host`
	DatabaseUser                  Key = `database.user`
	DatabasePassword              Key = `database.password`
	DatabaseDatabase              Key = `database.database`
	DatabasePath                  Key = `database.path`
	DatabaseMaxOpenConnections    Key = `database.maxopenconnections`
	DatabaseMaxIdleConnections    Key = `database.maxidleconnections`
	DatabaseMaxConnectionLifetime Key = `database.maxconnectionlifetime`
	DatabaseSslMode               Key = `database.sslmode`

	CacheEnabled        Key = `cache.enabled`
	CacheType           Key = `cache.type`
	CacheMaxElementSize Key = `cache.maxelementsize`

	MailerEnabled       Key = `mailer.enabled`
	MailerHost          Key = `mailer.host`
	MailerPort          Key = `mailer.port`
	MailerUsername      Key = `mailer.username`
	MailerPassword      Key = `mailer.password`
	MailerSkipTLSVerify Key = `mailer.skiptlsverify`
	MailerFromEmail     Key = `mailer.fromemail`
	MailerQueuelength   Key = `mailer.queuelength`
	MailerQueueTimeout  Key = `mailer.queuetimeout`

	RedisEnabled  Key = `redis.enabled`
	RedisHost     Key = `redis.host`
	RedisPassword Key = `redis.password`
	RedisDB       Key = `redis.db`

	LogEnabled       Key = `log.enabled`
	LogStandard      Key = `log.standard`
	LogLevel         Key = `log.level`
	LogDatabase      Key = `log.database`
	LogDatabaseLevel Key = `log.databaselevel`
	LogHTTP          Key = `log.http`
	LogEcho          Key = `log.echo`
	LogPath          Key = `log.path`

	RateLimitEnabled Key = `ratelimit.enabled`
	RateLimitKind    Key = `ratelimit.kind`
	RateLimitPeriod  Key = `ratelimit.period`
	RateLimitLimit   Key = `ratelimit.limit`
	RateLimitStore   Key = `ratelimit.store`

	FilesBasePath Key = `files.basepath`
	FilesMaxSize  Key = `files.maxsize`

	MigrationWunderlistEnable       Key = `migration.wunderlist.enable`
	MigrationWunderlistClientID     Key = `migration.wunderlist.clientid`
	MigrationWunderlistClientSecret Key = `migration.wunderlist.clientsecret`
	MigrationWunderlistRedirectURL  Key = `migration.wunderlist.redirecturl`

	CorsEnable  Key = `cors.enable`
	CorsOrigins Key = `cors.origins`
	CorsMaxAge  Key = `cors.maxage`

	AvatarProvider           Key = `avatar.provider`
	AvatarGravaterExpiration Key = `avatar.gravatarexpiration`
)

These constants hold all config value keys

func (Key) GetBool

func (k Key) GetBool() bool

GetBool returns a bool config value

func (Key) GetDuration

func (k Key) GetDuration() time.Duration

GetDuration returns a duration config value

func (Key) GetInt

func (k Key) GetInt() int

GetInt returns an int config value

func (Key) GetInt64

func (k Key) GetInt64() int64

GetInt64 returns an int64 config value

func (Key) GetString

func (k Key) GetString() string

GetString returns a string config value

func (Key) GetStringSlice

func (k Key) GetStringSlice() []string

GetStringSlice returns a string slice from a config option

func (Key) Set

func (k Key) Set(i interface{})

Set sets a value

Jump to

Keyboard shortcuts

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