middleware

package
v0.15.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Config

func Config(cli *cli.Context) gin.HandlerFunc

Config is a middleware function that initializes the Configuration and attaches to the context of every http.Request.

func Logger

func Logger(timeFormat string, utc bool) gin.HandlerFunc

Logger returns a gin.HandlerFunc (middleware) that logs requests using zerolog.

Requests with errors are logged using log.Err(). Requests without errors are logged using log.Info().

It receives:

  1. A time package format string (e.g. time.RFC3339).
  2. A boolean stating whether to use UTC time zone or local.

func Store

func Store(cli *cli.Context, v store.Store) gin.HandlerFunc

Store is a middleware function that initializes the Datastore and attaches to the context of every http.Request.

func Version

func Version(c *gin.Context)

Version is a middleware function that appends the Woodpecker version information to the HTTP response. This is intended for debugging and troubleshooting.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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