server: go.chromium.org/goma/server/remoteexec/cas Index | Files

package cas

import "go.chromium.org/goma/server/remoteexec/cas"

Package cas manages content addressable storage.

Index

Package Files

bytestream.go cas.go

Constants

const (
    // DefaultBatchLimit is bytes limit for cas BatchUploadBlobs.
    DefaultBatchLimit = 4 * 1024 * 1024
)

func Download Uses

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 Uses

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 Uses

func ParseResName(name string) (*rpb.Digest, error)

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 Uses

func ResName(instance string, digest *rpb.Digest) string

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 Uses

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 Uses

func UploadDigest(ctx context.Context, bs bpb.ByteStreamClient, instance string, digest *rpb.Digest, rd io.Reader) error

func UploadResName Uses

func UploadResName(instance string, digest *rpb.Digest) string

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

type CAS Uses

type CAS struct {
    Client
    *digest.Store

    CacheCapabilities *rpb.CacheCapabilities
}

CAS is content-addressable-storage synced between local and cas service.

func (CAS) Missing Uses

func (c CAS) Missing(ctx context.Context, instance string, blobs []*rpb.Digest) ([]*rpb.Digest, error)

Missing checks blobs in local exists in instance of cas service, and returns missing blobs.

func (CAS) Upload Uses

func (c CAS) Upload(ctx context.Context, instance string, blobs ...*rpb.Digest) error

Upload uploads blobs stored in Store to instance of cas service.

type Client Uses

type Client interface {
    CAS() rpb.ContentAddressableStorageClient
    ByteStream() bpb.ByteStreamClient
}

Client is a client of cas service.

func NewClient Uses

func NewClient(conn *grpc.ClientConn) Client

NewClient creates client from conn.

type MissingBlob Uses

type MissingBlob struct {
    Digest *rpb.Digest
    Err    error
}

MissingBlob is a missing blog.

type MissingError Uses

type MissingError struct {
    Blobs []MissingBlob
}

MissingError is an error about missing content for blobs.

func (MissingError) Error Uses

func (e MissingError) Error() string

Package cas imports 22 packages (graph) and is imported by 1 packages. Updated 2019-08-28. Refresh now. Tools for package owners.