Versions in this module Expand all Collapse all v2 v2.0.13 Oct 27, 2026 Changes in this version type Options + Registry string v2.0.12 Oct 23, 2026 Changes in this version + func CallPageT[T any](service, uri string, op *Options) vo.ResponsePage[T] + func CallResultT[T any](service, uri string, op *Options) models.Result[T] v2.0.11 Oct 15, 2026 v2.0.10 Oct 13, 2026 v2.0.9 Oct 13, 2026 v2.0.8 Sep 15, 2026 v2.0.7 Sep 10, 2026 v2.0.6 Sep 9, 2026 v2.0.5 Sep 8, 2026 v2.0.4 Sep 7, 2026 v2.0.3 Sep 7, 2026 v2.0.2 Sep 4, 2026 v2.0.1 Sep 4, 2026 Changes in this version + const CONTENT_TYPE_FILE + const CONTENT_TYPE_FORM + const CONTENT_TYPE_JSON + const CONTENT_TYPE_RESTFUL + var ErrAllInstancesCircuitOpen = errors.New("client: all instances circuit-open") + var ErrCallTimeout = errors.New("client: 微服务调用超时") + var ErrCircuitOpen = errors.New("client: 熔断器已打开,请求被快速失败") + func Call(service, uri string, op *Options) (string, error) + func CallCtx(ctx context.Context, service, uri string, op *Options) (string, error) + func CallCtxT[T any](ctx context.Context, service, uri string, op *Options) models.Result[T] + func CallResilient(service, uri string, op *Options, ro *ResilienceOptions) (string, error) + func CallResilientCtx(ctx context.Context, service, uri string, op *Options, ro *ResilienceOptions) (string, error) + func CallT[T any](service, uri string, op *Options) models.Result[T] + func ResetBreakers() + type CircuitBreaker struct + func GetBreaker(name string) *CircuitBreaker + func NewCircuitBreaker(name string, maxFailures int, interval, timeout time.Duration) *CircuitBreaker + func (cb *CircuitBreaker) Allow() bool + func (cb *CircuitBreaker) Counts() (failures int, successes int) + func (cb *CircuitBreaker) Failure() + func (cb *CircuitBreaker) Name() string + func (cb *CircuitBreaker) Reset() + func (cb *CircuitBreaker) State() State + func (cb *CircuitBreaker) String() string + func (cb *CircuitBreaker) Success() + type Options struct + Data any + Files []grequests.FileUpload + Group string + Header any + Json any + LoadBalancer string + Method string + Path map[string]string + Protocol string + Query any + Retry bool + type ResilienceOptions struct + BaseDelay time.Duration + Breaker *CircuitBreaker + MaxDelay time.Duration + MaxRetries int + RetryOnStatus func(code int) bool + Timeout time.Duration + type State int + const StateClosed + const StateHalfOpen + const StateOpen + func (s State) String() string