middleware

package
v0.0.0-...-29cb976 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAdminUser   = errors.Unauthorized(unauthorized, "not admin user")
	ErrMissingUserId  = errors.Unauthorized(unauthorized, "missing userid")
	ErrInternalServer = errors.InternalServer(unauthorized, "internal server error")
)
View Source
var ErrGetSessionStoreFail = errors.Unauthorized(unauthorized, "get session error")

Functions

func Admin

func Admin(uu *biz.UserUsecase, logger log.Logger) middleware.Middleware

func Info

func Info() middleware.Middleware

func Session

func Session(store *sessions.RedisStore, name string, _ log.Logger) middleware.Middleware

Types

type ContextKey

type ContextKey string
const (
	ContextKeyUserId     ContextKey = "userid"
	ContextKeyUserK      ContextKey = "user-srp-k"
	ContextKeyRemoteAddr ContextKey = "remote-addr"
)

type SessionKey

type SessionKey string
const (
	SessionKeyUserId SessionKey = "userid"
	SessionKeyUserK  SessionKey = "user-srp-k"
)

Jump to

Keyboard shortcuts

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