tagclient

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: Apache-2.0 Imports: 12 Imported by: 18

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.

Index

Constants

This section is empty.

Variables

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

Client errors.

Functions

This section is empty.

Types

type Client

type Client interface {
	Put(tag string, d core.Digest) error
	PutAndReplicate(tag string, d core.Digest) error
	Get(tag string) (core.Digest, error)
	Has(tag string) (bool, error)
	List(prefix string) ([]string, error)
	ListRepository(repo string) ([]string, error)
	Replicate(tag string) error
	Origin() (string, error)

	DuplicateReplicate(
		tag string, d core.Digest, dependencies core.DigestList, delay time.Duration) error
	DuplicatePut(tag string, d core.Digest, delay time.Duration) error
}

Client wraps tagserver endpoints.

func NewClusterClient

func NewClusterClient(hosts healthcheck.List, config *tls.Config) Client

NewClusterClient creates a Client which operates on tagserver instances as a cluster.

func NewSingleClient

func NewSingleClient(addr string, config *tls.Config) Client

NewSingleClient returns a Client scoped to a single tagserver instance.

type DuplicatePutRequest

type DuplicatePutRequest struct {
	Delay time.Duration `json:"delay"`
}

DuplicatePutRequest defines a DuplicatePut request body.

type DuplicateReplicateRequest

type DuplicateReplicateRequest struct {
	Dependencies core.DigestList `json:"dependencies"`
	Delay        time.Duration   `json:"delay"`
}

DuplicateReplicateRequest defines a DuplicateReplicate request body.

type Provider

type Provider interface {
	Provide(addr string) Client
}

Provider maps addresses into Clients.

func NewProvider

func NewProvider(config *tls.Config) Provider

NewProvider creates a Provider which wraps NewSingleClient.

type ReplicateRequest

type ReplicateRequest struct {
	Dependencies []core.Digest `json:"dependencies"`
}

ReplicateRequest defines a Replicate request body.

type TestProvider

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

TestProvider is a testing utility for mapping addresses to mock clients.

func NewTestProvider

func NewTestProvider() *TestProvider

NewTestProvider creates a new TestProvider.

func (*TestProvider) Provide

func (p *TestProvider) Provide(addr string) Client

Provide selects the registered client of addr.

func (*TestProvider) Register

func (p *TestProvider) Register(addr string, c Client)

Register sets c as the client of addr.

Jump to

Keyboard shortcuts

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