【文件属性】:
文件名称:gobreaker:Go中实现的断路器
文件大小:9KB
文件格式:ZIP
更新时间:2021-05-13 05:36:50
golang microservice circuit-breaker Go
破坏者
在Go中实现了。
安装
go get github.com/sony/gobreaker
用法
struct CircuitBreaker是一个状态机,用于防止发送可能失败的请求。 函数NewCircuitBreaker创建一个新的CircuitBreaker 。
func NewCircuitBreaker ( st Settings ) * CircuitBreaker
您可以通过struct Settings配置CircuitBreaker :
type Settings struct {
Name string
MaxRequests uint32
Interval time. Duration
Timeout time. Duration
ReadyToTrip func ( counts Counts )
【文件预览】:
gobreaker-master
----README.md(4KB)
----gobreaker.go(10KB)
----LICENSE(1KB)
----go.mod(86B)
----example()
--------http_breaker.go(962B)
----go.sum(608B)
----.travis.yml(363B)
----gobreaker_test.go(12KB)