configs

package
v0.0.0-...-f5fa5b5 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Default = map[string]Config{
	"APP_ENV":                  "local",
	"APP_PORT":                 "6191",
	"APP_URL":                  "http://declassroom.site",
	"APP_KEY":                  "3a1d279da65a7b813a2844516e26be5c",
	"API_IS_DEBUG":             "false",
	"OAUTH2_ACCESS_EXPIRE_IN":  "1h",
	"OAUTH2_REFRESH_EXPIRE_IN": "720h",
	"DB_DRIVER":                "mysql",
	"DB_HOST":                  "localhost",
	"DB_PORT":                  "3306",
	"DB_NAME":                  "declassroom",
	"DB_USER":                  "root",
	"DB_PASSWORD":              "root",
	"DB_SSL_MODE":              "disable",
	"DB_MAX_OPEN_CONNS":        "100",
	"DB_MAX_IDLE_CONNS":        "2",
	"DB_CONN_MAX_LIFETIME":     "0ms",
	"DB_IS_DEBUG":              "false",
}

Functions

func CreateDSN

func CreateDSN() (string, error)

Types

type Config

type Config string

func GetConfig

func GetConfig(key string) Config

func (Config) Bool

func (c Config) Bool() bool

func (Config) Duration

func (c Config) Duration() time.Duration

func (Config) Int

func (c Config) Int() int

func (Config) String

func (c Config) String() string

type DBConfig

type DBConfig struct {
	DSN    string
	Driver string
}

func GetDBConfig

func GetDBConfig() (DBConfig, error)

Jump to

Keyboard shortcuts

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