diff options
author | Matthew Holt <mholt@users.noreply.github.com> | 2019-05-16 16:05:38 -0600 |
---|---|---|
committer | Matthew Holt <mholt@users.noreply.github.com> | 2019-05-16 16:05:38 -0600 |
commit | 1f0c061ce30f218e63fcc17e0fdfc8b90d754ba5 (patch) | |
tree | ef148ac39ec520d14342ce48cec07f5efe0379f3 /modules/caddyhttp/reverseproxy/module.go | |
parent | ff5b4639d597203f8aec43e5eae8fe3774976d32 (diff) |
Architectural shift to using context for config and module state
Diffstat (limited to 'modules/caddyhttp/reverseproxy/module.go')
-rwxr-xr-x | modules/caddyhttp/reverseproxy/module.go | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/modules/caddyhttp/reverseproxy/module.go b/modules/caddyhttp/reverseproxy/module.go index cc53bf5..1bfc9ad 100755 --- a/modules/caddyhttp/reverseproxy/module.go +++ b/modules/caddyhttp/reverseproxy/module.go @@ -1,8 +1,6 @@ package reverseproxy import ( - "fmt" - "bitbucket.org/lightcodelabs/caddy2" ) @@ -11,36 +9,5 @@ func init() { caddy2.RegisterModule(caddy2.Module{ Name: "http.responders.reverse_proxy", New: func() (interface{}, error) { return new(LoadBalanced), nil }, - OnLoad: func(instances []interface{}, _ interface{}) (interface{}, error) { - // we don't need to do anything with prior state because healthcheckers are - // cleaned up in OnUnload. - s := &State{ - HealthCheckers: []*HealthChecker{}, - } - - for _, i := range instances { - lb := i.(*LoadBalanced) - - err := NewLoadBalancedReverseProxy(lb, s) - if err != nil { - return nil, err - } - } - - return s, nil - }, - OnUnload: func(state interface{}) error { - s, ok := state.(*State) - if !ok { - return fmt.Errorf("proxy OnLoad: prior state not expected proxy.State type") - } - - // cleanup old healthcheckers - for _, hc := range s.HealthCheckers { - hc.Stop() - } - - return nil - }, }) } |