config

package
v0.0.2-0...-d9a3ee1 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigFromEnv

func LoadConfigFromEnv(cfg interface{}) error

Load config from env

Types

type Config

type Config struct {
	JwtKey            string         `json:"jwt_key"`
	Redis             RedisConfig    `json:"redis"`
	Database          DatabaseConfig `json:"database"`
	TokenTimeDuration uint           `json:"token_time_duration"` // Minutes
}

func (*Config) TokenTIL

func (c *Config) TokenTIL() time.Duration

type DatabaseConfig

type DatabaseConfig struct {
	Addr     string `json:"addr"`
	User     string `json:"user"`
	Password string `json:"password"`
	Database string `json:"database"`
}

FIXME: support for postgreDB

type RedisConfig

type RedisConfig struct {
	Addr     string `json:"addr"`
	Password string `json:"password"`
	DB       int    `json:"db"`
}

Jump to

Keyboard shortcuts

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