config

package
v0.0.0-...-908714d Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatabaseConnection

func CreateDatabaseConnection(cfg *Config) (*sql.DB, error)

Types

type Config

type Config struct {
	Environment    EnvironmentType
	APIPort        string
	AllowedOrigins []string

	TLSCertificate string
	TLSKey         string

	AuthJWTCookieName       string
	AuthJWTSigningMethod    *jwt.SigningMethodHMAC
	AuthJWTSecret           string
	AuthJWTExpireSeconds    int
	RefreshJWTCookieName    string
	RefreshJWTSigningMethod *jwt.SigningMethodHMAC
	RefreshJWTSecret        string
	RefreshJWTExpireSeconds int

	DBHost     string
	DBPort     string
	DBDatabase string
	DBUser     string
	DBPassword string
}

func NewConfig

func NewConfig() *Config

func (*Config) Load

func (c *Config) Load() error

type EnvironmentType

type EnvironmentType string
const (
	EnvironmentLocal      EnvironmentType = "local"
	EnvironmentProduction EnvironmentType = "production"
)

Jump to

Keyboard shortcuts

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