registry

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package registry is a cut-down Registry V2 client for manifesto

Copyright © 2017 Aqua Security Software Ltd. <info@aquasec.com>

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

This section is empty.

Functions

This section is empty.

Types

type AuthChallenge

type AuthChallenge struct {
	Scheme, Realm string
	Params        map[string]string
}

type AuthResponse

type AuthResponse struct {
	Token string
}

AuthResponse contains the token

type AuthType

type AuthType int

AuthType is a simple int type used for enumerations of the authentication types supported by version 2 registries

const (
	// Insecure denotes a registry with no authentication at all
	Insecure AuthType = iota
	// Token denotes a registry with token-based (OAuth2) authentication
	Token
	// Htpasswd denotes a registry with Basic HTTP authentication
	Htpasswd
)

type V2

type V2 struct {
	Client   *http.Client
	URL      string
	AuthType AuthType
	Username string
	Password string
	Tokens   map[scope]token // map from scope to token
	Realm    string
	Service  string
}

V2 is the registry structure for registries supporting the V2 API

func New

func New(URL, username, password string) (*V2, error)

New creates a new instance of the V2 structure for the registry located in the provided URL, and checks that the registry supports V2

func (*V2) GetBlob

func (r *V2) GetBlob(repoName string, digest string) ([]byte, error)

GetBlob downloads a blob specified by repo name and digest

func (*V2) UploadBlob

func (r *V2) UploadBlob(repoName string, data io.Reader) (string, error)

UploadBlob pushes a blob of data to the registry

Jump to

Keyboard shortcuts

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