registry

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 17 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"`
	AccountID           string `json:"account_id"`
	AccessKey           string `json:"access_key"`
	SecretAccessKey     string `json:"secret_access_key"`
	LifecyclePolicyText string `json:"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) Host added in v0.2.1

func (r *AWSRegistry) Host() string

func (*AWSRegistry) MatchImage added in v0.2.9

func (r *AWSRegistry) MatchImage(image string) bool

func (*AWSRegistry) Prefix

func (r *AWSRegistry) Prefix() string

func (*AWSRegistry) Verify

func (r *AWSRegistry) Verify() error

type AliCloudEERegistry added in v0.3.0

type AliCloudEERegistry struct {
	AliCloudRegistry
	InstanceId   string `json:"instance_id"`
	InstanceHost string `json:"instance_host"`
}

func (*AliCloudEERegistry) CreateRepoIfNotExists added in v0.3.0

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

func (*AliCloudEERegistry) GetAuthConfig added in v0.3.0

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

func (*AliCloudEERegistry) GetLatestTag added in v0.3.0

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

func (*AliCloudEERegistry) Host added in v0.3.0

func (r *AliCloudEERegistry) Host() string

func (*AliCloudEERegistry) MatchImage added in v0.3.0

func (r *AliCloudEERegistry) MatchImage(image string) bool

func (*AliCloudEERegistry) Prefix added in v0.3.0

func (r *AliCloudEERegistry) Prefix() string

type AliCloudRegistry

type AliCloudRegistry struct {
	Region          string `json:"region"`
	Namespace       string `json:"namespace"`
	Username        string `json:"username"`
	Password        string `json:"password"`
	AccessKey       string `json:"access_key"`
	SecretAccessKey string `json:"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) Host added in v0.2.1

func (r *AliCloudRegistry) Host() string

func (*AliCloudRegistry) MatchImage added in v0.2.9

func (r *AliCloudRegistry) MatchImage(image string) bool

func (*AliCloudRegistry) Prefix

func (r *AliCloudRegistry) Prefix() string

func (*AliCloudRegistry) Verify

func (r *AliCloudRegistry) Verify() error

type DockerHubRegistry

type DockerHubRegistry struct {
	Namespace string `json:"namespace"`
	Server    string `json:"server"`
	Username  string `json:"username"`
	Password  string `json:"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) Host added in v0.2.1

func (r *DockerHubRegistry) Host() string

func (*DockerHubRegistry) MatchImage added in v0.2.9

func (r *DockerHubRegistry) MatchImage(image string) bool

func (*DockerHubRegistry) Prefix

func (r *DockerHubRegistry) Prefix() string

func (*DockerHubRegistry) Verify

func (r *DockerHubRegistry) Verify() error

type Interface added in v0.2.9

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

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) Host added in v0.2.1

func (r *PublicRegistry) Host() string

func (*PublicRegistry) MatchImage added in v0.2.9

func (r *PublicRegistry) MatchImage(image string) bool

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"`
	AliCloud   *AliCloudRegistry   `json:"aliyun"`
	AliCloudEE *AliCloudEERegistry `json:"aliyun_ee"`
	AWS        *AWSRegistry        `json:"aws"`
	DockerHub  *DockerHubRegistry  `json:"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) Host added in v0.2.1

func (r *Registry) Host() string

func (*Registry) MatchImage added in v0.2.9

func (r *Registry) MatchImage(image string) bool

func (*Registry) Prefix

func (r *Registry) Prefix() string

func (*Registry) Verify

func (r *Registry) Verify() error

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) (Interface, error)

Jump to

Keyboard shortcuts

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