middleware

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserNamespaces = "user-namespaces"

	RoleUser  = "user"
	RoleAdmin = "admin"
)

Variables

This section is empty.

Functions

func GetHeader

func GetHeader(ctx *gin.Context, header string) string

func RequiredUserHeaders

func RequiredUserHeaders() gin.HandlerFunc

Types

type TranslateValidate

type TranslateValidate struct {
	*ut.UniversalTranslator
	*validator.Validate
}

func (*TranslateValidate) BadRequest

func (tv *TranslateValidate) BadRequest(ctx *gin.Context, err error) (int, *cherry.Err)

func (*TranslateValidate) HandleError

func (tv *TranslateValidate) HandleError(err error) (int, *cherry.Err)

func (*TranslateValidate) ValidateHeaders

func (tv *TranslateValidate) ValidateHeaders(headerTagMap map[string]string) gin.HandlerFunc

type UserHeaderDataMap

type UserHeaderDataMap map[string]model.UserHeaderData

func ParseUserHeaderData

func ParseUserHeaderData(str string) (*UserHeaderDataMap, error)

ParseUserHeaderData decodes headers for substitutions

Jump to

Keyboard shortcuts

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