transfer

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Copyright (c) 2016-2019 Uber Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2016-2019 Uber Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2016-2019 Uber Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2016-2019 Uber Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright (c) 2016-2019 Uber Technologies, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var ErrBlobNotFound = errors.New("blob not found")

ErrBlobNotFound is returned when a blob is not found by transferer.

View Source
var ErrTagNotFound = errors.New("tag not found")

ErrTagNotFound is returned when a tag is not found by transferer.

Functions

This section is empty.

Types

type ImageTransferer

type ImageTransferer interface {
	Stat(namespace string, d core.Digest) (*core.BlobInfo, error)
	Download(namespace string, d core.Digest) (store.FileReader, error)
	Upload(namespace string, d core.Digest, blob store.FileReader) error

	GetTag(tag string) (core.Digest, error)
	PutTag(tag string, d core.Digest) error
	ListTags(prefix string) ([]string, error)
}

ImageTransferer defines an interface that transfers images

func NewTestTransferer

func NewTestTransferer(cas *store.CAStore) ImageTransferer

NewTestTransferer creates a Transferer which stores blobs in cas and tags in memory for testing purposes.

type ReadOnlyTransferer

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

ReadOnlyTransferer gets and posts manifest to tracker, and transfers blobs as torrent.

func NewReadOnlyTransferer

func NewReadOnlyTransferer(
	stats tally.Scope,
	cads *store.CADownloadStore,
	tags tagclient.Client,
	sched scheduler.Scheduler) *ReadOnlyTransferer

NewReadOnlyTransferer creates a new ReadOnlyTransferer.

func (*ReadOnlyTransferer) Download

func (t *ReadOnlyTransferer) Download(namespace string, d core.Digest) (store.FileReader, error)

Download downloads blobs as torrent.

func (*ReadOnlyTransferer) GetTag

func (t *ReadOnlyTransferer) GetTag(tag string) (core.Digest, error)

GetTag gets manifest digest for tag.

func (*ReadOnlyTransferer) ListTags

func (t *ReadOnlyTransferer) ListTags(prefix string) ([]string, error)

ListTags is not supported.

func (*ReadOnlyTransferer) PutTag

func (t *ReadOnlyTransferer) PutTag(tag string, d core.Digest) error

PutTag is not supported.

func (*ReadOnlyTransferer) Stat

func (t *ReadOnlyTransferer) Stat(namespace string, d core.Digest) (*core.BlobInfo, error)

Stat returns blob info from local cache, and triggers download if the blob is not available locally.

func (*ReadOnlyTransferer) Upload

func (t *ReadOnlyTransferer) Upload(namespace string, d core.Digest, blob store.FileReader) error

Upload uploads blobs to a torrent network.

type ReadWriteTransferer

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

ReadWriteTransferer is a Transferer for proxy. Uploads/downloads blobs via the local origin cluster, and posts/gets tags via the local build-index.

func NewReadWriteTransferer

func NewReadWriteTransferer(
	stats tally.Scope,
	tags tagclient.Client,
	originCluster blobclient.ClusterClient,
	cas *store.CAStore) *ReadWriteTransferer

NewReadWriteTransferer creates a new ReadWriteTransferer.

func (*ReadWriteTransferer) Download

func (t *ReadWriteTransferer) Download(namespace string, d core.Digest) (store.FileReader, error)

Download downloads the blob of name into the file store and returns a reader to the newly downloaded file.

func (*ReadWriteTransferer) GetTag

func (t *ReadWriteTransferer) GetTag(tag string) (core.Digest, error)

GetTag returns the manifest digest for tag.

func (*ReadWriteTransferer) ListTags

func (t *ReadWriteTransferer) ListTags(prefix string) ([]string, error)

ListTags lists all tags with prefix.

func (*ReadWriteTransferer) PutTag

func (t *ReadWriteTransferer) PutTag(tag string, d core.Digest) error

PutTag uploads d as the manifest digest for tag.

func (*ReadWriteTransferer) Stat

func (t *ReadWriteTransferer) Stat(namespace string, d core.Digest) (*core.BlobInfo, error)

Stat returns blob info from origin cluster or local cache.

func (*ReadWriteTransferer) Upload

func (t *ReadWriteTransferer) Upload(
	namespace string, d core.Digest, blob store.FileReader) error

Upload uploads blob to the origin cluster.

Jump to

Keyboard shortcuts

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