circuitbreak

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CircuitBreak

func CircuitBreak(cb CircuitBreaker, opts ...Option) middleware.Middleware

CircuitBreak returns a circuit break middleware.

Types

type CircuitBreaker

type CircuitBreaker interface {
	Execute(handler func() (err error)) (isBreak bool)
}

type Option

type Option func(*options)

Option is a function that configures the middleware.

func WithHandler

func WithHandler(h middleware.Handler) Option

WithHandler returns a new Option that sets the handler.

func WithLogger

func WithLogger(logger xlog.Logger) Option

WithLogger returns a new Option that sets the logger.

Jump to

Keyboard shortcuts

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