middleware

package
v2.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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(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