Documentation ¶
Index ¶
- type HTTPRequest
- type HTTPRequestOption
- func HTTPRequestAddHystrixOptions(opts ...hystrix.Option) HTTPRequestOption
- func HTTPRequestSetBreakerName(breakerName string) HTTPRequestOption
- func HTTPRequestSetClient(cl *http.Client) HTTPRequestOption
- func HTTPRequestSetHTTPErrorCodeThreshold(minHTTPStatusCode int) HTTPRequestOption
- func HTTPRequestSetRetries(retries int) HTTPRequestOption
- func HTTPRequestSetSleepBetweenRetry(sleepBetweenRetry time.Duration) HTTPRequestOption
- func HTTPRequestSetTLS(tlsConfig *tls.Config) HTTPRequestOption
- func HTTPRequestSetTimeout(timeout time.Duration) HTTPRequestOption
- type HTTPRequestResult
- type Locker
- type NoopLocker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPRequest ¶
type HTTPRequest interface { DoRequest(ctx context.Context, method, url string, requestBody []byte, headers map[string]string) (result *HTTPRequestResult, err error) Do(context context.Context, method, url string, reqBody []byte, headers map[string]string) (respBody []byte, respCode int, err error) }
HTTPRequest interface
func NewHTTPRequest ¶
func NewHTTPRequest(opts ...HTTPRequestOption) HTTPRequest
NewHTTPRequest function Request's Constructor
type HTTPRequestOption ¶
type HTTPRequestOption func(*httpRequestImpl)
HTTPRequestOption func type
func HTTPRequestAddHystrixOptions ¶ added in v1.10.16
func HTTPRequestAddHystrixOptions(opts ...hystrix.Option) HTTPRequestOption
HTTPRequestAddHystrixOptions option func
func HTTPRequestSetBreakerName ¶
func HTTPRequestSetBreakerName(breakerName string) HTTPRequestOption
HTTPRequestSetBreakerName option func
func HTTPRequestSetClient ¶ added in v1.11.14
func HTTPRequestSetClient(cl *http.Client) HTTPRequestOption
HTTPRequestSetClient option func
func HTTPRequestSetHTTPErrorCodeThreshold ¶
func HTTPRequestSetHTTPErrorCodeThreshold(minHTTPStatusCode int) HTTPRequestOption
HTTPRequestSetHTTPErrorCodeThreshold option func, set minimum http response code for return error when exec client request
func HTTPRequestSetRetries ¶
func HTTPRequestSetRetries(retries int) HTTPRequestOption
HTTPRequestSetRetries option func
func HTTPRequestSetSleepBetweenRetry ¶
func HTTPRequestSetSleepBetweenRetry(sleepBetweenRetry time.Duration) HTTPRequestOption
HTTPRequestSetSleepBetweenRetry option func
func HTTPRequestSetTLS ¶
func HTTPRequestSetTLS(tlsConfig *tls.Config) HTTPRequestOption
HTTPRequestSetTLS option func
func HTTPRequestSetTimeout ¶
func HTTPRequestSetTimeout(timeout time.Duration) HTTPRequestOption
HTTPRequestSetTimeout option func
type HTTPRequestResult ¶ added in v1.11.6
HTTPRequestResult struct
type Locker ¶ added in v1.8.8
type Locker interface { IsLocked(key string) bool HasBeenLocked(key string) bool Unlock(key string) Reset(key string) }
Locker abstraction, lock concurrent processs
func NewRedisLocker ¶ added in v1.8.8
NewRedisLocker constructor
type NoopLocker ¶ added in v1.8.8
type NoopLocker struct{}
NoopLocker empty locker
func (NoopLocker) HasBeenLocked ¶ added in v1.13.6
func (NoopLocker) HasBeenLocked(key string) bool
HasBeenLocked method
func (NoopLocker) IsLocked ¶ added in v1.8.8
func (NoopLocker) IsLocked(key string) bool
IsLocked method