config

package
v0.0.0-...-35c4631 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	APP_PORT      envKey = "APP_PORT"
	APP_WHITELIST envKey = "APP_WHITELIST"

	DB_HOST     envKey = "DB_HOST"
	DB_PORT     envKey = "DB_PORT"
	DB_USER     envKey = "DB_USER"
	DB_PASSWORD envKey = "DB_PASSWORD"
	DB_NAME     envKey = "DB_NAME"
	DB_SSL_MODE envKey = "DB_SSL_MODE"

	JWT_EXPIRE_TIME envKey = "JWT_EXPIRE_TIME"
	JWT_SECRET_KEY  envKey = "JWT_SECRET_KEY"
	JWT_COST        envKey = "JWT_COST"
)

Variables

This section is empty.

Functions

func GetArrayOfStringEnv

func GetArrayOfStringEnv(key envKey) []string

func GetStringEnv

func GetStringEnv(key envKey) string

func LoadEnvVariables

func LoadEnvVariables()

func StringToInt

func StringToInt(str string, alternate int) int

Types

type Config

type Config struct {
	Server   Server
	Database Database
	JWT      JWT
}

func GenerateConfig

func GenerateConfig() *Config

func GetInstance

func GetInstance() *Config

type Database

type Database struct {
	Host     string
	Port     int
	User     string
	Password string
	Name     string
	SSLMode  string
}

type JWT

type JWT struct {
	ExpireTime int
	SecretKey  string
	Cost       int
}

type Server

type Server struct {
	Port      string
	Whitelist []string
}

Jump to

Keyboard shortcuts

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