iface

package
v0.1.140 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IAccessLogFormat added in v0.1.9

type IAccessLogFormat interface {
	Format(IContext) string
}

type IBind

type IBind interface {
	GetBindInfo(v interface{}) interface{}
}

type IComponentFunc

type IComponentFunc func(config map[string]interface{}) (interface{}, error)

type IContext

type IContext interface {
	HttpRW(debug, enableAccessLog bool, r *http.Request, w http.ResponseWriter)
	Process(plugins []IPlugin)
	Notice(format string, v ...interface{})
	Debug(format string, v ...interface{})
	Info(format string, v ...interface{})
	Warn(format string, v ...interface{})
	Error(format string, v ...interface{})
	Fatal(format string, v ...interface{})
	FinishGoLog()
	Cache(name string, rv reflect.Value)
	Next()
	Abort()
	Copy() IContext
	ElapseMs() int
	LogId() string
	Status() int
	Size() int
	SetInput(r *http.Request)
	Input() *http.Request
	SetOutput(w http.ResponseWriter)
	Output() http.ResponseWriter
	SetControllerId(id string)
	ControllerId() string
	SetActionId(id string)
	ActionId() string
	SetUserData(key string, data interface{})
	UserData(key string, dft interface{}) interface{}
	Method() string
	Query(name, dft string) string
	QueryAll() map[string]string
	Post(name, dft string) string
	PostAll() map[string]string
	Param(name, dft string) string
	ParamAll() map[string]string
	ParamMap(name string) map[string]string
	QueryMap(name string) map[string]string
	PostMap(name string) map[string]string
	ParamArray(name string) []string
	QueryArray(name string) []string
	PostArray(name string) []string
	Cookie(name, dft string) string
	CookieAll() map[string]string
	Header(name, dft string) string
	HeaderAll() map[string]string
	Path() string
	ClientIp() string
	ValidateQuery(name string, dft ...interface{}) *validate.String
	ValidatePost(name string, dft ...interface{}) *validate.String
	ValidateParam(name string, dft ...interface{}) *validate.String
	SetHeader(name, value string)
	SetCookie(cookie *http.Cookie)
	End(status int, data []byte)
	PushLog(key string, v interface{})
	Counting(key string, hit, total int)
	ProfileStart(key string)
	ProfileStop(key string)
	ProfileAdd(key string, elapse time.Duration)
	PushLogString() string
	CountingString() string
	ProfileString() string
	SetAccessLogFormat(v IAccessLogFormat)
	SetEnableAccessLog(v bool)
	SetProfileEnable(v bool)
}

type IController

type IController interface {
	BeforeAction(action string)
	AfterAction(action string)
	HandlePanic(v interface{}, debug bool)
	Response(v interface{}, err error)
}

type IErrorController added in v0.1.1

type IErrorController interface {
	Error(status int, message string)
}

type IEvent

type IEvent interface {
	HandleEvent(event string, ctx IContext, args ...interface{})
}

type II18n

type II18n interface {
	Translate(message, lang string, params ...interface{}) string
}

type IObjPoolFunc

type IObjPoolFunc func(obj IObject, params ...interface{}) IObject

type IObjSingleFunc

type IObjSingleFunc func(params ...interface{}) IObject

type IObject

type IObject interface {
	SetContext(ctx IContext) IObject
	Context() IContext
	GetObj(obj IObject) IObject
	GetObjPool(className string, funcName IObjPoolFunc, params ...interface{}) IObject
	GetObjBox(className string, params ...interface{}) IObject
	GetObjSingle(name string, funcName IObjSingleFunc, params ...interface{}) IObject
	GetObjPoolCtx(ctr IContext, className string, funcName IObjPoolFunc, params ...interface{}) IObject
	GetObjBoxCtx(ctx IContext, className string, params ...interface{}) IObject
	GetObjCtx(ctx IContext, obj IObject) IObject
	GetObjSingleCtx(ctx IContext, name string, funcName IObjSingleFunc, params ...interface{}) IObject
}

type IPlugin

type IPlugin interface {
	HandleRequest(ctx IContext)
}

type IStatus

type IStatus interface {
	Text(status int, lang string, dft ...string) string
}

type IView

type IView interface {
	AddFuncMap(funcMap template.FuncMap)
	Render(view string, data interface{}) []byte
	Display(w io.Writer, view string, data interface{})
}

Jump to

Keyboard shortcuts

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