cas

package
v0.0.0-...-4a11b79 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(ctx context.Context, instance string, tokenServerHost string, readOnly bool) (*client.Client, error)

Types

type ChunkerDeduper

type ChunkerDeduper struct {
	// contains filtered or unexported fields
}

ChunkerDeduper deduplicates the chunkers uploaded to CAS. Each time a CAS merkle tree is constructed, we should use this to dedupe the chunkers on the client side before uploading to the server. This is thread safe.

func NewChunkerDeduper

func NewChunkerDeduper() *ChunkerDeduper

NewChunkerDeduper creates a new ChunkerDeduper object.

func (*ChunkerDeduper) Deduplicate

func (cd *ChunkerDeduper) Deduplicate(chunkers []*chunker.Chunker) []*chunker.Chunker

Deduplicate removes the chunkers that have already been requested to be uploaded to CAS.

type Flags

type Flags struct {
	Instance string

	TokenServerHost string
}

func (*Flags) Init

func (c *Flags) Init(f *flag.FlagSet)

func (*Flags) Parse

func (c *Flags) Parse() error

type Uploader

type Uploader struct {
	// contains filtered or unexported fields
}

Uploader provides the API to upload the files in an isolate file to CAS service.

func NewUploader

func NewUploader(cas *client.Client, opts ...UploaderOption) *Uploader

NewUploader creates a new Uploader object.

func (*Uploader) Upload

func (up *Uploader) Upload(ctx context.Context, opts ...*isolate.ArchiveOptions) ([]digest.Digest, error)

Upload parses the isolate options and uploads the files they refer to to CAS. Returns the list of digests of the root directories. The returned digests will have the same order as |opts|.

type UploaderOption

type UploaderOption func(*Uploader)

UploaderOption is the type to configure an Uploader object.

func WithCache

func WithCache(c filemetadata.Cache) UploaderOption

WithCache configures the file metadata cache an uploader uses. This exists mostly for testing purpose.

Jump to

Keyboard shortcuts

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