repository

package
v4.0.0-...-6a4dca6 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrRegistryIllegalIDFormat describes an illegal request format
	ErrRepositoryIllegalIDFormatMsg = "illegal format of provided ID value"
	// ErrRegistryUnauthorized describes an unauthorized request
	ErrRepositoryUnauthorizedMsg = "unauthorized"
	// ErrRegistryInternalErrors describes server-side internal errors
	ErrRepositoryInternalErrorsMsg = "unexpected internal errors"
	// ErrRegistryNoPermission describes a request error without permission
	ErrRepositoryNoPermissionMsg = "user does not have permission to the registry"
	// ErrRegistryIDNotExists describes an error
	// when no proper registry ID is found
	ErrRepositoryIDNotExistsMsg = "registry ID does not exist"
	// ErrRegistryNameAlreadyExists describes a duplicate registry name error
	ErrRepositoryNameAlreadyExistsMsg = "registry name already exists"
	// ErrRegistryMismatch describes a failed lookup
	// of a registry with name/id pair
	ErrRepositoryMismatchMsg = "id/name pair not found on server side"
	// ErrRegistryNotFound describes an error
	// when a specific registry is not found
	ErrRepositoryNotFoundMsg = "registry not found on server side"
	// ErrRegistryNotProvidedMsg describes an error
	// when no registry was provided by the user
	ErrRepositoryNotProvidedMsg = "no registry provided"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetRepository(ctx context.Context, projectName, repositoryName string) (*model.Repository, error)
	UpdateRepository(ctx context.Context, projectName, repositoryName string, update *model.Repository) error
	ListAllRepositories(ctx context.Context) ([]*model.Repository, error)
	ListRepositories(ctx context.Context, projectName string) ([]*model.Repository, error)
	DeleteRepository(ctx context.Context, projectName, repositoryName string) error
}

type ErrRepositoryIDNotExists

type ErrRepositoryIDNotExists struct{}

ErrRegistryIDNotExists describes an error when no proper registry ID is found.

func (*ErrRepositoryIDNotExists) Error

func (e *ErrRepositoryIDNotExists) Error() string

Error returns the error message.

type ErrRepositoryIllegalIDFormat

type ErrRepositoryIllegalIDFormat struct{}

ErrRegistryIllegalIDFormat describes an illegal request format.

func (*ErrRepositoryIllegalIDFormat) Error

Error returns the error message.

type ErrRepositoryInternalErrors

type ErrRepositoryInternalErrors struct{}

ErrRegistryInternalErrors describes server-side internal errors.

func (*ErrRepositoryInternalErrors) Error

Error returns the error message.

type ErrRepositoryMismatch

type ErrRepositoryMismatch struct{}

ErrRegistryMismatch describes a failed lookup of a registry with name/id pair.

func (*ErrRepositoryMismatch) Error

func (e *ErrRepositoryMismatch) Error() string

Error returns the error message.

type ErrRepositoryNameAlreadyExists

type ErrRepositoryNameAlreadyExists struct{}

ErrRegistryNameAlreadyExists describes a duplicate registry name error.

func (*ErrRepositoryNameAlreadyExists) Error

Error returns the error message.

type ErrRepositoryNoPermission

type ErrRepositoryNoPermission struct{}

ErrRegistryNoPermission describes a request error without permission.

func (*ErrRepositoryNoPermission) Error

func (e *ErrRepositoryNoPermission) Error() string

Error returns the error message.

type ErrRepositoryNotFound

type ErrRepositoryNotFound struct{}

ErrRegistryNotFound describes an error when a specific registry is not found.

func (*ErrRepositoryNotFound) Error

func (e *ErrRepositoryNotFound) Error() string

Error returns the error message.

type ErrRepositoryNotProvided

type ErrRepositoryNotProvided struct{}

ErrRegistryNotProvided describes an error when no registry was provided.

func (*ErrRepositoryNotProvided) Error

func (e *ErrRepositoryNotProvided) Error() string

Error returns the error message.

type ErrRepositoryUnauthorized

type ErrRepositoryUnauthorized struct{}

ErrRegistryUnauthorized describes an unauthorized request.

func (*ErrRepositoryUnauthorized) Error

func (e *ErrRepositoryUnauthorized) Error() string

Error returns the error message.

type RESTClient

type RESTClient struct {
	Options *config.Options

	LegacyClient *client.Harbor

	// The new client of the harbor v2 API
	V2Client *v2client.Harbor

	// AuthInfo contains the auth information that is provided on API calls.
	AuthInfo runtime.ClientAuthInfoWriter
}

RESTClient is a subclient for handling registry related actions.

func NewClient

func NewClient(legacyClient *client.Harbor, v2Client *v2client.Harbor, opts *config.Options, authInfo runtime.ClientAuthInfoWriter) *RESTClient

func (*RESTClient) DeleteRepository

func (c *RESTClient) DeleteRepository(ctx context.Context, projectName, repositoryName string) error

func (*RESTClient) GetRepository

func (c *RESTClient) GetRepository(ctx context.Context, projectName, repositoryName string) (*model.Repository, error)

func (*RESTClient) ListRepositories

func (c *RESTClient) ListRepositories(ctx context.Context, projectName string) ([]*model.Repository, error)

func (*RESTClient) UpdateRepository

func (c *RESTClient) UpdateRepository(ctx context.Context, projectName, repositoryName string, update *model.Repository) error

Jump to

Keyboard shortcuts

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