Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Fixes and enhancement. Deprecate some methods (not removed)

Latest
Compare
Choose a tag to compare
@metal3d metal3d released this 13 Nov 00:06
· 19 commits to master since this release

Accept HTTP Methods with parameters

Now, we can use HTTP Method with parameter. Eg.

// Response to route {username:.*}/{version:\d+} 
func (handler *MyHandler) Get(username string, version int) {
}

Deprecates

Deprecate functions (still working but will disapear in 1.1), a warining message appears on terminal if you're still using them:

  • BaseHandler.GetApp() => App()
  • BaseHandler.GetResponse() => Response()
  • BaseHandler.GetRequest() => Request()
  • BaseHandler.GetPost(name string) => PostVar(string)
  • BaseHandler.GetURL(s ...string) => URL(...string)
  • BaseHandler.GetPayload() => PayLoad
  • BaseHandler.GetPostValues() => PostValues()
  • BaseHandler.GetJSONPayload(v interface{}) => JSONPayload(interface{})
  • RequestHandler.GlobalCtx() => App().Context

Fix static file server

StaticHandler is now working with partial content, it uses etags and serve directly from net/http package (FileServer)