Skip to content

Commit 81bf122

Browse files
committed
update breaker doc
1 parent a14bd30 commit 81bf122

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

core/breaker/breaker.go

+16-16
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ type (
2525
Acceptable func(err error) bool
2626

2727
Breaker interface {
28-
// Name returns the name of the netflixBreaker.
28+
// Name returns the name of the Breaker.
2929
Name() string
3030

3131
// Allow checks if the request is allowed.
@@ -34,34 +34,34 @@ type (
3434
// If not allow, ErrServiceUnavailable will be returned.
3535
Allow() (Promise, error)
3636

37-
// Do runs the given request if the netflixBreaker accepts it.
38-
// Do returns an error instantly if the netflixBreaker rejects the request.
39-
// If a panic occurs in the request, the netflixBreaker handles it as an error
37+
// Do runs the given request if the Breaker accepts it.
38+
// Do returns an error instantly if the Breaker rejects the request.
39+
// If a panic occurs in the request, the Breaker handles it as an error
4040
// and causes the same panic again.
4141
Do(req func() error) error
4242

43-
// DoWithAcceptable runs the given request if the netflixBreaker accepts it.
44-
// DoWithAcceptable returns an error instantly if the netflixBreaker rejects the request.
45-
// If a panic occurs in the request, the netflixBreaker handles it as an error
43+
// DoWithAcceptable runs the given request if the Breaker accepts it.
44+
// DoWithAcceptable returns an error instantly if the Breaker rejects the request.
45+
// If a panic occurs in the request, the Breaker handles it as an error
4646
// and causes the same panic again.
4747
// acceptable checks if it's a successful call, even if the err is not nil.
4848
DoWithAcceptable(req func() error, acceptable Acceptable) error
4949

50-
// DoWithFallback runs the given request if the netflixBreaker accepts it.
51-
// DoWithFallback runs the fallback if the netflixBreaker rejects the request.
52-
// If a panic occurs in the request, the netflixBreaker handles it as an error
50+
// DoWithFallback runs the given request if the Breaker accepts it.
51+
// DoWithFallback runs the fallback if the Breaker rejects the request.
52+
// If a panic occurs in the request, the Breaker handles it as an error
5353
// and causes the same panic again.
5454
DoWithFallback(req func() error, fallback func(err error) error) error
5555

56-
// DoWithFallbackAcceptable runs the given request if the netflixBreaker accepts it.
57-
// DoWithFallbackAcceptable runs the fallback if the netflixBreaker rejects the request.
58-
// If a panic occurs in the request, the netflixBreaker handles it as an error
56+
// DoWithFallbackAcceptable runs the given request if the Breaker accepts it.
57+
// DoWithFallbackAcceptable runs the fallback if the Breaker rejects the request.
58+
// If a panic occurs in the request, the Breaker handles it as an error
5959
// and causes the same panic again.
6060
// acceptable checks if it's a successful call, even if the err is not nil.
6161
DoWithFallbackAcceptable(req func() error, fallback func(err error) error, acceptable Acceptable) error
6262
}
6363

64-
BreakerOption func(breaker *circuitBreaker)
64+
Option func(breaker *circuitBreaker)
6565

6666
Promise interface {
6767
Accept()
@@ -89,7 +89,7 @@ type (
8989
}
9090
)
9191

92-
func NewBreaker(opts ...BreakerOption) Breaker {
92+
func NewBreaker(opts ...Option) Breaker {
9393
var b circuitBreaker
9494
for _, opt := range opts {
9595
opt(&b)
@@ -127,7 +127,7 @@ func (cb *circuitBreaker) Name() string {
127127
return cb.name
128128
}
129129

130-
func WithName(name string) BreakerOption {
130+
func WithName(name string) Option {
131131
return func(b *circuitBreaker) {
132132
b.name = name
133133
}

0 commit comments

Comments
 (0)