web

package
v0.0.0-...-a9e353d Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const HeaderVersion = "X-Gopos-Version"

HeaderVersion HTTP Header that includes the current version.

Variables

This section is empty.

Functions

func ContextMiddleware

func ContextMiddleware(db *database.Database) echo.MiddlewareFunc

ContextMiddleware provides the GoposContext as a middleware function.

func ParseAndValidate

func ParseAndValidate(ctx *echo.Context, target interface{}) error

ParseAndValidate parses the request and applies data validation.

func PrometheusMiddleware

func PrometheusMiddleware(srv *echo.Echo)

PrometheusMiddleware registers the Prometheus middleware on the server.

func VersionHeaderMiddleware

func VersionHeaderMiddleware(next echo.HandlerFunc) echo.HandlerFunc

VersionHeaderMiddleware adds the current Gopos version to every HTTP response.

Types

type GoposContext

type GoposContext struct {
	DB *database.Database

	echo.Context
}

GoposContext custom context that exposes the database instance to routes.

type Validator

type Validator struct {
	Validator *validator.Validate
}

Validator default request validator

func (Validator) Validate

func (v Validator) Validate(i interface{}) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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