middlewares

package
v0.0.0-...-ae1130f Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInternalServerError will thow if the internal server error happen
	ErrInternalServerError = errors.New("Internal Server Error")
	// ErrNotFound wil thow if the requested item is not exists
	ErrorNotFound = errors.New("Your requested Item is not found")
	// ErrConflict willthow if the current action already exists
	ErrConflict = errors.New("Your Item already exist")
	// ErrBadParamInput will throw if the given request-body or param is not valid
	ErrBadParamInput = errors.New("Given Param is not valid")
)

Functions

func GenerateJwt

func GenerateJwt(mp map[string]interface{}) (string, error)

func GetToken

func GetToken(c echo.Context) string

func GetUserIDJWT

func GetUserIDJWT(tokenstr string) int16

func SHA256Encoder

func SHA256Encoder(s string) string

func TokenGenerator

func TokenGenerator() string

Types

type Claims

type Claims struct {
	jwt.StandardClaims
	UserID int16
}

type GoMiddleware

type GoMiddleware struct {
}

func InitMiddleware

func InitMiddleware() *GoMiddleware

func (*GoMiddleware) CORS

func (m *GoMiddleware) CORS(next echo.HandlerFunc) echo.HandlerFunc

Jump to

Keyboard shortcuts

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