config

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

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

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

Documentation

Index

Constants

View Source
const LoginExpirationDuration = OneDay
View Source
const OneDay = 24 * time.Hour

Variables

View Source
var JwtSignatureKey []byte
View Source
var JwtSigningMethod = jwt.SigningMethodRS256

Functions

func MakeDatabaseConfig

func MakeDatabaseConfig()

func MakeJwtConfig

func MakeJwtConfig()

Types

type AppConf

type AppConf struct {
	Environment             string
	Name                    string
	Key                     string
	GracefulShutdownTimeout int
}

type BasicDBConf

type BasicDBConf struct {
	Host     string
	Username string
	Password string
	Name     string
	Port     string
}

type Config

type Config struct {
	App      AppConf
	MongoDb  MongoDbConf
	Redis    RedisConf
	Http     HttpConf
	Log      LogConf
	Database Databases
}

Config ...

func Make

func Make() *Config

Make builds a appConfig value based on .env file.

type ConnectionDBName

type ConnectionDBName string

type DBDriver

type DBDriver uint

type DatabaseConfig

type DatabaseConfig struct {
	ConnectionName       string
	SkipCreateConnection bool
	Driver               DBDriver
	BasicDBConf
	SSLMode string
	PostgresConf
	MYSQLConf
	MaxOpenConn            int
	MaxIdleConn            int
	MaxIdleTimeConnSeconds int64
	MaxLifeTimeConnSeconds int64
}

type Databases

type Databases map[ConnectionDBName]DatabaseConfig
var DBConfig Databases

type HttpConf

type HttpConf struct {
	Port       string
	XRequestID string
	Timeout    int
}

type LogConf

type LogConf struct {
	Name   string
	Logger *logrus.Logger
}

type MYSQLConf

type MYSQLConf struct {
	Charset   string
	ParseTime bool
	Timezone  string
}

type MongoDbConf

type MongoDbConf struct {
	Dsn string
}

type PostgresConf

type PostgresConf struct {
	Schema string
}

type RedisConf

type RedisConf struct {
	Address  string
	Password string
	Db       int
}

Jump to

Keyboard shortcuts

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