helper

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// V2
	ActionFuncMap = make(map[string]func(*MicroRequest) int, 0)
	MiddleFuncMap = make(map[string]func(*MicroRequest) bool, 0)
)

request method set

Functions

func DD

func DD(o ...interface{})

func Err

func Err(msg ...interface{})

func Inf

func Inf(msg ...interface{})

func PPP

func PPP(msg ...interface{})

func PackSize added in v1.0.0

func PackSize(v int, uint string) string

auto covert content length B/KB/MB/GB/TB

func RegisterHandler

func RegisterHandler(h interface{})

func Wrn

func Wrn(msg ...interface{})

Types

type AfterCall added in v1.0.0

type AfterCall interface {
	After(*MicroRequest) bool
}

middle function call

type BeforeCall added in v1.0.0

type BeforeCall interface {
	Before(*MicroRequest) bool
}

middle function call on before

type MicroRequest added in v1.0.0

type MicroRequest struct {
	R *http.Request
	W http.ResponseWriter
	M *Middle
}

type Middle added in v1.0.0

type Middle struct {
	// contains filtered or unexported fields
}

func (*Middle) After added in v1.0.0

func (m *Middle) After() *Middle

func (*Middle) Before added in v1.0.0

func (m *Middle) Before() *Middle

func (*Middle) Global added in v1.0.0

func (m *Middle) Global() *Middle

func (*Middle) Set added in v1.0.0

func (m *Middle) Set(v interface{}) (update bool, err error)

func (*Middle) Value added in v1.0.0

func (m *Middle) Value() (v interface{}, has bool)

type ROUTER

type ROUTER struct{}

func (ROUTER) CrossHeader

func (ROUTER) CrossHeader(w http.ResponseWriter)

func (ROUTER) ServeHTTP

func (ROUTER) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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