Documentation
¶
Index ¶
- Constants
- Variables
- type AddTrailingSlash
- type Base
- type BodyLimit
- type CORS
- type Expression
- type File
- type FileConfig
- type Gzip
- type HTTPSNonWWWRedirect
- type HTTPSRedirect
- type HTTPSWWWRedirect
- type Header
- type HeaderConfig
- type Logger
- type NonWWWRedirect
- type Plugin
- type Proxy
- type RawPlugin
- type Redirect
- type RedirectConfig
- type RemoveTrailingSlash
- type Rewrite
- type Secure
- type Static
- type Target
- type Template
- type WWWRedirect
Constants ¶
View Source
const ( // Plugin types PluginBodyLimit = "body-limit" PluginLogger = "logger" PluginRedirect = "redirect" PluginHTTPSRedirect = "https-redirect" PluginHTTPSWWWRedirect = "https-www-redirect" PluginHTTPSNonWWWRedirect = "https-non-www-redirect" PluginWWWRedirect = "www-redirect" PluginNonWWWRedirect = "non-www-redirect" PluginAddTrailingSlash = "add-trailing-slash" PluginRemoveTrailingSlash = "remove-trailing-slash" PluginRewrite = "rewrite" PluginSecure = "secure" PluginCORS = "cors" PluginGzip = "gzip" PluginHeader = "header" PluginProxy = "proxy" PluginStatic = "static" PluginFile = "file" )
Variables ¶
View Source
var ( // DefaultLookup function DefaultLookup = func(base Base) (p Plugin) { switch base.Name() { case PluginBodyLimit: p = &BodyLimit{Base: base} case PluginLogger: p = &Logger{Base: base} case PluginRedirect: p = &Redirect{Base: base} case PluginHTTPSRedirect: p = &HTTPSRedirect{Base: base} case PluginHTTPSWWWRedirect: p = &HTTPSWWWRedirect{Base: base} case PluginHTTPSNonWWWRedirect: p = &HTTPSNonWWWRedirect{Base: base} case PluginWWWRedirect: p = &WWWRedirect{Base: base} case PluginNonWWWRedirect: p = &NonWWWRedirect{Base: base} case PluginAddTrailingSlash: p = &AddTrailingSlash{Base: base} case PluginRemoveTrailingSlash: p = &RemoveTrailingSlash{Base: base} case PluginRewrite: p = &Rewrite{Base: base} case PluginSecure: p = &Secure{Base: base} case PluginCORS: p = &CORS{Base: base} case PluginGzip: p = &Gzip{Base: base} case PluginHeader: p = &Header{Base: base} case PluginProxy: p = &Proxy{Base: base} case PluginStatic: p = &Static{Base: base} case PluginFile: p = &File{Base: base} } return } // Lookup function Lookup = DefaultLookup )
Functions ¶
This section is empty.
Types ¶
type AddTrailingSlash ¶
type AddTrailingSlash struct {
Base `yaml:",squash"`
middleware.TrailingSlashConfig `yaml:",squash"`
}
func (*AddTrailingSlash) Initialize ¶
func (s *AddTrailingSlash) Initialize()
func (*AddTrailingSlash) Process ¶
func (s *AddTrailingSlash) Process(next echo.HandlerFunc) echo.HandlerFunc
func (*AddTrailingSlash) Update ¶ added in v0.4.12
func (s *AddTrailingSlash) Update(p Plugin)
type Base ¶
type Base struct {
// TODO: to disable
Skip string `yaml:"skip"`
Middleware echo.MiddlewareFunc `yaml:"-"`
Echo *echo.Echo `yaml:"-"`
Logger *log.Logger `yaml:"-"`
// contains filtered or unexported fields
}
Base defines the base struct for plugins.
type BodyLimit ¶
type BodyLimit struct {
Base `yaml:",squash"`
middleware.BodyLimitConfig `yaml:",squash"`
}
func (*BodyLimit) Initialize ¶
func (b *BodyLimit) Initialize()
func (*BodyLimit) Process ¶
func (b *BodyLimit) Process(next echo.HandlerFunc) echo.HandlerFunc
type CORS ¶
type CORS struct {
Base `yaml:",squash"`
middleware.CORSConfig `yaml:",squash"`
}
func (*CORS) Initialize ¶
func (c *CORS) Initialize()
func (*CORS) Process ¶
func (c *CORS) Process(next echo.HandlerFunc) echo.HandlerFunc
type Expression ¶ added in v0.2.7
type Expression struct {
*fasttemplate.Template
}
func NewExpression ¶ added in v0.2.7
func NewExpression(t string) *Expression
type File ¶ added in v0.2.1
type File struct {
Base `yaml:",squash"`
FileConfig `yaml:",squash"`
}
func (*File) Initialize ¶ added in v0.4.12
func (f *File) Initialize()
func (*File) Process ¶ added in v0.2.1
func (f *File) Process(next echo.HandlerFunc) echo.HandlerFunc
type FileConfig ¶ added in v0.4.12
type FileConfig struct {
Path string `yaml:"path"`
}
type Gzip ¶
type Gzip struct {
Base `yaml:",squash"`
middleware.GzipConfig `yaml:",squash"`
}
func (*Gzip) Initialize ¶
func (g *Gzip) Initialize()
func (*Gzip) Process ¶
func (g *Gzip) Process(next echo.HandlerFunc) echo.HandlerFunc
type HTTPSNonWWWRedirect ¶
type HTTPSNonWWWRedirect struct {
Base `yaml:",squash"`
middleware.RedirectConfig `yaml:",squash"`
}
func (*HTTPSNonWWWRedirect) Initialize ¶
func (r *HTTPSNonWWWRedirect) Initialize()
func (*HTTPSNonWWWRedirect) Process ¶
func (r *HTTPSNonWWWRedirect) Process(next echo.HandlerFunc) echo.HandlerFunc
func (*HTTPSNonWWWRedirect) Update ¶ added in v0.4.12
func (r *HTTPSNonWWWRedirect) Update(p Plugin)
type HTTPSRedirect ¶
type HTTPSRedirect struct {
Base `yaml:",squash"`
middleware.RedirectConfig `yaml:",squash"`
}
func (*HTTPSRedirect) Initialize ¶
func (r *HTTPSRedirect) Initialize()
func (*HTTPSRedirect) Process ¶
func (r *HTTPSRedirect) Process(next echo.HandlerFunc) echo.HandlerFunc
func (*HTTPSRedirect) Update ¶ added in v0.4.12
func (r *HTTPSRedirect) Update(p Plugin)
type HTTPSWWWRedirect ¶
type HTTPSWWWRedirect struct {
Base `yaml:",squash"`
middleware.RedirectConfig `yaml:",squash"`
}
func (*HTTPSWWWRedirect) Initialize ¶
func (r *HTTPSWWWRedirect) Initialize()
func (*HTTPSWWWRedirect) Process ¶
func (r *HTTPSWWWRedirect) Process(next echo.HandlerFunc) echo.HandlerFunc
func (*HTTPSWWWRedirect) Update ¶ added in v0.4.12
func (r *HTTPSWWWRedirect) Update(p Plugin)
type Header ¶
type Header struct {
Base `yaml:",squash"`
HeaderConfig `yaml:",squash"`
}
func (*Header) Initialize ¶
func (*Header) Initialize()
func (*Header) Process ¶
func (h *Header) Process(next echo.HandlerFunc) echo.HandlerFunc
type HeaderConfig ¶ added in v0.4.12
type Logger ¶
type Logger struct {
Base `yaml:",squash"`
middleware.LoggerConfig `yaml:",squash"`
}
func (*Logger) Initialize ¶
func (l *Logger) Initialize()
func (*Logger) Process ¶
func (l *Logger) Process(next echo.HandlerFunc) echo.HandlerFunc
type NonWWWRedirect ¶
type NonWWWRedirect struct {
Base `yaml:",squash"`
middleware.RedirectConfig `yaml:",squash"`
}
func (*NonWWWRedirect) Initialize ¶
func (r *NonWWWRedirect) Initialize()
func (*NonWWWRedirect) Process ¶
func (r *NonWWWRedirect) Process(next echo.HandlerFunc) echo.HandlerFunc
func (*NonWWWRedirect) Update ¶ added in v0.4.12
func (r *NonWWWRedirect) Update(p Plugin)
type Plugin ¶
type Plugin interface {
Name() string
Initialize()
Update(Plugin)
Process(echo.HandlerFunc) echo.HandlerFunc
Order() int
}
type Proxy ¶
type Proxy struct {
Base `yaml:",squash"`
middleware.ProxyConfig `yaml:",squash"`
Balance string `yaml:"balance"`
Targets []*Target `yaml:"targets"`
}
func (*Proxy) Initialize ¶
func (p *Proxy) Initialize()
func (*Proxy) Process ¶
func (p *Proxy) Process(next echo.HandlerFunc) echo.HandlerFunc
type Redirect ¶
type Redirect struct {
Base `yaml:",squash"`
RedirectConfig `yaml:",squash"`
}
func (*Redirect) Initialize ¶
func (r *Redirect) Initialize()
func (*Redirect) Process ¶
func (r *Redirect) Process(next echo.HandlerFunc) echo.HandlerFunc
type RedirectConfig ¶ added in v0.4.12
type RemoveTrailingSlash ¶
type RemoveTrailingSlash struct {
Base `yaml:",squash"`
middleware.TrailingSlashConfig `yaml:",squash"`
}
func (*RemoveTrailingSlash) Initialize ¶
func (s *RemoveTrailingSlash) Initialize()
func (*RemoveTrailingSlash) Process ¶
func (s *RemoveTrailingSlash) Process(next echo.HandlerFunc) echo.HandlerFunc
func (*RemoveTrailingSlash) Update ¶ added in v0.4.12
func (s *RemoveTrailingSlash) Update(p Plugin)
type Rewrite ¶
type Rewrite struct {
Base `json:",squash"`
middleware.RewriteConfig `json:",squash"`
}
func (*Rewrite) Initialize ¶ added in v0.4.12
func (r *Rewrite) Initialize()
func (*Rewrite) Process ¶ added in v0.4.12
func (r *Rewrite) Process(next echo.HandlerFunc) echo.HandlerFunc
type Secure ¶
type Secure struct {
Base `yaml:",squash"`
middleware.SecureConfig `yaml:",squash"`
}
func (*Secure) Initialize ¶
func (s *Secure) Initialize()
func (*Secure) Process ¶
func (s *Secure) Process(next echo.HandlerFunc) echo.HandlerFunc
type Static ¶
type Static struct {
Base `yaml:",squash"`
middleware.StaticConfig `yaml:",squash"`
}
func (*Static) Initialize ¶
func (s *Static) Initialize()
func (*Static) Process ¶
func (s *Static) Process(next echo.HandlerFunc) echo.HandlerFunc
type Target ¶
func (Target) ProxyTarget ¶ added in v0.4.12
func (t Target) ProxyTarget() (target *middleware.ProxyTarget, err error)
type Template ¶ added in v0.2.1
type Template struct {
*fasttemplate.Template
}
func NewTemplate ¶ added in v0.2.1
type WWWRedirect ¶
type WWWRedirect struct {
Base `yaml:",squash"`
middleware.RedirectConfig `yaml:",squash"`
}
func (*WWWRedirect) Initialize ¶
func (r *WWWRedirect) Initialize()
func (*WWWRedirect) Process ¶
func (r *WWWRedirect) Process(next echo.HandlerFunc) echo.HandlerFunc
func (*WWWRedirect) Update ¶ added in v0.4.12
func (r *WWWRedirect) Update(p Plugin)
Click to show internal directories.
Click to hide internal directories.