ginfw

package
v0.0.0-...-a1933d6 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtServices

func ExtServices(c *gin.Context) *extdeps.ExtServices

ExtServices returns the ExtServices instance stored in the gin.Context

func ExtServicesMiddleware

func ExtServicesMiddleware(es *extdeps.ExternalServicesBuilder) gin.HandlerFunc

ExtServicesMiddleware creates a new ExternalServices (or external dependencies) for the incoming request, and stores it in the gin context

func ObsMiddleware

func ObsMiddleware() gin.HandlerFunc

ObsMiddleware creates a middlewware that attaches the ExternalServices instance and insighters instance with some fields already set, like the method and path for the request, the client ip for the logs, the request time as well as a unique request ID. It will also report the duration and size of the response.

func RecoveryWithObs

func RecoveryWithObs(ins *obs.Insighter) gin.HandlerFunc

RecoveryWithObs returns a middleware for a given writer that recovers from any panics and writes a 500 if there was one.

Types

type ReportingRouterGroup

type ReportingRouterGroup struct {
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(r *gin.RouterGroup, ins *obs.Insighter) *ReportingRouterGroup

func (*ReportingRouterGroup) Any

func (r *ReportingRouterGroup) Any(route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) DELETE

func (r *ReportingRouterGroup) DELETE(route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) GET

func (r *ReportingRouterGroup) GET(route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) Group

func (r *ReportingRouterGroup) Group(route string, hfs ...gin.HandlerFunc) *gin.RouterGroup

func (*ReportingRouterGroup) HEAD

func (r *ReportingRouterGroup) HEAD(route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) Handle

func (r *ReportingRouterGroup) Handle(method string, route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) Match

func (r *ReportingRouterGroup) Match(methods []string, relativePaths string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) OPTIONS

func (r *ReportingRouterGroup) OPTIONS(route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) PATCH

func (r *ReportingRouterGroup) PATCH(route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) POST

func (r *ReportingRouterGroup) POST(route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) PUT

func (r *ReportingRouterGroup) PUT(route string, hfs ...gin.HandlerFunc) gin.IRoutes

func (*ReportingRouterGroup) Static

func (r *ReportingRouterGroup) Static(relativePath string, root string) gin.IRoutes

func (*ReportingRouterGroup) StaticFS

func (r *ReportingRouterGroup) StaticFS(relativePath string, fs http.FileSystem) gin.IRoutes

func (*ReportingRouterGroup) StaticFile

func (r *ReportingRouterGroup) StaticFile(relativePath string, filePath string) gin.IRoutes

func (*ReportingRouterGroup) StaticFileFS

func (r *ReportingRouterGroup) StaticFileFS(relativePath string, filePath string, fs http.FileSystem) gin.IRoutes

func (*ReportingRouterGroup) Use

Directories

Path Synopsis
web

Jump to

Keyboard shortcuts

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