Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Breaker ¶
type Breaker interface { // Execute runs the given request if the circuit breaker is closed or half-open states. // An error is instantly returned when the circuit breaker is tripped. Execute(func() (interface{}, error)) (interface{}, error) }
Breaker is the http circuit breaker.
type CircuitBreaker ¶
type CircuitBreaker struct {
// contains filtered or unexported fields
}
CircuitBreaker is the application http transport.
func NewCircuitBreaker ¶
func NewCircuitBreaker(cb Breaker) *CircuitBreaker
NewCircuitBreaker returns a new configured CircuitBreaker with circuit breaker.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the http wrapper for the application
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request is the application http request.
func NewRequest ¶
func NewRequest(opts ...RequestOption) *Request
NewRequest returns a new configured Request.
type RequestOption ¶
type RequestOption func(*Request)
RequestOption is the request options.
func WithCircuitBreaker ¶
func WithCircuitBreaker(rt http.RoundTripper) RequestOption
WithCircuitBreaker receives the http.RoundTripper implementation.
func WithRetry ¶
func WithRetry(rt http.RoundTripper) RequestOption
WithRetry receives the http.RoundTripper implementation.
func WithTimeout ¶
func WithTimeout(t time.Duration) RequestOption
Click to show internal directories.
Click to hide internal directories.