mirror of
https://github.com/kataras/iris.git
synced 2025-12-21 03:47:04 +00:00
Read https://github.com/kataras/iris/tree/master/HISTORY.md
This commit is contained in:
@@ -4,21 +4,24 @@ import (
|
||||
"github.com/imdario/mergo"
|
||||
)
|
||||
|
||||
// DefaultProfilePath is the default profile(http debug) path which is /debug/pprof
|
||||
const DefaultProfilePath = "/debug/pprof"
|
||||
// Default values for base Iris conf
|
||||
const (
|
||||
DefaultDisablePathCorrection = false
|
||||
DefaultDisablePathEscape = false
|
||||
)
|
||||
|
||||
type (
|
||||
// Iris configs for the station
|
||||
// All fields can be changed before server's listen except the DisablePathCorrection field
|
||||
//
|
||||
// MaxRequestBodySize is the only options that can be changed after server listen -
|
||||
// using Config().MaxRequestBodySize = ...
|
||||
// using Config.MaxRequestBodySize = ...
|
||||
// Render's rest config can be changed after declaration but before server's listen -
|
||||
// using Config().Render.Rest...
|
||||
// using Config.Render.Rest...
|
||||
// Render's Template config can be changed after declaration but before server's listen -
|
||||
// using Config().Render.Template...
|
||||
// using Config.Render.Template...
|
||||
// Sessions config can be changed after declaration but before server's listen -
|
||||
// using Config().Sessions...
|
||||
// using Config.Sessions...
|
||||
// and so on...
|
||||
Iris struct {
|
||||
|
||||
@@ -56,40 +59,57 @@ type (
|
||||
// By default request body size is -1, unlimited.
|
||||
MaxRequestBodySize int64
|
||||
|
||||
// Profile set to true to enable web pprof (debug profiling)
|
||||
// Default is false, enabling makes available these 7 routes:
|
||||
// /debug/pprof/cmdline
|
||||
// /debug/pprof/profile
|
||||
// /debug/pprof/symbol
|
||||
// /debug/pprof/goroutine
|
||||
// /debug/pprof/heap
|
||||
// /debug/pprof/threadcreate
|
||||
// /debug/pprof/pprof/block
|
||||
Profile bool
|
||||
|
||||
// ProfilePath change it if you want other url path than the default
|
||||
// Default is /debug/pprof , which means yourhost.com/debug/pprof
|
||||
// ProfilePath a the route path, set it to enable http pprof tool
|
||||
// Default is empty, if you set it to a $path, these routes will handled:
|
||||
// $path/cmdline
|
||||
// $path/profile
|
||||
// $path/symbol
|
||||
// $path/goroutine
|
||||
// $path/heap
|
||||
// $path/threadcreate
|
||||
// $path/pprof/block
|
||||
// for example if '/debug/pprof'
|
||||
// http://yourdomain:PORT/debug/pprof/
|
||||
// http://yourdomain:PORT/debug/pprof/cmdline
|
||||
// http://yourdomain:PORT/debug/pprof/profile
|
||||
// http://yourdomain:PORT/debug/pprof/symbol
|
||||
// http://yourdomain:PORT/debug/pprof/goroutine
|
||||
// http://yourdomain:PORT/debug/pprof/heap
|
||||
// http://yourdomain:PORT/debug/pprof/threadcreate
|
||||
// http://yourdomain:PORT/debug/pprof/pprof/block
|
||||
// it can be a subdomain also, for example, if 'debug.'
|
||||
// http://debug.yourdomain:PORT/
|
||||
// http://debug.yourdomain:PORT/cmdline
|
||||
// http://debug.yourdomain:PORT/profile
|
||||
// http://debug.yourdomain:PORT/symbol
|
||||
// http://debug.yourdomain:PORT/goroutine
|
||||
// http://debug.yourdomain:PORT/heap
|
||||
// http://debug.yourdomain:PORT/threadcreate
|
||||
// http://debug.yourdomain:PORT/pprof/block
|
||||
ProfilePath string
|
||||
|
||||
// Logger the configuration for the logger
|
||||
// Iris logs ONLY errors and the banner if enabled
|
||||
// Iris logs ONLY SEMANTIC errors and the banner if enabled
|
||||
Logger Logger
|
||||
|
||||
// Sessions the config for sessions
|
||||
// contains 3(three) properties
|
||||
// Provider: (look /sessions/providers)
|
||||
// Secret: cookie's name (string)
|
||||
// Life: cookie life (time.Duration)
|
||||
// Sessions contains the configs for sessions
|
||||
Sessions Sessions
|
||||
|
||||
// Render contains the configs for template and rest configuration
|
||||
Render Render
|
||||
|
||||
// Websocket contains the configs for Websocket's server integration
|
||||
Websocket Websocket
|
||||
Websocket *Websocket
|
||||
|
||||
// Mail contains the config for the mail sender service
|
||||
// Mail contains the configs for the mail sender service
|
||||
Mail Mail
|
||||
|
||||
// Server contains the configs for the http server
|
||||
// Server configs are the only one which are setted inside base Iris package (from Listen, ListenTLS, ListenUNIX) NO from users
|
||||
//
|
||||
// this field is useful only when you need to READ which is the server's address, certfile & keyfile or unix's mode.
|
||||
//
|
||||
Server Server
|
||||
}
|
||||
|
||||
// Render struct keeps organise all configuration about rendering, templates and rest currently.
|
||||
@@ -117,16 +137,17 @@ func DefaultRender() Render {
|
||||
// Default returns the default configuration for the Iris staton
|
||||
func Default() Iris {
|
||||
return Iris{
|
||||
DisablePathCorrection: false,
|
||||
DisablePathEscape: false,
|
||||
DisablePathCorrection: DefaultDisablePathCorrection,
|
||||
DisablePathEscape: DefaultDisablePathEscape,
|
||||
DisableBanner: false,
|
||||
MaxRequestBodySize: -1,
|
||||
ProfilePath: DefaultProfilePath,
|
||||
ProfilePath: "",
|
||||
Logger: DefaultLogger(),
|
||||
Sessions: DefaultSessions(),
|
||||
Render: DefaultRender(),
|
||||
Websocket: DefaultWebsocket(),
|
||||
Mail: DefaultMail(),
|
||||
Server: DefaultServer(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user