Documentation ¶
Index ¶
- type Failover
- func (f *Failover) RegisterStatusUpdater(fn func(up bool)) error
- func (f *Failover) ServeHTTP(w http.ResponseWriter, req *http.Request)
- func (f *Failover) SetFallbackHandler(handler http.Handler)
- func (f *Failover) SetFallbackHandlerStatus(ctx context.Context, up bool)
- func (f *Failover) SetHandler(handler http.Handler)
- func (f *Failover) SetHandlerStatus(ctx context.Context, up bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Failover ¶
type Failover struct {
// contains filtered or unexported fields
}
Failover is an http.Handler that can forward requests to the fallback handler when the main handler status is down.
func (*Failover) RegisterStatusUpdater ¶
RegisterStatusUpdater adds fn to the list of hooks that are run when the status of the Failover changes. Not thread safe.
func (*Failover) SetFallbackHandler ¶
SetFallbackHandler sets the fallback http.Handler.
func (*Failover) SetFallbackHandlerStatus ¶
SetFallbackHandlerStatus sets the fallback handler status.
func (*Failover) SetHandler ¶
SetHandler sets the main http.Handler.
Click to show internal directories.
Click to hide internal directories.