breaker

package
v0.0.0-...-e1e9d1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2021 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package breaker defines the standard interface for a circuit breaker.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Breaker

type Breaker interface {
	// Allow indicates if a request can be executed. It returns a function to be
	// called with the result of the request execution if the request is allowed,
	// an error otherwise.
	Allow(ctx context.Context) (done func(ok bool), err error)
}

Breaker defines the method required for a circuit breaker.

type MockBreaker

type MockBreaker struct {
	AllowFunc func(context.Context) (func(bool), error)
}

MockBreaker is a test mock for the Breaker interface.

func (*MockBreaker) Allow

func (m *MockBreaker) Allow(ctx context.Context) (done func(ok bool), err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL