diff options
author | Valery Piashchynski <[email protected]> | 2021-01-05 17:37:17 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-01-05 17:37:17 +0300 |
commit | 13b01ccaba1eedeb99d37842ec8f2019d2625187 (patch) | |
tree | c645c240336666fa63d70ed2703a78df828c597f /tests | |
parent | 877b0ed461c7d5e1de87b7561f414aeb236cf3ec (diff) |
Finish implementation of the KV
Diffstat (limited to 'tests')
-rw-r--r-- | tests/plugins/http/plugin_middleware.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/plugins/http/plugin_middleware.go b/tests/plugins/http/plugin_middleware.go index 8d02524d..00640b69 100644 --- a/tests/plugins/http/plugin_middleware.go +++ b/tests/plugins/http/plugin_middleware.go @@ -6,15 +6,18 @@ import ( "github.com/spiral/roadrunner/v2/plugins/config" ) +// PluginMiddleware test type PluginMiddleware struct { config config.Configurer } +// Init test func (p *PluginMiddleware) Init(cfg config.Configurer) error { p.config = cfg return nil } +// Middleware test func (p *PluginMiddleware) Middleware(next http.Handler) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/halt" { @@ -29,19 +32,23 @@ func (p *PluginMiddleware) Middleware(next http.Handler) http.HandlerFunc { } } +// Name test func (p *PluginMiddleware) Name() string { return "pluginMiddleware" } +// PluginMiddleware2 test type PluginMiddleware2 struct { config config.Configurer } +// Init test func (p *PluginMiddleware2) Init(cfg config.Configurer) error { p.config = cfg return nil } +// Middleware test func (p *PluginMiddleware2) Middleware(next http.Handler) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { if r.URL.Path == "/boom" { @@ -56,6 +63,7 @@ func (p *PluginMiddleware2) Middleware(next http.Handler) http.HandlerFunc { } } +// Name test func (p *PluginMiddleware2) Name() string { return "pluginMiddleware2" } |