Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 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.