label

package
v5.0.0-...-5bc921f Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2023 License: MIT Imports: 10 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 {
	CreateLabel(ctx context.Context, l *model.Label) error
	GetLabelByID(ctx context.Context, id int64) (*model.Label, error)
	ListLabels(ctx context.Context, name string, projectID *int64, scope Scope) ([]*model.Label, error)
	DeleteLabel(ctx context.Context, id int64) error
	UpdateLabel(ctx context.Context, id int64, l *model.Label) 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 label related actions.

func NewClient

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

func (*RESTClient) CreateLabel

func (c *RESTClient) CreateLabel(ctx context.Context, l *model.Label) error

func (*RESTClient) DeleteLabel

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

func (*RESTClient) GetLabelByID

func (c *RESTClient) GetLabelByID(ctx context.Context, id int64) (*model.Label, error)

func (*RESTClient) ListLabels

func (c *RESTClient) ListLabels(ctx context.Context, name string, projectID *int64) ([]*model.Label, error)

func (*RESTClient) UpdateLabel

func (c *RESTClient) UpdateLabel(ctx context.Context, id int64, l *model.Label) error

type Scope

type Scope string
const (
	ScopeGlobal  Scope = "g"
	ScopeProject Scope = "p"
)

func (Scope) String

func (in Scope) String() string

Jump to

Keyboard shortcuts

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