config

package
v0.0.0-...-f0f63f4 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Database

func Database(l logger.ILog) *database.DBW

Database migrates the database and then returns the database connection.

func LoadRoutes

func LoadRoutes(core endpoint.Core)

LoadRoutes will load the routes for the endpoints.

func Middleware

func Middleware(core endpoint.Core) http.Handler

Middleware wraps the router with middleware and returns a http.Handler.

func Services

func Services(l logger.ILog, settings *Settings, dbx *database.DBW,
	ctx api.IContext, mocker *mock.Mocker) endpoint.Core

Services sets up the production services.

func SetupRouter

func SetupRouter(l logger.ILog, mux *router.Mux)

SetupRouter will setup the error page and page handling.

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 logger.ILog, 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