package internal
import "cloud.google.com/go/internal"
Index ¶
- func Annotate(err error, msg string) error
- func Annotatef(err error, format string, args ...interface{}) error
- func Retry(ctx context.Context, bo gax.Backoff, f func() (stop bool, err error)) error
Functions ¶
func Annotate ¶
Annotate prepends msg to the error message in err, attempting to preserve other information in err, like an error code.
Annotate panics if err is nil.
Annotate knows about these error types: - "google.golang.org/grpc/status".Status - "google.golang.org/api/googleapi".Error If the error is not one of these types, Annotate behaves like
fmt.Errorf("%s: %v", msg, err)
func Annotatef ¶
Annotatef uses format and args to format a string, then calls Annotate.
func Retry ¶
Retry calls the supplied function f repeatedly according to the provided backoff parameters. It returns when one of the following occurs: When f's first return value is true, Retry immediately returns with f's second return value. When the provided context is done, Retry returns with an error that includes both ctx.Error() and the last error returned by f.
Source Files ¶
annotate.go retry.go
Directories ¶
Path | Synopsis |
---|---|
internal/btree | Package btree implements in-memory B-Trees of arbitrary degree. |
internal/detect | Package detect is used find information from the environment. |
internal/fields | Package fields provides a view of the fields of a struct that follows the Go rules, amended to consider tags and case insensitivity. |
internal/leakcheck | Package leakcheck contains functions to check leaked goroutines. |
internal/optional | Package optional provides versions of primitive types that can be nil. |
internal/pretty | Package pretty implements a simple pretty-printer. |
internal/protostruct | Package protostruct supports operations on the protocol buffer Struct message. |
internal/pubsub | |
internal/testutil | Package testutil contains helper functions for writing tests. |
internal/trace | |
internal/tracecontext | Package tracecontext provides encoders and decoders for Stackdriver Trace contexts. |
internal/uid | Package uid supports generating unique IDs. |
internal/version | Package version contains version information for Google Cloud Client Libraries for Go, as reported in request headers. |
- Version
- v0.118.3 (latest)
- Published
- Feb 20, 2025
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 1 hour ago –
Tools for package owners.