mid

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 9 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// RequestIDKey is the key used to store the request ID in the context.
	RequestIDKey = "request_id"
)

Variables

This section is empty.

Functions

func AuthJwt added in v0.0.5

func AuthJwt(c *gin.Context)

func GetContext

func GetContext(c *gin.Context) context.Context

func GetPaging added in v0.0.7

func GetPaging(c *gin.Context) *web.Paging

func GetUID

func GetUID(c *gin.Context) types.ID

func Logger

func Logger(c *gin.Context)

func NewJwtToken

func NewJwtToken(userID types.ID) (string, error)

func PagingHandler added in v0.0.7

func PagingHandler(c *gin.Context)

func SetContext added in v0.0.7

func SetContext(c *gin.Context, ctx context.Context)

func SetJwtHmacSecret

func SetJwtHmacSecret(secret string)

func SetJwtToHeader

func SetJwtToHeader(c *gin.Context, userID types.ID) error

Types

type JwtClaims

type JwtClaims struct {
	UserID types.ID `json:"uid"`
	jwt.RegisteredClaims
}

func ParseJwtToken

func ParseJwtToken(tokenString string) (*JwtClaims, error)

func (*JwtClaims) Valid

func (c *JwtClaims) Valid() error

type Validator

type Validator interface {
	Validate() error
}

Jump to

Keyboard shortcuts

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