Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// Copyright 2017 Gerasimos Maropoulos, ΓΜ. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2016-09-09 07:09:03 +02:00
|
|
|
package iris
|
|
|
|
|
|
|
|
import (
|
2017-02-16 04:00:08 +01:00
|
|
|
"io/ioutil"
|
|
|
|
"path/filepath"
|
2016-10-11 21:35:12 +02:00
|
|
|
|
2017-03-05 23:08:58 +01:00
|
|
|
"github.com/BurntSushi/toml"
|
2017-02-16 04:00:08 +01:00
|
|
|
"gopkg.in/yaml.v2"
|
2016-09-09 07:09:03 +02:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
"github.com/kataras/iris/context"
|
|
|
|
"github.com/kataras/iris/core/errors"
|
2016-09-09 07:09:03 +02:00
|
|
|
)
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
var errConfigurationDecode = errors.New("error while trying to decode configuration")
|
2017-03-05 23:08:58 +01:00
|
|
|
|
|
|
|
// YAML reads Configuration from a configuration.yml file.
|
2017-02-16 04:00:08 +01:00
|
|
|
//
|
2017-03-05 23:08:58 +01:00
|
|
|
// Accepts the absolute path of the configuration.yml.
|
2017-02-16 04:00:08 +01:00
|
|
|
// An error will be shown to the user via panic with the error message.
|
2017-03-05 23:08:58 +01:00
|
|
|
// Error may occur when the configuration.yml doesn't exists or is not formatted correctly.
|
2017-02-16 04:00:08 +01:00
|
|
|
//
|
|
|
|
// Usage:
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// app := iris.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.YAML("myconfig.yml")))
|
2017-02-16 04:00:08 +01:00
|
|
|
func YAML(filename string) Configuration {
|
|
|
|
c := DefaultConfiguration()
|
|
|
|
|
|
|
|
// get the abs
|
|
|
|
// which will try to find the 'filename' from current workind dir too.
|
|
|
|
yamlAbsPath, err := filepath.Abs(filename)
|
|
|
|
if err != nil {
|
2017-03-05 23:08:58 +01:00
|
|
|
panic(errConfigurationDecode.AppendErr(err))
|
2017-02-16 04:00:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// read the raw contents of the file
|
|
|
|
data, err := ioutil.ReadFile(yamlAbsPath)
|
|
|
|
if err != nil {
|
2017-03-05 23:08:58 +01:00
|
|
|
panic(errConfigurationDecode.AppendErr(err))
|
2017-02-16 04:00:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// put the file's contents as yaml to the default configuration(c)
|
|
|
|
if err := yaml.Unmarshal(data, &c); err != nil {
|
2017-03-05 23:08:58 +01:00
|
|
|
panic(errConfigurationDecode.AppendErr(err))
|
2017-02-16 04:00:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return c
|
|
|
|
}
|
|
|
|
|
2017-03-05 23:08:58 +01:00
|
|
|
// TOML reads Configuration from a toml-compatible document file.
|
|
|
|
// Read more about toml's implementation at:
|
|
|
|
// https://github.com/toml-lang/toml
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Accepts the absolute path of the configuration file.
|
|
|
|
// An error will be shown to the user via panic with the error message.
|
|
|
|
// Error may occur when the file doesn't exists or is not formatted correctly.
|
|
|
|
//
|
|
|
|
// Usage:
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// app := iris.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.YAML("myconfig.tml")))
|
2017-03-05 23:08:58 +01:00
|
|
|
func TOML(filename string) Configuration {
|
|
|
|
c := DefaultConfiguration()
|
|
|
|
|
|
|
|
// get the abs
|
|
|
|
// which will try to find the 'filename' from current workind dir too.
|
|
|
|
tomlAbsPath, err := filepath.Abs(filename)
|
|
|
|
if err != nil {
|
|
|
|
panic(errConfigurationDecode.AppendErr(err))
|
|
|
|
}
|
|
|
|
|
|
|
|
// read the raw contents of the file
|
|
|
|
data, err := ioutil.ReadFile(tomlAbsPath)
|
|
|
|
if err != nil {
|
|
|
|
panic(errConfigurationDecode.AppendErr(err))
|
|
|
|
}
|
|
|
|
|
|
|
|
// put the file's contents as toml to the default configuration(c)
|
|
|
|
if _, err := toml.Decode(string(data), &c); err != nil {
|
|
|
|
panic(errConfigurationDecode.AppendErr(err))
|
|
|
|
}
|
|
|
|
// Author's notes:
|
|
|
|
// The toml's 'usual thing' for key naming is: the_config_key instead of TheConfigKey
|
|
|
|
// but I am always prefer to use the specific programming language's syntax
|
|
|
|
// and the original configuration name fields for external configuration files
|
|
|
|
// so we do 'toml: "TheConfigKeySameAsTheConfigField" instead.
|
|
|
|
return c
|
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// Configurator is just an interface which accepts the framework instance.
|
|
|
|
//
|
|
|
|
// It can be used to register a custom configuration with `Configure` in order
|
|
|
|
// to modify the framework instance.
|
|
|
|
//
|
|
|
|
// Currently Configurator is being used to describe the configuration's fields values.
|
|
|
|
type Configurator func(*Application)
|
|
|
|
|
|
|
|
// variables for configurators don't need any receivers, functions
|
|
|
|
// for them that need (helps code editors to recognise as variables without parenthesis completion).
|
|
|
|
|
|
|
|
// WithoutBanner turns off the write banner on server startup.
|
|
|
|
var WithoutBanner = func(app *Application) {
|
|
|
|
app.config.DisableBanner = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithoutInterruptHandler disables the automatic graceful server shutdown
|
|
|
|
// when control/cmd+C pressed.
|
|
|
|
var WithoutInterruptHandler = func(app *Application) {
|
|
|
|
app.config.DisableInterruptHandler = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithoutPathCorrection disables the PathCorrection setting.
|
|
|
|
//
|
|
|
|
// See` Configuration`.
|
|
|
|
var WithoutPathCorrection = func(app *Application) {
|
|
|
|
app.config.DisablePathCorrection = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithoutBodyConsumptionOnUnmarshal disables BodyConsumptionOnUnmarshal setting.
|
|
|
|
//
|
|
|
|
// See` Configuration`.
|
|
|
|
var WithoutBodyConsumptionOnUnmarshal = func(app *Application) {
|
|
|
|
app.config.DisableBodyConsumptionOnUnmarshal = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithoutAutoFireStatusCode disables the AutoFireStatusCode setting.
|
|
|
|
//
|
|
|
|
// See` Configuration`.
|
|
|
|
var WithoutAutoFireStatusCode = func(app *Application) {
|
|
|
|
app.config.DisableAutoFireStatusCode = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithPathEscape enanbles the PathEscape setting.
|
|
|
|
//
|
|
|
|
// See` Configuration`.
|
|
|
|
var WithPathEscape = func(app *Application) {
|
|
|
|
app.config.EnablePathEscape = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithFireMethodNotAllowed enanbles the FireMethodNotAllowed setting.
|
|
|
|
//
|
|
|
|
// See` Configuration`.
|
|
|
|
var WithFireMethodNotAllowed = func(app *Application) {
|
|
|
|
app.config.FireMethodNotAllowed = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithTimeFormat sets the TimeFormat setting.
|
|
|
|
//
|
|
|
|
// See` Configuration`.
|
|
|
|
func WithTimeFormat(timeformat string) Configurator {
|
|
|
|
return func(app *Application) {
|
|
|
|
app.config.TimeFormat = timeformat
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithCharset sets the Charset setting.
|
|
|
|
//
|
|
|
|
// See` Configuration`.
|
|
|
|
func WithCharset(charset string) Configurator {
|
|
|
|
return func(app *Application) {
|
|
|
|
app.config.Charset = charset
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithOtherValue adds a value based on a key to the Other setting.
|
|
|
|
//
|
|
|
|
// See` Configuration`.
|
|
|
|
func WithOtherValue(key string, val interface{}) Configurator {
|
|
|
|
return func(app *Application) {
|
|
|
|
if app.config.Other == nil {
|
|
|
|
app.config.Other = make(map[string]interface{}, 0)
|
|
|
|
}
|
|
|
|
app.config.Other[key] = val
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Configuration the whole configuration for an Iris instance
|
2017-02-16 02:26:02 +01:00
|
|
|
// these can be passed via options also, look at the top of this file(configuration.go).
|
|
|
|
// Configuration is a valid OptionSetter.
|
2016-09-09 07:09:03 +02:00
|
|
|
type Configuration struct {
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// vhost is private and setted only with .Run method, it cannot be changed after the first set.
|
|
|
|
// It can be retrieved by the context if needed (i.e router for subdomains)
|
|
|
|
vhost string
|
|
|
|
|
|
|
|
// DisableBanner if setted to true then it turns off the write banner on server startup.
|
2016-09-27 15:28:38 +02:00
|
|
|
//
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// Defaults to false.
|
|
|
|
DisableBanner bool `yaml:"DisableBanner" toml:"DisableBanner"`
|
|
|
|
// DisableInterruptHandler if setted to true then it disables the automatic graceful server shutdown
|
|
|
|
// when control/cmd+C pressed.
|
|
|
|
// Turn this to true if you're planning to handle this by your own via a custom host.Task.
|
2016-09-17 23:50:10 +02:00
|
|
|
//
|
2017-02-16 02:26:02 +01:00
|
|
|
// Defaults to false.
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
DisableInterruptHandler bool `yaml:"DisableInterruptHandler" toml:"DisableInterruptHandler"`
|
2016-09-16 09:02:18 +02:00
|
|
|
|
2017-01-10 14:03:02 +01:00
|
|
|
// DisablePathCorrection corrects and redirects the requested path to the registered path
|
2016-09-09 07:09:03 +02:00
|
|
|
// for example, if /home/ path is requested but no handler for this Route found,
|
|
|
|
// then the Router checks if /home handler exists, if yes,
|
|
|
|
// (permant)redirects the client to the correct path /home
|
|
|
|
//
|
2017-02-16 02:26:02 +01:00
|
|
|
// Defaults to false.
|
2017-03-05 23:08:58 +01:00
|
|
|
DisablePathCorrection bool `yaml:"DisablePathCorrection" toml:"DisablePathCorrection"`
|
2016-09-09 07:09:03 +02:00
|
|
|
|
2017-01-10 07:54:39 +01:00
|
|
|
// EnablePathEscape when is true then its escapes the path, the named parameters (if any).
|
|
|
|
// Change to false it if you want something like this https://github.com/kataras/iris/issues/135 to work
|
2016-09-09 07:09:03 +02:00
|
|
|
//
|
2017-01-10 07:54:39 +01:00
|
|
|
// When do you need to Disable(false) it:
|
2016-09-09 07:09:03 +02:00
|
|
|
// accepts parameters with slash '/'
|
|
|
|
// Request: http://localhost:8080/details/Project%2FDelta
|
|
|
|
// ctx.Param("project") returns the raw named parameter: Project%2FDelta
|
|
|
|
// which you can escape it manually with net/url:
|
|
|
|
// projectName, _ := url.QueryUnescape(c.Param("project").
|
|
|
|
//
|
2017-02-16 02:26:02 +01:00
|
|
|
// Defaults to false.
|
2017-03-05 23:08:58 +01:00
|
|
|
EnablePathEscape bool `yaml:"EnablePathEscape" toml:"EnablePathEscape"`
|
2016-09-09 07:09:03 +02:00
|
|
|
|
2017-02-16 02:26:02 +01:00
|
|
|
// FireMethodNotAllowed if it's true router checks for StatusMethodNotAllowed(405) and
|
|
|
|
// fires the 405 error instead of 404
|
|
|
|
// Defaults to false.
|
2017-03-05 23:08:58 +01:00
|
|
|
FireMethodNotAllowed bool `yaml:"FireMethodNotAllowed" toml:"FireMethodNotAllowed"`
|
2016-10-11 21:35:12 +02:00
|
|
|
|
2017-01-30 11:35:43 +01:00
|
|
|
// DisableBodyConsumptionOnUnmarshal manages the reading behavior of the context's body readers/binders.
|
|
|
|
// If setted to true then it
|
|
|
|
// disables the body consumption by the `context.UnmarshalBody/ReadJSON/ReadXML`.
|
|
|
|
//
|
|
|
|
// By-default io.ReadAll` is used to read the body from the `context.Request.Body which is an `io.ReadCloser`,
|
|
|
|
// if this field setted to true then a new buffer will be created to read from and the request body.
|
2017-02-16 02:26:02 +01:00
|
|
|
// The body will not be changed and existing data before the
|
|
|
|
// context.UnmarshalBody/ReadJSON/ReadXML will be not consumed.
|
2017-03-05 23:08:58 +01:00
|
|
|
DisableBodyConsumptionOnUnmarshal bool `yaml:"DisableBodyConsumptionOnUnmarshal" toml:"DisableBodyConsumptionOnUnmarshal"`
|
2017-01-30 11:35:43 +01:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// DisableAutoFireStatusCode if true then it turns off the http error status code handler automatic execution
|
|
|
|
// from "context.StatusCode(>=400)" and instead app should manually call the "context.FireStatusCode(>=400)".
|
|
|
|
//
|
|
|
|
// By-default a custom http error handler will be fired when "context.StatusCode(code)" called,
|
|
|
|
// code should be >=400 in order to be received as an "http error handler".
|
|
|
|
//
|
|
|
|
// Developer may want this option to setted as true in order to manually call the
|
|
|
|
// error handlers when needed via "context.FireStatusCode(>=400)".
|
|
|
|
// HTTP Custom error handlers are being registered via "framework.OnStatusCode(code, handler)".
|
|
|
|
//
|
|
|
|
// Defaults to false.
|
|
|
|
DisableAutoFireStatusCode bool `yaml:"DisableAutoFireStatusCode" toml:"DisableAutoFireStatusCode"`
|
|
|
|
|
2016-09-09 07:09:03 +02:00
|
|
|
// TimeFormat time format for any kind of datetime parsing
|
2017-02-17 09:45:47 +01:00
|
|
|
// Defaults to "Mon, 02 Jan 2006 15:04:05 GMT".
|
2017-03-05 23:08:58 +01:00
|
|
|
TimeFormat string `yaml:"TimeFormat" toml:"TimeFormat"`
|
2016-09-09 07:09:03 +02:00
|
|
|
|
|
|
|
// Charset character encoding for various rendering
|
|
|
|
// used for templates and the rest of the responses
|
2017-02-16 02:26:02 +01:00
|
|
|
// Defaults to "UTF-8".
|
2017-03-05 23:08:58 +01:00
|
|
|
Charset string `yaml:"Charset" toml:"Charset"`
|
2016-09-09 07:09:03 +02:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// +----------------------------------------------------+
|
|
|
|
// | Context's keys for values used on various featuers |
|
|
|
|
// +----------------------------------------------------+
|
|
|
|
|
|
|
|
// Context values' keys for various features.
|
|
|
|
//
|
|
|
|
// TranslateLanguageContextKey & TranslateFunctionContextKey are used by i18n handlers/middleware
|
|
|
|
// currently we have only one: https://github.com/kataras/iris/tree/master/middleware/i18n.
|
|
|
|
//
|
|
|
|
// Defaults to "iris.translate" and "iris.language"
|
|
|
|
TranslateFunctionContextKey string `yaml:"TranslateFunctionContextKey" toml:"TranslateFunctionContextKey"`
|
|
|
|
// TranslateLanguageContextKey used for i18n.
|
|
|
|
//
|
|
|
|
// Defaults to "iris.language"
|
|
|
|
TranslateLanguageContextKey string `yaml:"TranslateLanguageContextKey" toml:"TranslateLanguageContextKey"`
|
|
|
|
|
|
|
|
// GetViewLayoutContextKey is the key of the context's user values' key
|
|
|
|
// which is being used to set the template
|
|
|
|
// layout from a middleware or the main handler.
|
|
|
|
// Overrides the parent's or the configuration's.
|
|
|
|
//
|
|
|
|
// Defaults to "iris.ViewLayout"
|
|
|
|
ViewLayoutContextKey string `yaml:"ViewLayoutContextKey" toml:"ViewLayoutContextKey"`
|
|
|
|
// GetViewDataContextKey is the key of the context's user values' key
|
|
|
|
// which is being used to set the template
|
|
|
|
// binding data from a middleware or the main handler.
|
|
|
|
//
|
|
|
|
// Defaults to "iris.viewData"
|
|
|
|
ViewDataContextKey string `yaml:"ViewDataContextKey" toml:"ViewDataContextKey"`
|
2016-09-09 07:09:03 +02:00
|
|
|
|
2017-02-16 02:26:02 +01:00
|
|
|
// 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)
|
2017-02-21 23:51:50 +01:00
|
|
|
// Defaults to a non-nil empty map
|
2017-03-05 23:08:58 +01:00
|
|
|
Other map[string]interface{} `yaml:"Other" toml:"Other"`
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
var _ context.ConfigurationReadOnly = &Configuration{}
|
2017-02-21 23:51:50 +01:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// GetVHost returns the non-exported vhost config field.
|
|
|
|
//
|
|
|
|
// If original addr ended with :443 or :80, it will return the host without the port.
|
|
|
|
// If original addr was :https or :http, it will return localhost.
|
|
|
|
// If original addr was 0.0.0.0, it will return localhost.
|
|
|
|
func (c Configuration) GetVHost() string {
|
|
|
|
return c.vhost
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
// GetDisablePathCorrection returns the configuration.DisablePathCorrection,
|
|
|
|
// 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,
|
|
|
|
// then the Router checks if /home handler exists, if yes,
|
|
|
|
// (permant)redirects the client to the correct path /home.
|
|
|
|
func (c Configuration) GetDisablePathCorrection() bool {
|
|
|
|
return c.DisablePathCorrection
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetEnablePathEscape is the configuration.EnablePathEscape,
|
|
|
|
// returns true when its escapes the path, the named parameters (if any).
|
|
|
|
func (c Configuration) GetEnablePathEscape() bool {
|
|
|
|
return c.EnablePathEscape
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetFireMethodNotAllowed returns the configuration.FireMethodNotAllowed.
|
|
|
|
func (c Configuration) GetFireMethodNotAllowed() bool {
|
|
|
|
return c.FireMethodNotAllowed
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetDisableBodyConsumptionOnUnmarshal returns the configuration.GetDisableBodyConsumptionOnUnmarshal,
|
|
|
|
// manages the reading behavior of the context's body readers/binders.
|
|
|
|
// If returns true then the body consumption by the `context.UnmarshalBody/ReadJSON/ReadXML`
|
|
|
|
// is disabled.
|
|
|
|
//
|
|
|
|
// By-default io.ReadAll` is used to read the body from the `context.Request.Body which is an `io.ReadCloser`,
|
|
|
|
// 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.
|
|
|
|
func (c Configuration) GetDisableBodyConsumptionOnUnmarshal() bool {
|
|
|
|
return c.DisableBodyConsumptionOnUnmarshal
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetDisableAutoFireStatusCode returns the configuration.DisableAutoFireStatusCode.
|
|
|
|
// Returns true when the http error status code handler automatic execution turned off.
|
|
|
|
func (c Configuration) GetDisableAutoFireStatusCode() bool {
|
|
|
|
return c.DisableAutoFireStatusCode
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTimeFormat returns the configuration.TimeFormat,
|
|
|
|
// format for any kind of datetime parsing.
|
|
|
|
func (c Configuration) GetTimeFormat() string {
|
|
|
|
return c.TimeFormat
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetCharset returns the configuration.Charset,
|
|
|
|
// the character encoding for various rendering
|
|
|
|
// used for templates and the rest of the responses.
|
|
|
|
func (c Configuration) GetCharset() string {
|
|
|
|
return c.Charset
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTranslateFunctionContextKey returns the configuration's TranslateFunctionContextKey value,
|
|
|
|
// used for i18n.
|
|
|
|
func (c Configuration) GetTranslateFunctionContextKey() string {
|
|
|
|
return c.TranslateFunctionContextKey
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetTranslateLanguageContextKey returns the configuration's TranslateLanguageContextKey value,
|
|
|
|
// used for i18n.
|
|
|
|
func (c Configuration) GetTranslateLanguageContextKey() string {
|
|
|
|
return c.TranslateLanguageContextKey
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetViewLayoutContextKey returns the key of the context's user values' key
|
|
|
|
// which is being used to set the template
|
|
|
|
// layout from a middleware or the main handler.
|
|
|
|
// Overrides the parent's or the configuration's.
|
|
|
|
func (c Configuration) GetViewLayoutContextKey() string {
|
|
|
|
return c.ViewLayoutContextKey
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetViewDataContextKey returns the key of the context's user values' key
|
|
|
|
// which is being used to set the template
|
|
|
|
// binding data from a middleware or the main handler.
|
|
|
|
func (c Configuration) GetViewDataContextKey() string {
|
|
|
|
return c.ViewDataContextKey
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetOther returns the configuration.Other map.
|
|
|
|
func (c Configuration) GetOther() map[string]interface{} {
|
|
|
|
return c.Other
|
|
|
|
}
|
|
|
|
|
|
|
|
// WithConfiguration sets the "c" values to the framework's configurations.
|
|
|
|
//
|
|
|
|
// Usage:
|
|
|
|
// app.Run(iris.Addr(":8080"), iris.WithConfiguration(iris.Configuration{/* fields here */ }))
|
|
|
|
// or
|
|
|
|
// iris.WithConfiguration(iris.YAML("./cfg/iris.yml"))
|
|
|
|
// or
|
|
|
|
// iris.WithConfiguration(iris.TOML("./cfg/iris.tml"))
|
|
|
|
func WithConfiguration(c Configuration) Configurator {
|
|
|
|
return func(app *Application) {
|
|
|
|
main := app.config
|
|
|
|
|
|
|
|
if v := c.DisableBanner; v {
|
|
|
|
main.DisableBanner = v
|
2016-09-27 15:28:38 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.DisableInterruptHandler; v {
|
|
|
|
main.DisableInterruptHandler = v
|
2016-09-27 15:28:38 +02:00
|
|
|
}
|
2017-02-16 02:26:02 +01:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.DisablePathCorrection; v {
|
|
|
|
main.DisablePathCorrection = v
|
2016-09-27 15:28:38 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.EnablePathEscape; v {
|
|
|
|
main.EnablePathEscape = v
|
2016-09-27 15:28:38 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.FireMethodNotAllowed; v {
|
|
|
|
main.FireMethodNotAllowed = v
|
2016-09-16 09:02:18 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.DisableBodyConsumptionOnUnmarshal; v {
|
|
|
|
main.DisableBodyConsumptionOnUnmarshal = v
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.DisableAutoFireStatusCode; v {
|
|
|
|
main.DisableAutoFireStatusCode = v
|
|
|
|
}
|
2016-09-16 09:02:18 +02:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.TimeFormat; v != "" {
|
|
|
|
main.TimeFormat = v
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
2016-09-16 09:02:18 +02:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.Charset; v != "" {
|
|
|
|
main.Charset = v
|
2016-10-11 21:35:12 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.TranslateFunctionContextKey; v != "" {
|
|
|
|
main.TranslateFunctionContextKey = v
|
2017-01-30 11:35:43 +01:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.TranslateLanguageContextKey; v != "" {
|
|
|
|
main.TranslateLanguageContextKey = v
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
2016-09-16 09:02:18 +02:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.ViewLayoutContextKey; v != "" {
|
|
|
|
main.ViewLayoutContextKey = v
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
2016-09-16 09:02:18 +02:00
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.ViewDataContextKey; v != "" {
|
|
|
|
main.ViewDataContextKey = v
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
|
|
|
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
if v := c.Other; len(v) > 0 {
|
|
|
|
if main.Other == nil {
|
|
|
|
main.Other = make(map[string]interface{}, 0)
|
|
|
|
}
|
|
|
|
for key, value := range v {
|
|
|
|
main.Other[key] = value
|
2017-02-16 02:26:02 +01:00
|
|
|
}
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
|
|
|
}
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
}
|
2016-09-09 07:09:03 +02:00
|
|
|
|
|
|
|
// DefaultConfiguration returns the default configuration for an Iris station, fills the main Configuration
|
2017-02-16 04:00:08 +01:00
|
|
|
func DefaultConfiguration() Configuration {
|
|
|
|
return Configuration{
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
DisableBanner: false,
|
|
|
|
DisableInterruptHandler: false,
|
|
|
|
DisablePathCorrection: false,
|
|
|
|
EnablePathEscape: false,
|
2017-01-30 11:35:43 +01:00
|
|
|
FireMethodNotAllowed: false,
|
|
|
|
DisableBodyConsumptionOnUnmarshal: false,
|
Publish the new version :airplane: | Look description please!
# FAQ
### Looking for free support?
http://support.iris-go.com
https://kataras.rocket.chat/channel/iris
### Looking for previous versions?
https://github.com/kataras/iris#version
### Should I upgrade my Iris?
Developers are not forced to upgrade if they don't really need it. Upgrade whenever you feel ready.
> Iris uses the [vendor directory](https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo) feature, so you get truly reproducible builds, as this method guards against upstream renames and deletes.
**How to upgrade**: Open your command-line and execute this command: `go get -u github.com/kataras/iris`.
For further installation support, please click [here](http://support.iris-go.com/d/16-how-to-install-iris-web-framework).
### About our new home page
http://iris-go.com
Thanks to [Santosh Anand](https://github.com/santoshanand) the http://iris-go.com has been upgraded and it's really awesome!
[Santosh](https://github.com/santoshanand) is a freelancer, he has a great knowledge of nodejs and express js, Android, iOS, React Native, Vue.js etc, if you need a developer to find or create a solution for your problem or task, please contact with him.
The amount of the next two or three donations you'll send they will be immediately transferred to his own account balance, so be generous please!
Read more at https://github.com/kataras/iris/blob/master/HISTORY.md
Former-commit-id: eec2d71bbe011d6b48d2526eb25919e36e5ad94e
2017-06-03 22:22:52 +02:00
|
|
|
DisableAutoFireStatusCode: false,
|
|
|
|
TimeFormat: "Mon, Jan 02 2006 15:04:05 GMT",
|
|
|
|
Charset: "UTF-8",
|
|
|
|
TranslateFunctionContextKey: "iris.translate",
|
|
|
|
TranslateLanguageContextKey: "iris.language",
|
|
|
|
ViewLayoutContextKey: "iris.viewLayout",
|
|
|
|
ViewDataContextKey: "iris.viewData",
|
2017-02-16 02:26:02 +01:00
|
|
|
Other: make(map[string]interface{}, 0),
|
2016-09-09 07:09:03 +02:00
|
|
|
}
|
|
|
|
}
|