common

package
v0.0.0-...-87bbeb5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JwtMiddleWare

func JwtMiddleWare() echo.MiddlewareFunc

Types

type Controller

type Controller interface {
	Routes() []Route
}

type CustomValidator

type CustomValidator struct {
	Validator *validator.Validate
}

func (*CustomValidator) Validate

func (cv *CustomValidator) Validate(i interface{}) error

type JwtCustomClaims

type JwtCustomClaims struct {
	Name string    `json:"name"`
	Id   uuid.UUID `json:"id"`
	Role UserRole  `json:"role"`
	jwt.StandardClaims
}

type Route

type Route struct {
	Method     string
	Path       string
	Handler    echo.HandlerFunc
	Middleware []echo.MiddlewareFunc
}

type UserRole

type UserRole string
const (
	Admin     UserRole = "ADMIN"
	Moderator UserRole = "MODERATOR"
	Writer    UserRole = "WRITER"
)

type ValidationError

type ValidationError struct {
	Namespace string
	Field     string
	Tag       string
	Message   string
}

type ValidationErrors

type ValidationErrors []ValidationError

func (ValidationErrors) Error

func (ve ValidationErrors) Error() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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