registry

package
v5.0.0-...-9d434bb Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	NewRegistry(ctx context.Context, reg *model.Registry) error
	GetRegistryByID(ctx context.Context, id int64) (*model.Registry, error)
	GetRegistryByName(ctx context.Context, name string) (*model.Registry, error)
	ListRegistries(ctx context.Context) ([]*model.Registry, error)
	DeleteRegistryByID(ctx context.Context, id int64) error
	UpdateRegistry(ctx context.Context, u *model.RegistryUpdate, id int64) error
}

type RESTClient

type RESTClient struct {
	// Options contains optional configuration when making API calls.
	Options *config.Options

	// 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(v2Client *v2client.Harbor, opts *config.Options, authInfo runtime.ClientAuthInfoWriter) *RESTClient

func (*RESTClient) DeleteRegistryByID

func (c *RESTClient) DeleteRegistryByID(ctx context.Context, id int64) error

DeleteRegistryByID deletes a registry identified by ID. Returns an error when no matching registry is found or when having difficulties talking to the API.

func (*RESTClient) GetRegistryByID

func (c *RESTClient) GetRegistryByID(ctx context.Context, id int64) (*model.Registry, error)

GetRegistryByID returns a registry identified by ID. Returns an error if it cannot find a matching registry or when having difficulties talking to the API.

func (*RESTClient) GetRegistryByName

func (c *RESTClient) GetRegistryByName(ctx context.Context, name string) (*model.Registry, error)

func (*RESTClient) ListRegistries

func (c *RESTClient) ListRegistries(ctx context.Context) ([]*model.Registry, error)

func (*RESTClient) NewRegistry

func (c *RESTClient) NewRegistry(ctx context.Context, reg *model.Registry) error

NewRegistry creates a new registry.

func (*RESTClient) UpdateRegistry

func (c *RESTClient) UpdateRegistry(ctx context.Context, u *model.RegistryUpdate, id int64) error

UpdateRegistry updates a registry identified by ID with the provided RegistryUpdate 'r'.

Jump to

Keyboard shortcuts

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