Documentation ¶
Index ¶
- Variables
- func GenerateToken(userID string) string
- func LoadToken(db *sqlx.DB) func(next echo.HandlerFunc) echo.HandlerFunc
- func ParseToken(token string) (string, error)
- func RequireAdmin(next echo.HandlerFunc) echo.HandlerFunc
- func RequireAuthMiddleWare(next echo.HandlerFunc) echo.HandlerFunc
- func RequireNoAuthMiddleWare(next echo.HandlerFunc) echo.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( IsAdminContextKey = "admin" UserIDContextKey = "user" )
View Source
var JWT_KEY = []byte("super_secret")
Functions ¶
func GenerateToken ¶
func ParseToken ¶
func RequireAdmin ¶
func RequireAdmin(next echo.HandlerFunc) echo.HandlerFunc
func RequireAuthMiddleWare ¶
func RequireAuthMiddleWare(next echo.HandlerFunc) echo.HandlerFunc
func RequireNoAuthMiddleWare ¶
func RequireNoAuthMiddleWare(next echo.HandlerFunc) echo.HandlerFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.