Set the yaml configuration fields identical to the original's Configuration fields. Update Readme

Former-commit-id: 2fa9f7985a16c5c292634d0140ee6b1959c04dbb
This commit is contained in:
Gerasimos (Makis) Maropoulos 2017-02-16 18:14:55 +02:00
parent dd1d6837d9
commit 1851d49b58
3 changed files with 84 additions and 76 deletions

View File

@ -1,5 +1,5 @@
<p align="center">
<a href="https://www.gitbook.com/book/kataras/iris/details">
<a href="https://godoc.org/gopkg.in/kataras/iris.v6">
<img width="500" src="https://raw.githubusercontent.com/kataras/iris/master/logo.jpg"
alt="Logo created by an Iris community member, https://github.com/OneebMalik"
title="Logo created by an Iris community member, https://github.com/OneebMalik">
@ -8,51 +8,74 @@
<br/>
<a href="https://travis-ci.org/kataras/iris"><img src="https://api.travis-ci.org/kataras/iris.svg?branch=v6&style=flat-square" alt="Build Status"></a>
<a href="http://goreportcard.com/report/kataras/iris"><img src="https://img.shields.io/badge/report%20card%20-a%2B-F44336.svg?style=flat-square" alt="http://goreportcard.com/report/kataras/iris"></a>
<a href="https://golang.org"><img src="https://img.shields.io/badge/powered_by-go-6362c2.svg?style=flat-square" alt="Built with GoLang"></a>
<a href="https://golang.org"><img src="https://img.shields.io/badge/platform-any-ec2eb4.svg?style=flat-square" alt="Cross framework"></a>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kataras2006%40hotmail%2ecom&lc=GR&item_name=Iris%20web%20framework&item_number=iriswebframeworkdonationid2016&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"><img src="https://img.shields.io/badge/open-%20source-thisismycolor.svg?logo=data:image%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiPjxwYXRoIGZpbGw9InJnYigyMjAsMjIwLDIyMCkiIGQ9Ik04ODYuNiwzMDUuM2MtNDUuNywyMDMuMS0xODcsMzEwLjMtNDA5LjYsMzEwLjNoLTc0LjFsLTUxLjUsMzI2LjloLTYybC0zLjIsMjEuMWMtMi4xLDE0LDguNiwyNi40LDIyLjYsMjYuNGgxNTguNWMxOC44LDAsMzQuNy0xMy42LDM3LjctMzIuMmwxLjUtOGwyOS45LTE4OS4zbDEuOS0xMC4zYzIuOS0xOC42LDE4LjktMzIuMiwzNy43LTMyLjJoMjMuNWMxNTMuNSwwLDI3My43LTYyLjQsMzA4LjktMjQyLjdDOTIxLjYsNDA2LjgsOTE2LjcsMzQ4LjYsODg2LjYsMzA1LjN6Ii8%2BPHBhdGggZmlsbD0icmdiKDIyMCwyMjAsMjIwKSIgZD0iTTc5MS45LDgzLjlDNzQ2LjUsMzIuMiw2NjQuNCwxMCw1NTkuNSwxMEgyNTVjLTIxLjQsMC0zOS44LDE1LjUtNDMuMSwzNi44TDg1LDg1MWMtMi41LDE1LjksOS44LDMwLjIsMjUuOCwzMC4ySDI5OWw0Ny4zLTI5OS42bC0xLjUsOS40YzMuMi0yMS4zLDIxLjQtMzYuOCw0Mi45LTM2LjhINDc3YzE3NS41LDAsMzEzLTcxLjIsMzUzLjItMjc3LjVjMS4yLTYuMSwyLjMtMTIuMSwzLjEtMTcuOEM4NDUuMSwxODIuOCw4MzMuMiwxMzAuOCw3OTEuOSw4My45TDc5MS45LDgzLjl6Ii8%2BPC9zdmc%2B" alt="Donation"></a>
<br/>
<a href="https://github.com/kataras/iris/blob/v6/HISTORY.md"><img src="https://img.shields.io/badge/%20version%20-%206.2.0%20-blue.svg?style=flat-square" alt="CHANGELOG/HISTORY"></a>
<a href="https://github.com/iris-contrib/examples"><img src="https://img.shields.io/badge/%20examples-repository-3362c2.svg?style=flat-square" alt="Examples"></a>
<a href="https://godoc.org/gopkg.in/kataras/iris.v6"><img src="https://img.shields.io/badge/%20docs-reference-5272B4.svg?style=flat-square" alt="Practical Guide/Docs"></a>
<a href="https://kataras.rocket.chat/channel/iris"><img src="https://img.shields.io/badge/%20community-chat-00BCD4.svg?style=flat-square" alt="Chat"></a><br/>
<br/>
Iris provides efficient and well-designed toolbox with robust set of features to<br/> <b>create your own
perfect high-performance web application</b> <br/>with unlimited portability using the Go Programming Language.
perfect high-performance web application</b> <br/>with unlimited potentials amd <b>portability</b>.
<br/><br/>
<b>Easy</b> to <a href="https://godoc.org/gopkg.in/kataras/iris.v6">learn</a> while it's highly customizable,
ideally suited for <br/> both experienced and novice developers.<br/><br/>
If you're coming from <a href="https://nodejs.org/en/">Node.js</a> world, this is the <a href="https://github.com/expressjs/express">expressjs</a> for the <a href="https://golang.org">Go Programming Language.</a>
<br/><br/>
</p>
Not just another Go Web Framework
----------
<p>
<a href="https://github.com/kataras/iris/blob/v6/HISTORY.md"><img src="https://img.shields.io/badge/%20codename%20-%20vNext%20-blue.svg?style=flat-square" alt="CHANGELOG/HISTORY"></a>
<a href="https://github.com/iris-contrib/examples"><img src="https://img.shields.io/badge/%20examples-repository-3362c2.svg?style=flat-square" alt="Examples"></a>
<a href="https://godoc.org/gopkg.in/kataras/iris.v6"><img src="https://img.shields.io/badge/%20docs-reference-5272B4.svg?style=flat-square" alt="Docs"></a>
<a href="https://kataras.rocket.chat/channel/iris"><img src="https://img.shields.io/badge/%20community-chat-00BCD4.svg?style=flat-square" alt="Chat"></a>
<a href="http://goreportcard.com/report/kataras/iris"><img src="https://img.shields.io/badge/report%20card%20-a%2B-F44336.svg?style=flat-square" alt="http://goreportcard.com/report/kataras/iris"></a>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=kataras2006%40hotmail%2ecom&lc=GR&item_name=Iris%20web%20framework&item_number=iriswebframeworkdonationid2016&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted"><img src="https://img.shields.io/badge/open-%20source-thisismycolor.svg?logo=data:image%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAwIDEwMDAiPjxwYXRoIGZpbGw9InJnYigyMjAsMjIwLDIyMCkiIGQ9Ik04ODYuNiwzMDUuM2MtNDUuNywyMDMuMS0xODcsMzEwLjMtNDA5LjYsMzEwLjNoLTc0LjFsLTUxLjUsMzI2LjloLTYybC0zLjIsMjEuMWMtMi4xLDE0LDguNiwyNi40LDIyLjYsMjYuNGgxNTguNWMxOC44LDAsMzQuNy0xMy42LDM3LjctMzIuMmwxLjUtOGwyOS45LTE4OS4zbDEuOS0xMC4zYzIuOS0xOC42LDE4LjktMzIuMiwzNy43LTMyLjJoMjMuNWMxNTMuNSwwLDI3My43LTYyLjQsMzA4LjktMjQyLjdDOTIxLjYsNDA2LjgsOTE2LjcsMzQ4LjYsODg2LjYsMzA1LjN6Ii8%2BPHBhdGggZmlsbD0icmdiKDIyMCwyMjAsMjIwKSIgZD0iTTc5MS45LDgzLjlDNzQ2LjUsMzIuMiw2NjQuNCwxMCw1NTkuNSwxMEgyNTVjLTIxLjQsMC0zOS44LDE1LjUtNDMuMSwzNi44TDg1LDg1MWMtMi41LDE1LjksOS44LDMwLjIsMjUuOCwzMC4ySDI5OWw0Ny4zLTI5OS42bC0xLjUsOS40YzMuMi0yMS4zLDIxLjQtMzYuOCw0Mi45LTM2LjhINDc3YzE3NS41LDAsMzEzLTcxLjIsMzUzLjItMjc3LjVjMS4yLTYuMSwyLjMtMTIuMSwzLjEtMTcuOEM4NDUuMSwxODIuOCw4MzMuMiwxMzAuOCw3OTEuOSw4My45TDc5MS45LDgzLjl6Ii8%2BPC9zdmc%2B" alt="Donation"></a>
<a href="https://travis-ci.org/kataras/iris"><img src="https://api.travis-ci.org/kataras/iris.svg?branch=v6&style=flat-square" alt="Build Status"></a>
</p>
- Iris is fully vendored. That means it is independent of any API changes in the used libraries and will work seamlessly in the future!
- Iris follows the latest tech trends around the world.
- Iris' features are visible to other web frameworks after some time. That means that Iris is followed by other go web frameworks.
- Iris is a high-performance tool, but it doesn't stops there. Performance depends on your application too, Iris helps you to make the right choices on every step.
- Familiar and easy API.
- Examples and Documentation for the most use cases and if you don't find something, just do an online search of the net/http way and adapt this way to Iris, Iris is not black-magic, I didn't invent the world.
- Iris is a low-level web framework, you know what you code on each single line.
- You'll never miss a thing from `net/http`, but if you do on some point, no problem because Iris is fully compatible with stdlib, you still have access to `http.ResponseWriter` and `http.Request`, you can adapt any third-party middleware of form `func(http.ResponseWriter, *http.Request, next http.HandlerFunc)` as well.
- Iris is a community-driven project, you suggest and I code.
- Unlike others, this repository is very active. When you post an issue, you get an answer in the next couple of minutes, hours at the worst. If you find a bug, I am obliged to fix it on the same day.
> Q: Why this framework is better than alternatives, does the author is, simply, better than other developers?
> A: Probably not, I don't think that I'm better than anyone else, I still learning every single day. The answer is that I have all the world's time to code for Iris the whole day, I don't have any obligations to anybody else, except you. I'd describe my self as a very dedicated FOSS developer.
Click the below animation to see what people say about Iris.
<a href="https://www.youtube.com/watch?v=jGx0LkuUs4A">
<img src="https://github.com/iris-contrib/website/raw/gh-pages/assets/gif_link_to_yt2.gif" alt="What people say" />
</a>
<a href="https://www.youtube.com/watch?v=jGx0LkuUs4A">
<img src="https://github.com/iris-contrib/website/raw/gh-pages/assets/gif_link_to_yt.gif" alt="What people say" />
</a>
</p>
Installation
-----------
@ -149,13 +172,11 @@ func getByIDHandler(ctx *iris.Context) {
Documentation
-----------
<a href="https://www.gitbook.com/book/kataras/iris/details"><img align="right" width="125" src="https://raw.githubusercontent.com/iris-contrib/website/gh-pages/assets/book/cover_4.jpg"></a>
<a href="https://godoc.org/gopkg.in/kataras/iris.v6"><img align="right" width="125" src="https://raw.githubusercontent.com/iris-contrib/website/gh-pages/assets/book/cover_4.jpg"></a>
- The most important is to know where to find the [details](https://godoc.org/gopkg.in/kataras/iris.v6)
- Read [the practical guide](https://docs.iris-go.com/)
- Navigate through [examples](https://github.com/iris-contrib/examples)
- [HISTORY.md](https://github.com//kataras/iris/tree/v6/HISTORY.md) file is your best friend.
@ -223,7 +244,7 @@ Besides the fact that we have a [community chat][Chat] for questions or reports
Versioning
------------
Current: **v6.2.0**
Current: **v6**, code-named as "vNext"
v5: https://github.com/kataras/iris/tree/5.0.0

View File

@ -90,7 +90,7 @@ type Configuration struct {
// listening to the $instance.Handler after the manually-called $instance.Build
//
// Default comes from iris.Default.Listen/.Serve with iris' listeners (iris.TCP4/UNIX/TLS/LETSENCRYPT).
VHost string `yaml:"vHost"`
VHost string `yaml:"VHost"`
// VScheme is the scheme (http:// or https://) putted at the template function '{{url }}'
// It's an optional field,
@ -101,20 +101,20 @@ type Configuration struct {
// addr only(http://) but the nginx mapper is listening to https://
//
// Default comes from iris.Default.Listen/.Serve with iris' listeners (TCP4,UNIX,TLS,LETSENCRYPT).
VScheme string `yaml:"vScheme"`
VScheme string `yaml:"VScheme"`
// ReadTimeout is the maximum duration before timing out read of the request.
ReadTimeout time.Duration `yaml:"readTimeout"`
ReadTimeout time.Duration `yaml:"ReadTimeout"`
// WriteTimeout is the maximum duration before timing out write of the response.
WriteTimeout time.Duration `yaml:"writeTimeout"`
WriteTimeout time.Duration `yaml:"WriteTimeout"`
// MaxHeaderBytes controls the maximum number of bytes the
// server will read parsing the request header's keys and
// values, including the request line. It does not limit the
// size of the request body.
// If zero, DefaultMaxHeaderBytes is used.
MaxHeaderBytes int `yaml:"maxHeaderBytes"`
MaxHeaderBytes int `yaml:"MaxHeaderBytes"`
// CheckForUpdates will try to search for newer version of Iris based on the https://github.com/kataras/iris/releases
// If a newer version found then the app will ask the he dev/user if want to update the 'x' version
@ -130,7 +130,7 @@ type Configuration struct {
// Usage: app := iris.New(iris.Configuration{CheckForUpdates: true})
//
// Defaults to false.
CheckForUpdates bool `yaml:"checkForUpdates"`
CheckForUpdates bool `yaml:"CheckForUpdates"`
// DisablePathCorrection corrects and redirects the requested path to the registered path
// for example, if /home/ path is requested but no handler for this Route found,
@ -151,17 +151,17 @@ type Configuration struct {
// projectName, _ := url.QueryUnescape(c.Param("project").
//
// Defaults to false.
EnablePathEscape bool `yaml:"enablePathEscape"`
EnablePathEscape bool `yaml:"EnablePathEscape"`
// FireMethodNotAllowed if it's true router checks for StatusMethodNotAllowed(405) and
// fires the 405 error instead of 404
// Defaults to false.
FireMethodNotAllowed bool `yaml:"fireMethodNotAllowed"`
FireMethodNotAllowed bool `yaml:"FireMethodNotAllowed"`
// DisableBanner outputs the iris banner at startup
//
// Defaults to false.
DisableBanner bool `yaml:"disableBanner"`
DisableBanner bool `yaml:"DisableBanner"`
// DisableBodyConsumptionOnUnmarshal manages the reading behavior of the context's body readers/binders.
// If setted to true then it
@ -171,29 +171,29 @@ type Configuration struct {
// if this field setted to true then a new buffer will be created to read from and the request body.
// The body will not be changed and existing data before the
// context.UnmarshalBody/ReadJSON/ReadXML will be not consumed.
DisableBodyConsumptionOnUnmarshal bool `yaml:"disableBodyConsumptionOnUnmarshal"`
DisableBodyConsumptionOnUnmarshal bool `yaml:"DisableBodyConsumptionOnUnmarshal"`
// TimeFormat time format for any kind of datetime parsing
// Defauls to "Mon, 02 Jan 2006 15:04:05 GMT".
TimeFormat string `yaml:"timeFormat"`
TimeFormat string `yaml:"TimeFormat"`
// Charset character encoding for various rendering
// used for templates and the rest of the responses
// Defaults to "UTF-8".
Charset string `yaml:"charset"`
Charset string `yaml:"Charset"`
// Gzip enables gzip compression on your Render actions, this includes any type of render,
// templates and pure/raw content
// If you don't want to enable it globally, you could just use the third parameter
// on context.Render("myfileOrResponse", structBinding{}, iris.RenderOptions{"gzip": true})
// Defaults to false.
Gzip bool `yaml:"gzip"`
Gzip bool `yaml:"Gzip"`
// Other are the custom, dynamic options, can be empty.
// This field used only by you to set any app's options you want
// or by custom adaptors, it's a way to simple communicate between your adaptors (if any)
// Defaults to a non-nil empty map.
Other map[string]interface{} `yaml:"other"`
Other map[string]interface{} `yaml:"Other"`
}
// Set implements the OptionSetter

View File

@ -103,33 +103,20 @@ func TestConfigurationYAML(t *testing.T) {
}()
yamlConfigurationContents := `
vHost: iris-go.com
vScheme: https://
readTimeout: 0
writeTimeout: 5s
maxHeaderBytes: 8096
checkForUpdates: true
disablePathCorrection: false
enablePathEscape: false
fireMethodNotAllowed: true
disableBanner: true
disableBodyConsumptionOnUnmarshal: true
timeFormat: Mon, 01 Jan 2006 15:04:05 GMT
charset: UTF-8
gzip: true
VHost: iris-go.com
VScheme: https://
ReadTimeout: 0
WriteTimeout: 5s
MaxHeaderBytes: 8096
CheckForUpdates: true
DisablePathCorrection: false
EnablePathEscape: false
FireMethodNotAllowed: true
DisableBanner: true
DisableBodyConsumptionOnUnmarshal: true
TimeFormat: Mon, 01 Jan 2006 15:04:05 GMT
Charset: UTF-8
Gzip: true
`
yamlFile.WriteString(yamlConfigurationContents)