writer

package
v0.0.0-...-37c3036 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAlreadyExistsErr

func IsAlreadyExistsErr(err error) bool

IsAlreadyExistsErr returns whether the error status code is AlreadyExists.

func IsPermanentError

func IsPermanentError(err error) bool

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)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL