Documentation
¶
Index ¶
Constants ¶
View Source
const ( KOA_EVENT_START = "start" // 启动完毕 KOA_EVENT_ERROR = "error" // 发生错误 KOA_EVENT_CLOSE = "close" // 应用关闭 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct { Req *http.Request Res http.ResponseWriter Request *KoaRequest Response *KoaResponse Cookies *koaCookies State map[string]any // contains filtered or unexported fields }
* 应用上下文,存储例如db,request等数据
type KoaConfig ¶
type KoaConfig struct {
// contains filtered or unexported fields
}
func NewKoaConfig ¶
func NewKoaConfig() *KoaConfig
type KoaRequest ¶
type KoaRequest struct { Body any // contains filtered or unexported fields }
type KoaResponse ¶
type KoaResponse struct { Body any // contains filtered or unexported fields }
func (*KoaResponse) GetStatus ¶
func (this *KoaResponse) GetStatus() int
func (*KoaResponse) HasSentHeader ¶
func (this *KoaResponse) HasSentHeader() bool
func (*KoaResponse) Header ¶
func (this *KoaResponse) Header() http.Header
func (*KoaResponse) SetCookie ¶
func (this *KoaResponse) SetCookie(cookie *http.Cookie)
func (*KoaResponse) SetStatus ¶
func (this *KoaResponse) SetStatus(status int)
func (*KoaResponse) Write ¶
func (this *KoaResponse) Write(bytes []byte) error
type PluginMultiArg ¶
type PluginMultiArg func(ctx *Context, next func())
func (PluginMultiArg) Call ¶
func (this PluginMultiArg) Call(ctx *Context)
type PluginSingleArg ¶
type PluginSingleArg func(ctx *Context)
func (PluginSingleArg) Call ¶
func (this PluginSingleArg) Call(ctx *Context)
Click to show internal directories.
Click to hide internal directories.