middleware

package
v0.0.0-...-7c7f065 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware() *jwt.GinJWTMiddleware

func ExtractLogger

func ExtractLogger(c *gin.Context) *log.Entry

ExtractLogger pulls the logger out of the request context and returns it. By default this will include the request ID, but may also include the server ID if that middleware has been used in the chain by the time it is called.

func ExtractManager

func ExtractManager(c *gin.Context) *server.Manager

ExtractManager returns the server manager instance set on the request context.

func ExtractServer

func ExtractServer(c *gin.Context) *server.Server

ExtractServer will return the server from the gin.Context or panic if it is not present.

func HelloHandler

func HelloHandler(c *gin.Context)

func ServerExists

func ServerExists() gin.HandlerFunc

ServerExists will ensure that the requested server exists in this setup. Returns a 404 if we cannot locate it. If the server is found it is set into the request context, and the logger for the context is also updated to include the server ID in the fields list.

Types

type User

type User struct {
	UserName  string
	FirstName string
	LastName  string
}

User demo

Jump to

Keyboard shortcuts

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