middleware

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIDContextKey string = "requestID"
View Source
const UserIDContextKey = "userID"

Variables

This section is empty.

Functions

func ErrorHandler

func ErrorHandler(next echo.HTTPErrorHandler) echo.HTTPErrorHandler

func FirebaseAuth

func FirebaseAuth(skipper middleware.Skipper, auth AuthProvider) echo.MiddlewareFunc

func RequestID

func RequestID(skipper middleware.Skipper) echo.MiddlewareFunc

func RequestLogger

func RequestLogger(log *zap.Logger, extraLogFieldExtractor ...LogFieldExtractor) echo.MiddlewareFunc

func UpdateLastOnline

func UpdateLastOnline(skipper middleware.Skipper, lo LastOnlineProvider) echo.MiddlewareFunc

Types

type AuthProvider

type AuthProvider interface {
	VerifyIDTokenAndCheckRevoked(ctx context.Context, idToken string) (*auth.Token, error)
}

type LastOnlineProvider

type LastOnlineProvider interface {
	UpdateLastOnline(ctx context.Context, uid string) error
}

type LogFieldExtractor

type LogFieldExtractor func(echo.Context) []zapcore.Field

Jump to

Keyboard shortcuts

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