middleware

package
v0.0.0-...-2083224 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitContext

func InitContext() martini.Handler

InitContext init martini context

Types

type Context

type Context struct {
	render.Render
	C        martini.Context
	S        sessions.Session
	R        *http.Request
	W        http.ResponseWriter
	FormErr  binding.Errors
	Messages []string
	Errors   []string
	Response map[string]interface{}
	Session  map[string]interface{}
}

Context martini context

func (*Context) AddError

func (context *Context) AddError(err string)

AddError martini context add error

func (*Context) AddFieldError

func (context *Context) AddFieldError(field string, err string)

AddFieldError martini context add field error

func (*Context) AddMessage

func (context *Context) AddMessage(message string)

AddMessage martini context add message

func (*Context) Clear

func (context *Context) Clear()

Clear martini context clear all key

func (*Context) ClearError

func (context *Context) ClearError()

ClearError martini context clear all error

func (*Context) ClearMessages

func (context *Context) ClearMessages()

ClearMessages martini context clear all message

func (*Context) Delete

func (context *Context) Delete(key string)

Delete martini context delete key

func (*Context) FieldErrors

func (context *Context) FieldErrors() map[string]string

FieldErrors get FieldErrors

func (*Context) Get

func (context *Context) Get(key string) interface{}

Get martini context get value by key

func (*Context) HasCommonError

func (context *Context) HasCommonError() bool

HasCommonError martini context check if has common error

func (*Context) HasError

func (context *Context) HasError() bool

HasError martini context check if has error

func (*Context) HasFieldError

func (context *Context) HasFieldError() bool

HasFieldError check if has field error

func (*Context) HasMessage

func (context *Context) HasMessage() bool

HasMessage martini context check if has message

func (*Context) HasOverallError

func (context *Context) HasOverallError() bool

HasOverallError check if has overall error

func (*Context) JoinFormErrors

func (context *Context) JoinFormErrors(err binding.Errors)

JoinFormErrors martini context init

func (*Context) OverallErrors

func (context *Context) OverallErrors() map[string]string

OverallErrors get OverallErrors

func (*Context) SessionClear

func (context *Context) SessionClear()

SessionClear martini context clear session

func (*Context) SessionDelete

func (context *Context) SessionDelete(key string)

SessionDelete martini context delete session

func (*Context) SessionGet

func (context *Context) SessionGet(key string) interface{}

SessionGet martini context get session interface

func (*Context) SessionSet

func (context *Context) SessionSet(key string, val interface{})

SessionSet martini context set session

func (*Context) Set

func (context *Context) Set(key string, val interface{})

Set martini context set key

func (*Context) SetFormErrors

func (context *Context) SetFormErrors(err binding.Errors)

SetFormErrors martini context set form binding error

Jump to

Keyboard shortcuts

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