mirror of
https://github.com/distribution/distribution.git
synced 2025-09-27 07:03:15 +00:00
Otel tracing MVP: vendor changes
Signed-off-by: gotgelf <gotgelf@gmail.com>
This commit is contained in:
21
vendor/github.com/googleapis/gax-go/v2/call_option.go
generated
vendored
21
vendor/github.com/googleapis/gax-go/v2/call_option.go
generated
vendored
@@ -218,6 +218,14 @@ func (p pathOpt) Resolve(s *CallSettings) {
|
||||
s.Path = p.p
|
||||
}
|
||||
|
||||
type timeoutOpt struct {
|
||||
t time.Duration
|
||||
}
|
||||
|
||||
func (t timeoutOpt) Resolve(s *CallSettings) {
|
||||
s.timeout = t.t
|
||||
}
|
||||
|
||||
// WithPath applies a Path override to the HTTP-based APICall.
|
||||
//
|
||||
// This is for internal use only.
|
||||
@@ -230,6 +238,15 @@ func WithGRPCOptions(opt ...grpc.CallOption) CallOption {
|
||||
return grpcOpt(append([]grpc.CallOption(nil), opt...))
|
||||
}
|
||||
|
||||
// WithTimeout is a convenience option for setting a context.WithTimeout on the
|
||||
// singular context.Context used for **all** APICall attempts. Calculated from
|
||||
// the start of the first APICall attempt.
|
||||
// If the context.Context provided to Invoke already has a Deadline set, that
|
||||
// will always be respected over the deadline calculated using this option.
|
||||
func WithTimeout(t time.Duration) CallOption {
|
||||
return &timeoutOpt{t: t}
|
||||
}
|
||||
|
||||
// CallSettings allow fine-grained control over how calls are made.
|
||||
type CallSettings struct {
|
||||
// Retry returns a Retryer to be used to control retry logic of a method call.
|
||||
@@ -241,4 +258,8 @@ type CallSettings struct {
|
||||
|
||||
// Path is an HTTP override for an APICall.
|
||||
Path string
|
||||
|
||||
// Timeout defines the amount of time that Invoke has to complete.
|
||||
// Unexported so it cannot be changed by the code in an APICall.
|
||||
timeout time.Duration
|
||||
}
|
||||
|
Reference in New Issue
Block a user