dockerregistry

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: 22 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.

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

View Source
const Name = "kraken"

Name of storage driver.

Variables

This section is empty.

Functions

func GetBlobDigest

func GetBlobDigest(path string) (core.Digest, error)

GetBlobDigest returns blob digest

func GetLayerDigest

func GetLayerDigest(path string) (core.Digest, error)

GetLayerDigest returns digest of the layer

func GetManifestDigest

func GetManifestDigest(path string) (core.Digest, error)

GetManifestDigest returns manifest or tag digest

func GetManifestTag

func GetManifestTag(path string) (string, bool, error)

GetManifestTag returns tag name

func GetRepo

func GetRepo(path string) (string, error)

GetRepo returns repo name

func GetUploadAlgoAndOffset

func GetUploadAlgoAndOffset(path string) (string, string, error)

GetUploadAlgoAndOffset returns the algorithm and offset of the hashstates

func GetUploadUUID

func GetUploadUUID(path string) (string, error)

GetUploadUUID returns upload UUID

func ParsePath

func ParsePath(path string) (PathType, PathSubType, error)

ParsePath returns PathType, PathSubtype, and error given path string

Types

type BlobStore

type BlobStore interface {
	GetCacheFileStat(name string) (os.FileInfo, error)
	GetCacheFileReader(name string) (store.FileReader, error)
}

BlobStore defines cache file accessors.

type Config

type Config struct {
	Docker configuration.Configuration `yaml:"docker"`
}

Config defines registry configuration.

func (Config) Build

func (c Config) Build(parameters configuration.Parameters) (*registry.Registry, error)

Build builds a new docker registry.

func (Config) ReadOnlyParameters

func (c Config) ReadOnlyParameters(
	transferer transfer.ImageTransferer,
	bs BlobStore,
	metrics tally.Scope) configuration.Parameters

ReadOnlyParameters builds parameters for a read-only driver.

func (Config) ReadWriteParameters

func (c Config) ReadWriteParameters(
	transferer transfer.ImageTransferer,
	cas *store.CAStore,
	metrics tally.Scope) configuration.Parameters

ReadWriteParameters builds parameters for a read-write driver.

type InvalidRegistryPathError

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

InvalidRegistryPathError indicates path error

func (InvalidRegistryPathError) Error

func (e InvalidRegistryPathError) Error() string

type InvalidRequestError

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

InvalidRequestError implements error and contains the path that is not supported

func (InvalidRequestError) Error

func (e InvalidRequestError) Error() string

type KrakenStorageDriver

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

KrakenStorageDriver is a storage driver

func NewReadOnlyStorageDriver

func NewReadOnlyStorageDriver(
	config Config,
	bs BlobStore,
	transferer transfer.ImageTransferer,
	metrics tally.Scope) *KrakenStorageDriver

NewReadOnlyStorageDriver creates a KrakenStorageDriver which can only pull blobs.

func NewReadWriteStorageDriver

func NewReadWriteStorageDriver(
	config Config,
	cas *store.CAStore,
	transferer transfer.ImageTransferer,
	metrics tally.Scope) *KrakenStorageDriver

NewReadWriteStorageDriver creates a KrakenStorageDriver which can push / pull blobs.

func StorageDriverFixture

func StorageDriverFixture() (*KrakenStorageDriver, func())

StorageDriverFixture creates a storage driver for testing purposes.

func (*KrakenStorageDriver) Delete

func (d *KrakenStorageDriver) Delete(ctx context.Context, path string) error

Delete deletes path

func (*KrakenStorageDriver) GetContent

func (d *KrakenStorageDriver) GetContent(ctx context.Context, path string) (data []byte, err error)

GetContent returns content in the path sample path: /docker/registry/v2/repositories/external/ubuntu/_layers/sha256/a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4/link

func (*KrakenStorageDriver) List

func (d *KrakenStorageDriver) List(ctx context.Context, path string) ([]string, error)

List returns a list of content given path

func (*KrakenStorageDriver) Move

func (d *KrakenStorageDriver) Move(ctx context.Context, sourcePath string, destPath string) error

Move moves sourcePath to destPath

func (*KrakenStorageDriver) Name

func (d *KrakenStorageDriver) Name() string

Name returns driver namae

func (*KrakenStorageDriver) PutContent

func (d *KrakenStorageDriver) PutContent(ctx context.Context, path string, content []byte) error

PutContent writes content to path

func (*KrakenStorageDriver) Reader

func (d *KrakenStorageDriver) Reader(ctx context.Context, path string, offset int64) (reader io.ReadCloser, err error)

Reader returns a reader of path at offset

func (*KrakenStorageDriver) Stat

Stat returns fileinfo of path

func (*KrakenStorageDriver) URLFor

func (d *KrakenStorageDriver) URLFor(ctx context.Context, path string, options map[string]interface{}) (string, error)

URLFor returns url for path

func (*KrakenStorageDriver) Walk added in v0.1.2

Walk is not implemented.

func (*KrakenStorageDriver) Writer

func (d *KrakenStorageDriver) Writer(ctx context.Context, path string, append bool) (driver.FileWriter, error)

Writer returns a writer of path

type PathSubType

type PathSubType string

PathSubType describes the subtype of a path i.e. tags, revisions, data

type PathType

type PathType string

PathType describes the type of a path i.e. _manfiests, _layers, _uploads, and blobs

func (PathType) String

func (pt PathType) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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