From 3e5f61ff6bdb51117c49a213b216ac306d518b73 Mon Sep 17 00:00:00 2001 From: esemplastic Date: Wed, 12 Apr 2017 00:56:57 +0300 Subject: [PATCH] Fix httpcache sub-package. Former-commit-id: d0bf86713bda90ade130c93dcf04d9b26f1e4f08 --- HISTORY.md | 28 ++++++++++++++++++++++++++++ context.go | 10 +++++++--- iris.go | 4 ---- policy.go | 2 +- 4 files changed, 36 insertions(+), 8 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 656cbdac..9ee1e464 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -9,6 +9,34 @@ ## 6.1.4 -> 6.2.0 (√Νεxτ) +_Update: 12 April 2017_ + +``` +Many of you, including myself, thought that Gerasimos is not accepting any PRs, this is wrong. + +I did a long PR, which actually fixes some bugs and integrations with the godep tool, on a project that he's contributing too. + +The next day I'm logged into my personal twitter and I saw a message written by him. + +He, @kataras, wrote me that he was really impressed by the time I spent to actually fix a bug on an Iris sub-project. +He told me that no one did that before and he asked me if I have more time to help these days on the Iris project too. + +And, Here I am! Introducing myself to the most clever community! +``` + +``` +Hello, +my name is Esemplastic. + +Iris' author, @kataras, is very busy these days on designing the new Iris' release which will contain even more prototypes and it will break any rules you knew so far. +I took a sneak preview of it, don't tell to him! + + +I'm the temporary maintainer of this open-source project and your new friend. +``` + +- **FIX**: Upgrade the [httpcache](https://github.com/geekypanda/httpcache) vendor. As requested [here](http://support.iris-go.com/d/44-upgrade-httpcache-module). + _Update: 28 March 2017_ diff --git a/context.go b/context.go index aa6309c0..4d5f6988 100644 --- a/context.go +++ b/context.go @@ -199,11 +199,15 @@ func (c *contextPool) Run(w http.ResponseWriter, r *http.Request, runner func(*C type ( // Map is just a conversion for a map[string]interface{} - // should not be used inside Render when PongoEngine is used. Map map[string]interface{} - // Context is resetting every time a request is coming to the server - // it is not good practice to use this object in goroutines, for these cases use the .Clone() + // Context is the "midle-man"" server's object for the clients. + // + // A New Context is being acquired from a sync.Pool on each connection. + // The Context is the most important thing on the Iris' http flow. + // + // Developers send responses to the client's request through a Context. + // Developers get request information from the client's request a Context. Context struct { ResponseWriter // *responseWriter by default, when record is on then *ResponseRecorder Request *http.Request diff --git a/iris.go b/iris.go index f4d52191..8bfa6d24 100644 --- a/iris.go +++ b/iris.go @@ -722,10 +722,6 @@ func (c *cachedMuxEntry) Serve(ctx *Context) { // ctx.WriteString("Hello, world!") // or a template or anything else // }, time.Duration(10*time.Second))) // duration of expiration // if <=time.Second then it tries to find it though request header's "cache-control" maxage value -// -// Note that it depends on a station instance's cache service. -// Do not try to call it from default' station if you use the form of app := iris.New(), -// use the app.Cache instead of iris.Cache func (s *Framework) Cache(bodyHandler HandlerFunc, expiration time.Duration) HandlerFunc { ce := newCachedMuxEntry(s, bodyHandler, expiration) return ce.Serve diff --git a/policy.go b/policy.go index bc30822f..047d52cd 100644 --- a/policy.go +++ b/policy.go @@ -107,7 +107,7 @@ const ( // Arguments should be handled in the manner of fmt.Printf. type LoggerPolicy func(mode LogMode, log string) -// Adapt addapts a Logger to the main policies. +// Adapt adapts a Logger to the main policies. func (l LoggerPolicy) Adapt(frame *Policies) { if l != nil { // notes for me: comment these in order to remember