From 17a44afd7cb2249356f911203ec83ca1c4d50e8b Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 7 Jan 2021 10:52:58 +0800 Subject: [PATCH] 1 --- context.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/context.go b/context.go index b640b83..c9cab19 100644 --- a/context.go +++ b/context.go @@ -41,6 +41,14 @@ func (this *Context) Abort() { this.aborted = true } +func (this *Context) Method() string { + return this.r.Method +} + +func (this *Context) GetRemoteAddr() string { + return q5.GetRequestRemoteAddr(this.r) +} + func (this *Context) Request(name string) *q5.XValue { return q5.Request(this.r, name) } @@ -72,6 +80,10 @@ func (this *Context) ResponseOk() { q5.ResponseOk(this.w) } +func (this *Context) ResponseInt32Ok(key string, val int32) { + q5.ResponseInt32Ok(this.w, key, val) +} + func (this *Context) Set(key string, val interface{}) { if this.userData == nil { this.userData = make(map[string]interface{})