registry

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2019 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnknownRegistry = fmt.Errorf("unknown registry")
)

Functions

func LoadRegistries

func LoadRegistries(configPath string) (defaultRegistry string, registries map[string]*Registry, err error)

Types

type AWSRegistry

type AWSRegistry struct {
	Region              string `json:"region" yaml:"region"`
	AccountID           string `json:"account_id" yaml:"account_id"`
	AccessKey           string `json:"access_key" yaml:"access_key"`
	SecretAccessKey     string `json:"secret_access_key" yaml:"secret_access_key"`
	LifecyclePolicyText string `json:"lifecycle_policy_text" yaml:"lifecycle_policy_text"`
}

func (*AWSRegistry) CreateRepoIfNotExists

func (r *AWSRegistry) CreateRepoIfNotExists(repo string) error

func (*AWSRegistry) GetAuthConfig

func (r *AWSRegistry) GetAuthConfig() (auth types.AuthConfig, err error)

func (*AWSRegistry) GetLatestTag

func (r *AWSRegistry) GetLatestTag(repo string) (tag string, err error)

func (*AWSRegistry) Prefix

func (r *AWSRegistry) Prefix() string

func (*AWSRegistry) Verify

func (r *AWSRegistry) Verify() error

type AliCloudRegistry

type AliCloudRegistry struct {
	Region          string `json:"region" yaml:"region"`
	Namespace       string `json:"namespace" yaml:"namespace"`
	Username        string `json:"username" yaml:"username"`
	Password        string `json:"password" yaml:"password"`
	AccessKey       string `json:"access_key" yaml:"access_key"`
	SecretAccessKey string `json:"secret_access_key" yaml:"secret_access_key"`
}

func (*AliCloudRegistry) CreateRepoIfNotExists

func (r *AliCloudRegistry) CreateRepoIfNotExists(repo string) error

func (*AliCloudRegistry) GetAuthConfig

func (r *AliCloudRegistry) GetAuthConfig() (auth types.AuthConfig, err error)

func (*AliCloudRegistry) GetLatestTag

func (r *AliCloudRegistry) GetLatestTag(repo string) (tag string, err error)

func (*AliCloudRegistry) Prefix

func (r *AliCloudRegistry) Prefix() string

func (*AliCloudRegistry) Verify

func (r *AliCloudRegistry) Verify() error

type DockerHubRegistry

type DockerHubRegistry struct {
	Server   string `json:"server" yaml:"server"`
	Username string `json:"username" yaml:"username"`
	Password string `json:"password" yaml:"password"`
}

DockerHubRegistry can be any registry which is compatible with Docker Hub.

func (*DockerHubRegistry) CreateRepoIfNotExists

func (r *DockerHubRegistry) CreateRepoIfNotExists(repo string) error

func (*DockerHubRegistry) GetAuthConfig

func (r *DockerHubRegistry) GetAuthConfig() (types.AuthConfig, error)

func (*DockerHubRegistry) GetLatestTag

func (r *DockerHubRegistry) GetLatestTag(repo string) (string, error)

func (*DockerHubRegistry) Prefix

func (r *DockerHubRegistry) Prefix() string

func (*DockerHubRegistry) Verify

func (r *DockerHubRegistry) Verify() error

type PublicRegistry

type PublicRegistry struct {
}

PublicRegistry represents registries which does not need authentication.

func (*PublicRegistry) CreateRepoIfNotExists

func (r *PublicRegistry) CreateRepoIfNotExists(repo string) error

func (*PublicRegistry) GetAuthConfig

func (r *PublicRegistry) GetAuthConfig() (types.AuthConfig, error)

func (*PublicRegistry) GetLatestTag

func (r *PublicRegistry) GetLatestTag(repo string) (string, error)

func (*PublicRegistry) Prefix

func (r *PublicRegistry) Prefix() string

func (*PublicRegistry) Verify

func (r *PublicRegistry) Verify() error

type Registry

type Registry struct {
	Name      string             `json:"name" yaml:"name"`
	AliCloud  *AliCloudRegistry  `json:"aliyun" yaml:"aliyun"`
	AWS       *AWSRegistry       `json:"aws" yaml:"aws"`
	DockerHub *DockerHubRegistry `json:"dockerhub" yaml:"dockerhub"`
}

func (*Registry) CreateRepoIfNotExists

func (r *Registry) CreateRepoIfNotExists(repo string) error

func (*Registry) GetAuthConfig

func (r *Registry) GetAuthConfig() (types.AuthConfig, error)

func (*Registry) GetAuthToken

func (r *Registry) GetAuthToken() (string, error)

func (*Registry) GetLatestTag

func (r *Registry) GetLatestTag(repo string) (string, error)

func (*Registry) Prefix

func (r *Registry) Prefix() string

func (*Registry) Verify

func (r *Registry) Verify() error

type RegistryInterface

type RegistryInterface interface {
	GetAuthToken() (string, error)
	// contains filtered or unexported methods
}

type Resolver

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

func NewResolver

func NewResolver(configPath string) (*Resolver, error)

func (*Resolver) ResolveRegistryByImage

func (r *Resolver) ResolveRegistryByImage(img string) (RegistryInterface, error)

Jump to

Keyboard shortcuts

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