projectmeta

package
v5.0.7 Latest Latest
Warning

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

Go to latest
Published: May 29, 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 {
	AddProjectMetadata(ctx context.Context, projectNameOrID string, key common.MetadataKey, value string) error
	GetProjectMetadataValue(ctx context.Context, projectNameOrID string, key common.MetadataKey) (string, error)
	ListProjectMetadata(ctx context.Context, projectNameOrID string) (map[string]string, error)
	UpdateProjectMetadata(ctx context.Context, projectNameOrID string, key common.MetadataKey, value string) error
	DeleteProjectMetadataValue(ctx context.Context, projectNameOrID string, key common.MetadataKey) 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 webhook related actions.

func NewClient

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

func (*RESTClient) AddProjectMetadata

func (c *RESTClient) AddProjectMetadata(ctx context.Context, projectNameOrID string, key common.MetadataKey, value string) error

AddProjectMetadata AddMetadata adds a metadata value using a specific key to the specified project.

func (*RESTClient) DeleteProjectMetadataValue

func (c *RESTClient) DeleteProjectMetadataValue(ctx context.Context, projectNameOrID string, key common.MetadataKey) error

DeleteProjectMetadataValue DeleteMetadataValue deletes metadata of project p given by key.

func (*RESTClient) GetProjectMetadataValue

func (c *RESTClient) GetProjectMetadataValue(ctx context.Context, projectNameOrID string, key common.MetadataKey) (string, error)

GetProjectMetadataValue retrieves the corresponding metadata value to the key of the specified project.

func (*RESTClient) ListProjectMetadata

func (c *RESTClient) ListProjectMetadata(ctx context.Context, projectNameOrID string) (map[string]string, error)

ListProjectMetadata lists the metadata of project.

func (*RESTClient) UpdateProjectMetadata

func (c *RESTClient) UpdateProjectMetadata(ctx context.Context, projectNameOrID string, key common.MetadataKey, value string) error

UpdateProjectMetadata UpdateMetadata deletes the specified metadata key, if it exists and re-adds this metadata key with the given value. This function works around the faulty behaviour of the corresponding 'Update' endpoint of the Harbor API.

Jump to

Keyboard shortcuts

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