config

package
v0.0.0-...-4790e63 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Changesets = `` /* 1961-byte string literal not displayed */

Changesets is the database migrations.

Functions

func Config

func Config() *echo.Echo

Config .

func Database

func Database(l echo.Logger) *database.DBW

Database migrates the database and then returns the database connection.

func Migrate

func Migrate(l echo.Logger, con *mysql.Connection, changesets string) (*sqlx.DB, error)

Migrate will run the database migrations and will create the database if it does not exist.

Types

type Settings

type Settings struct {
	Port           int    `env:"API_PORT" default:"8080"`
	Secret         string `env:"API_SECRET" default:"TA8tALZAvLVLo4ToI44xF/nF6IyrRNOR6HSfpno/81M="`
	SessionTimeout int    `env:"API_SESSION_TIMEOUT" default:"480"` // 480 min = 8 hours.
}

Settings holds the variables for the application and the defaults.

func LoadEnv

func LoadEnv(l echo.Logger, prefix string) *Settings

LoadEnv will load the settings from the environment variables or defaults.

Jump to

Keyboard shortcuts

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