middleware

package
v0.0.0-...-2551f53 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthHeaderEmpty           = errors.New("authorization header is not provided")
	ErrAuthHeaderInvalidFormat   = errors.New("invalid authorization header format")
	ErrAuthHeaderUnsupportedType = errors.New("unsupported authorization type")
)

Functions

func Recovery

func Recovery() gin.HandlerFunc

func RequireAuth

func RequireAuth(repo UserRepository, tokenMaker token.TokenMaker) gin.HandlerFunc

Types

type UserRepository

type UserRepository interface {
	GetByUsername(ctx context.Context, username string) (*model.User, error)
}

Jump to

Keyboard shortcuts

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