server: Index | Files

package cas

import ""

Package cas manages content addressable storage.


Package Files

bytestream.go cas.go


const (
    // DefaultBatchByteLimit is bytes limit for cas BatchUploadBlobs.
    DefaultBatchByteLimit = 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>.

func ResName Uses

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

ResName returns resource name of digest in instance.

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.

type CAS Uses

type CAS struct {

    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, sema chan struct{}, 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 24 packages (graph) and is imported by 1 packages. Updated 2020-10-27. Refresh now. Tools for package owners.