Update DONATIONS.md summary

This commit is contained in:
Gerasimos Maropoulos 2016-09-29 20:17:42 +03:00
parent f4b4dd0275
commit c2144a83c6
5 changed files with 23 additions and 22 deletions

View File

@ -27,6 +27,7 @@ I'm grateful for all the generous donations. Iris is fully funded by these dona
- [Ryan Brooks](https://github.com/ryanbyyc) donated 50 EUR at May 11
- [Juan Sebastián Suárez Valencia](https://github.com/Juanses) donated 20 EUR at September 11
- [Bob Lee](https://github.com/li3p) donated 20 EUR at September 16
- [Celso Luiz](https://github.com/celsosz) donated 50 EUR at September 29
> The name of the donator added after his/her permission.
@ -35,4 +36,4 @@ I'm grateful for all the generous donations. Iris is fully funded by these dona
- 13 EUR for the domain, [iris-go.com](https://iris-go.com)
**Available**: VAT(50) + VAT(20) + VAT(20) - 13 = 47,45 + 18,97 + 18,61 - 13 = 72,03 EUR
**Available**: VAT(50) + VAT(20) + VAT(20) + VAT(50) - 13 = 47,45 + 18,97 + 18,61 + 47,05 - 13 = 119,08 EUR

View File

@ -8,21 +8,21 @@
```go
// ...
iris.UsePreRender(func(ctx *iris.Context, filename string, binding interface{}, options ...map[string]interface{}) bool {
// put the 'Error' binding here, for the shake of the test
if b, isMap := binding.(map[string]interface{}); isMap {
b["Error"] = "error!"
}
// true= continue to the next PreRender
// false= do not continue to the next PreRender
// * but the actual Render will be called at any case *
return true
})
iris.UsePreRender(func(ctx *iris.Context, filename string, binding interface{}, options ...map[string]interface{}) bool {
// put the 'Error' binding here, for the shake of the test
if b, isMap := binding.(map[string]interface{}); isMap {
b["Error"] = "error!"
}
// true= continue to the next PreRender
// false= do not continue to the next PreRender
// * but the actual Render will be called at any case *
return true
})
iris.Get("/", func(ctx *Context) {
ctx.Render("hi.html", map[string]interface{}{"Username": "anybody"})
// hi.html: <h1>HI {{.Username}}. Error: {{.Error}}</h1>
})
iris.Get("/", func(ctx *Context) {
ctx.Render("hi.html", map[string]interface{}{"Username": "anybody"})
// hi.html: <h1>HI {{.Username}}. Error: {{.Error}}</h1>
})
// ...
```

View File

@ -499,14 +499,13 @@ const (
//
// Default buffer size is 8MB
DefaultWriteBufferSize = 8096
// DefaultServerName the response header of the 'Server' value when writes to the client
DefaultServerName = "iris"
)
var (
// DefaultLoggerOut is the default logger's output
DefaultLoggerOut = os.Stdout
// DefaultServerName the response header of the 'Server' value when writes to the client
DefaultServerName = ""
)
// DefaultConfiguration returns the default configuration for an Iris station, fills the main Configuration

View File

@ -362,7 +362,11 @@ func (s *Framework) Build() {
if s.ln != nil { // user called Listen functions or Serve,
// create the main server
s.fsrv = &fasthttp.Server{Name: DefaultServerName,
srvName := "iris"
if len(DefaultServerName) > 0 {
srvName += "_" + DefaultServerName
}
s.fsrv = &fasthttp.Server{Name: srvName,
MaxRequestBodySize: s.Config.MaxRequestBodySize,
ReadBufferSize: s.Config.ReadBufferSize,
WriteBufferSize: s.Config.WriteBufferSize,

View File

@ -62,9 +62,6 @@ func getCharsetOption(defaultValue string, options map[string]interface{}) strin
}
func (t *templateEngines) usePreRender(pre PreRender) {
if t.prerenders == nil {
t.prerenders = make([]PreRender, 0)
}
t.prerenders = append(t.prerenders, pre)
}