Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsAlreadyExistsErr ¶
IsAlreadyExistsErr returns whether the error status code is AlreadyExists.
func IsPermanentError ¶
IsPermanentError returns whether the error status code is permanent based on the ResultStore implementation, according to the ResultStore maintainers. (No external documentation is known.) Permanent errors will never succeed and should not be retried. Transient errors should be retried with exponential backoff.
func New ¶
func New(ctx context.Context, log *logrus.Entry, client ResultStoreBatchClient, inv *resultstore.Invocation, invID, authToken string) (*writer, error)
New creates Invocation inv in ResultStore and returns a writer to add resource protos and finalize the Invocation. If the Invocation already exists and is finalized, a permanent error is returned. Otherwise, the writer syncs with ResultStore to resume writing. RPCs are retried with exponential backoff unless there is a permanent error, which is returned immediately. The caller should check whether a returned error is permanent using IsPermanentError() and only retry transient errors. The authToken is a UUID and must be identical across all calls for the same Invocation.
Types ¶
type ResultStoreBatchClient ¶
type ResultStoreBatchClient interface { CreateInvocation(context.Context, *resultstore.CreateInvocationRequest, ...grpc.CallOption) (*resultstore.Invocation, error) GetInvocationUploadMetadata(context.Context, *resultstore.GetInvocationUploadMetadataRequest, ...grpc.CallOption) (*resultstore.UploadMetadata, error) TouchInvocation(context.Context, *resultstore.TouchInvocationRequest, ...grpc.CallOption) (*resultstore.TouchInvocationResponse, error) UploadBatch(ctx context.Context, in *resultstore.UploadBatchRequest, opts ...grpc.CallOption) (*resultstore.UploadBatchResponse, error) }