config

package
v0.0.0-...-5aa24ba Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTimeZone

func GetTimeZone() *time.Location

func InitConfig

func InitConfig()

Types

type Key

type Key string

Key is used as a config key

const (
	ServerEnv      Key = `server.env`
	ServerTimezone Key = `server.timezone`

	ServerHttpIP   Key = `server.http.ip`
	ServerHttpPort Key = `server.http.port`
	ServerHttpCORS Key = `server.http.cors`

	LogsEnabled Key = `logs.enabled`
	LogsLevel   Key = `logs.log_level`

	LogsFileEnabled Key = `logs.file.enabled`
	LogsFileName    Key = `logs.file.name`
	LogsFilePath    Key = `logs.file.path`

	DatabaseName     Key = `database.name`
	DatabaseHost     Key = `database.host`
	DatabaseAuth     Key = `database.auth`
	DatabaseUsername Key = `database.username`
	DatabasePassword Key = `database.password`

	RedisEnabled  Key = `redis.enabled`
	RedisHost     Key = `redis.host`
	RedisPort     Key = `redis.port`
	RedisAuth     Key = `redis.auth`
	RedisPassword Key = `redis.password`

	JwtAccessSecret  Key = `jwt.ACCESS_SECRET`
	JwtRefreshSecret Key = `jwt.REFRESH_SECRET`
)

These constants hold all config value keys

func (Key) GetBool

func (k Key) GetBool() bool

GetBool returns a bool 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) 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