go: cloud.google.com/go/internal Index | Files | Directories

package internal

import "cloud.google.com/go/internal"

Index

Package Files

annotate.go retry.go

func Annotate Uses

func Annotate(err error, msg string) error

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 Uses

func Annotatef(err error, format string, args ...interface{}) error

Annotatef uses format and args to format a string, then calls Annotate.

func Retry Uses

func Retry(ctx context.Context, bo gax.Backoff, f func() (stop bool, err error)) error

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.

Directories

PathSynopsis
atomiccachePackage atomiccache provides a map-based cache that supports very fast reads.
fieldsPackage fields provides a view of the fields of a struct that follows the Go rules, amended to consider tags and case insensitivity.
optionalPackage optional provides versions of primitive types that can be nil.
prettyPackage pretty implements a simple pretty-printer.
readme
rpcreplayPackage rpcreplay supports the capture and replay of gRPC calls.
rpcreplay/proto/intstorePackage intstore is a generated protocol buffer package.
rpcreplay/proto/rpcreplayPackage rpcreplay is a generated protocol buffer package.
testutilPackage testutil contains helper functions for writing tests.
tracecontextPackage tracecontext provides encoders and decoders for Stackdriver Trace contexts.
versionPackage version contains version information for Google Cloud Client Libraries for Go, as reported in request headers.

Package internal imports 6 packages (graph) and is imported by 3 packages. Updated 2017-11-19. Refresh now. Tools for package owners.