func TOML(filename string) Configuration {
	c := DefaultConfiguration()
	if filename == globalConfigurationKeyword {
		filename = homeConfigurationFilename(".tml")
		if _, err := os.Stat(filename); os.IsNotExist(err) {
			panic("default configuration file '" + filename + "' does not exist")
		}
	}
	tomlAbsPath, err := filepath.Abs(filename)
	if err != nil {
		panic(errConfigurationDecode.AppendErr(err))
	}
	data, err := ioutil.ReadFile(tomlAbsPath)
	if err != nil {
		panic(errConfigurationDecode.AppendErr(err))
	}
	if _, err := toml.Decode(string(data), &c); err != nil {
		panic(errConfigurationDecode.AppendErr(err))
	}
	return c
}
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.

Note: if the char '~' passed as "filename" then it tries to load and return
the configuration from the $home_directory + iris.tml,
see `WithGlobalConfiguration` for more information.

Usage:
app.Configure(iris.WithConfiguration(iris.YAML("myconfig.tml"))) or
app.Run([iris.Runner], iris.WithConfiguration(iris.YAML("myconfig.tml"))).
package iris
import (
	"io/ioutil"
	"os"
	"os/user"
	"path/filepath"
	"runtime"
	"github.com/BurntSushi/toml"
	"gopkg.in/yaml.v2"
	"github.com/kataras/iris/context"
	"github.com/kataras/iris/core/errors"
)
const globalConfigurationKeyword = "~"
func homeConfigurationFilename(ext string) string {
	return filepath.Join(homeDir(), "iris"+ext)
}
func homeDir() (home string) {
	u, err := user.Current()
	if u != nil && err == nil {
		home = u.HomeDir
	}
	if home == "" {
		home = os.Getenv("HOME")
	}
	if home == "" {
		if runtime.GOOS == "plan9" {
			home = os.Getenv("home")
		} else if runtime.GOOS == "windows" {
			home = os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
			if home == "" {
				home = os.Getenv("USERPROFILE")
			}
		}
	}
	return
}
var errConfigurationDecode = errors.New("error while trying to decode configuration")
func parseYAML(filename string) (Configuration, error) {
	c := DefaultConfiguration()
	yamlAbsPath, err := filepath.Abs(filename)
	if err != nil {
		return c, errConfigurationDecode.AppendErr(err)
	}
	data, err := ioutil.ReadFile(yamlAbsPath)
	if err != nil {
		return c, errConfigurationDecode.AppendErr(err)
	}
	if err := yaml.Unmarshal(data, &c); err != nil {
		return c, errConfigurationDecode.AppendErr(err)
	}
	return c, nil
}
func YAML(filename string) Configuration {
	if filename == globalConfigurationKeyword {
		filename = homeConfigurationFilename(".yml")
		if _, err := os.Stat(filename); os.IsNotExist(err) {
			panic("default configuration file '" + filename + "' does not exist")
		}
	}
	c, err := parseYAML(filename)
	if err != nil {
		panic(err)
	}
	return c
}