Documentation ¶
Overview ¶
Package cas manages content addressable storage.
Index ¶
- Constants
- func Download(ctx context.Context, bs bpb.ByteStreamClient, wr io.Writer, resname string) (int64, error)
- func DownloadDigest(ctx context.Context, bs bpb.ByteStreamClient, wr io.Writer, instance string, ...) error
- func ParseResName(name string) (*rpb.Digest, error)
- func ResName(instance string, digest *rpb.Digest) string
- func Upload(ctx context.Context, bs bpb.ByteStreamClient, resname string, size int64, ...) error
- func UploadDigest(ctx context.Context, bs bpb.ByteStreamClient, instance string, ...) error
- func UploadResName(instance string, digest *rpb.Digest) string
- type CAS
- type Client
- type MissingBlob
- type MissingError
Constants ¶
const (
// DefaultBatchByteLimit is bytes limit for cas BatchUploadBlobs.
DefaultBatchByteLimit = 4 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func Download ¶
func Download(ctx context.Context, bs bpb.ByteStreamClient, wr io.Writer, resname string) (int64, error)
Download downloads blob specified by resname into w.
func DownloadDigest ¶
func DownloadDigest(ctx context.Context, bs bpb.ByteStreamClient, wr io.Writer, instance string, digest *rpb.Digest) error
DownloadDigest downloads blob specified resname/digest into w.
func ParseResName ¶
ParseResName parses resource name; digest string formatted as "blobs/<hash>/<sizebytes>". It ignores prior to "blobs", and after <sizebytes>. https://github.com/bazelbuild/remote-apis/blob/c1c1ad2c97ed18943adb55f06657440daa60d833/build/bazel/remote/execution/v2/remote_execution.proto#L168
func ResName ¶
ResName returns resource name of digest in instance. https://github.com/bazelbuild/remote-apis/blob/c1c1ad2c97ed18943adb55f06657440daa60d833/build/bazel/remote/execution/v2/remote_execution.proto#L220
func Upload ¶
func Upload(ctx context.Context, bs bpb.ByteStreamClient, resname string, size int64, rd io.Reader) error
Upload uploads blob specified by resname from rd.
func UploadDigest ¶
func UploadResName ¶
UploadResName returns resource name of digest in instance to upload. https://github.com/bazelbuild/remote-apis/blob/c1c1ad2c97ed18943adb55f06657440daa60d833/build/bazel/remote/execution/v2/remote_execution.proto#L187
Types ¶
type CAS ¶
type CAS struct { Client *digest.Store CacheCapabilities *rpb.CacheCapabilities }
CAS is content-addressable-storage synced between local and cas service.
type Client ¶
type Client interface { CAS() rpb.ContentAddressableStorageClient ByteStream() bpb.ByteStreamClient }
Client is a client of cas service.
type MissingBlob ¶
MissingBlob is a missing blog.
type MissingError ¶
type MissingError struct {
Blobs []MissingBlob
}
MissingError is an error about missing content for blobs.
func (MissingError) Error ¶
func (e MissingError) Error() string