Documentation ¶
Index ¶
Constants ¶
View Source
const Namespace = "github.com/schibsted/krakend-cbreaker"
Namespace is the key to use to store and access the custom config data
Variables ¶
View Source
var ZeroCfg = Config{}
ZeroCfg is the zero value for the Config struct
Functions ¶
func BackendFactory ¶
func BackendFactory(next proxy.BackendFactory) proxy.BackendFactory
BackendFactory adds a cb middleware wrapping the internal factory
func ConfigGetter ¶
func ConfigGetter(e config.ExtraConfig) interface{}
ConfigGetter implements the config.ConfigGetter interface. It parses the extra config for the gobreaker adapter and returns a ZeroCfg if something goes wrong.
func NewCbRequest ¶
func NewCbRequest(cb *HystrixCommand, next proxy.Proxy) proxy.Proxy
func NewMiddleware ¶
func NewMiddleware(remote *config.Backend) proxy.Middleware
NewMiddleware builds a middleware based on the extra config params or fallbacks to the next proxy
Types ¶
type Config ¶
type Config struct { CommandName string Timeout int SleepWindow int MaxConcurrentRequests int ErrorPercentThreshold int RequestVolumeThreshold int }
Config is the custom config struct containing the params for the sony/gobreaker package
type HystrixCommand ¶
type HystrixCommand struct {
// contains filtered or unexported fields
}
func NewCommand ¶
func NewCommand(cfg Config) *HystrixCommand
NewCommand builds a gobreaker circuit breaker with the injected config
Click to show internal directories.
Click to hide internal directories.