Source File
call_option.go
Belonging Package
github.com/googleapis/gax-go/v2
package gax
import (
)
Resolve(cs *CallSettings)
}
Retry(err error) (pause time.Duration, shouldRetry bool)
}
type retryerOption func() Retryer
func ( retryerOption) ( *CallSettings) {
.Retry =
}
func ( func() Retryer) CallOption {
return retryerOption()
}
func ( []codes.Code, Backoff) Retryer {
return &boRetryer{
backoff: ,
codes: append([]codes.Code(nil), ...),
}
}
type boRetryer struct {
backoff Backoff
codes []codes.Code
}
func ( *boRetryer) ( error) (time.Duration, bool) {
, := status.FromError()
if ! {
return 0, false
}
:= .Code()
for , := range .codes {
if == {
return .backoff.Pause(), true
}
}
return 0, false
}
func ( ...grpc.CallOption) CallOption {
return grpcOpt(append([]grpc.CallOption(nil), ...))
}
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |