Documentation
¶
Index ¶
- Constants
- func DisableLog()
- func Print()
- func Register(method, path string, handlerFuncs ...handlerFunc)
- func SetDefaultHandler(status int16, handler handlerFunc)
- func WapEPoll(buf []byte) []byte
- func WrapStd(conn net.Conn, typ string)
- type AbortI
- type ControlStrategy
- type GroupI
- type ReqCxtI
- type RequestContext
- func (rc *RequestContext) Abort(status int16, message interface{})
- func (rc *RequestContext) Get(key string) interface{}
- func (ac RequestContext) GetAbortMessage() []byte
- func (rc *RequestContext) GetFile() multipart.File
- func (rc *RequestContext) GetFileName() string
- func (rc *RequestContext) GetMethod() string
- func (rc *RequestContext) GetPath() string
- func (rc *RequestContext) GetQuery(key, dft string) string
- func (rsp RequestContext) JSON(status int16, response interface{})
- func (ac RequestContext) NewAbort(status int16, message interface{}) *abortContext
- func (rc *RequestContext) Next(handlerFunc handlerFunc)
- func (rc *RequestContext) ParseBody(dst interface{}) error
- func (rc *RequestContext) RegisterStrategy(strategy *StrategyContext)
- func (rc *RequestContext) SaveLocalFile(dst string)
- func (rc *RequestContext) Set(key string, val interface{})
- func (rsp RequestContext) SetStopTime(t time.Time)
- type RspCtxI
- type StrategyContext
- type StrategyI
Constants ¶
View Source
const ( Std mod = iota EPoll )
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
func SetDefaultHandler ¶
func SetDefaultHandler(status int16, handler handlerFunc)
Types ¶
type ControlStrategy ¶
type ControlStrategy interface {
Do() bool
}
type GroupI ¶
type ReqCxtI ¶
type ReqCxtI interface { RspCtxI AbortI StrategyI // Abort response with status // setAbort can make the current flow stop. // set the stop time & set the finished flag true Abort(status int16, message interface{}) // Set into sync.map Set(key string, val interface{}) // Get from sync.map Get(key string) interface{} // Push calling push when execute a HandlerFunc and push the next Handler // to execute or jump to anther HandlerFunc to deal with the request. Next(handlerFunc handlerFunc) GetQuery(key, dft string) string // ParseBody turn the body bytes to dst ParseBody(dst interface{}) error // RegisterStrategy register the customized strategy RegisterStrategy(strategy *StrategyContext) SaveLocalFile(dst string) }
type RequestContext ¶
type RequestContext struct { *StrategyContext // contains filtered or unexported fields }
RequestContext contains all the engine when a req has triggered
func (*RequestContext) Abort ¶
func (rc *RequestContext) Abort(status int16, message interface{})
func (*RequestContext) Get ¶
func (rc *RequestContext) Get(key string) interface{}
func (RequestContext) GetAbortMessage ¶
func (ac RequestContext) GetAbortMessage() []byte
func (*RequestContext) GetFile ¶
func (rc *RequestContext) GetFile() multipart.File
func (*RequestContext) GetFileName ¶
func (rc *RequestContext) GetFileName() string
func (*RequestContext) GetMethod ¶
func (rc *RequestContext) GetMethod() string
func (*RequestContext) GetPath ¶
func (rc *RequestContext) GetPath() string
func (*RequestContext) GetQuery ¶
func (rc *RequestContext) GetQuery(key, dft string) string
func (RequestContext) NewAbort ¶
func (ac RequestContext) NewAbort(status int16, message interface{}) *abortContext
func (*RequestContext) Next ¶
func (rc *RequestContext) Next(handlerFunc handlerFunc)
func (*RequestContext) ParseBody ¶
func (rc *RequestContext) ParseBody(dst interface{}) error
func (*RequestContext) RegisterStrategy ¶
func (rc *RequestContext) RegisterStrategy(strategy *StrategyContext)
func (*RequestContext) SaveLocalFile ¶
func (rc *RequestContext) SaveLocalFile(dst string)
func (*RequestContext) Set ¶
func (rc *RequestContext) Set(key string, val interface{})
func (RequestContext) SetStopTime ¶
type StrategyContext ¶
type StrategyContext struct { // time to live, stack execute profundity. Ttl int32 // set Async identification to inform program to execute // the method by asynchronous. TimeOut option is an async true Timeout time.Duration Async bool // fusing resistor to protect the third part dependency. // or other purpose that you made. Fusing ControlStrategy // for security reason, attack recognition or any other optional // functions can be made && check here. Security ControlStrategy // contains filtered or unexported fields }
strategy is under developing now, it functions will enhanced later
func (*StrategyContext) SetTTL ¶
func (s *StrategyContext) SetTTL(t int32)
SetTTL the stack is inc 1 to the t set
func (*StrategyContext) SetTimeOut ¶
func (s *StrategyContext) SetTimeOut(t time.Duration)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.