sre

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateOpen int32 = iota
	StateClosed
)

Variables

View Source
var ErrNotAllowed = errors.New("circuitbreaker: not allowed for circuit open")

Functions

This section is empty.

Types

type SreBreaker

type SreBreaker struct {
	// contains filtered or unexported fields
}

SreBreaker google sre 弹性熔断器

func NewSreBreaker

func NewSreBreaker() *SreBreaker

func (*SreBreaker) Allow

func (s *SreBreaker) Allow() error

Allow 是否允许改请求通过, 如果返回 error 说明被熔断了

func (*SreBreaker) MarkFailed

func (s *SreBreaker) MarkFailed()

MarkFailed 标记失败

func (*SreBreaker) MarkSuccess

func (s *SreBreaker) MarkSuccess()

MarkSuccess 标记成功

Jump to

Keyboard shortcuts

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