config

package
v0.0.0-...-d2a67e6 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitGorm

func InitGorm(env *EnvVars) *gorm.DB

func InitRouter

func InitRouter() *mux.Router

Types

type EnvVars

type EnvVars struct {
	JWT_SECRET_KEY             string        `validate:"required"`
	TEST_DATABASE_NAME         string        `validate:"required"`
	DATABASE_NAME              string        `validate:"required"`
	TEST_DATABASE_PASS         string        `validate:"required"`
	DATABASE_USER              string        `validate:"required"`
	TEST_DATABASE_USER         string        `validate:"required"`
	DATABASE_HOST              string        `validate:"required"`
	DATABASE_PASS              string        `validate:"required"`
	SERVER_PORT                int           `validate:"required,gte=1,lte=65535"`
	DATABASE_PORT              int           `validate:"required,gte=1,lte=65535"`
	JWT_EXPIRES_IN             int           `validate:"required,gte=1"`
	DATABASE_MAX_CONN_LIFETIME time.Duration `validate:"required"`
	TEST_DATABASE_PORT         int           `validate:"required,gte=1,lte=65535"`
	SERVER_READ_TIMEOUT        int           `validate:"required,gte=1"`
	DATABASE_MAX_IDLE_CONNS    int           `validate:"required,gte=1"`
	DATABASE_MAX_CONNS         int           `validate:"required,gte=1"`
}

func NewEnvConf

func NewEnvConf(envPath string) (*EnvVars, error)

Jump to

Keyboard shortcuts

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