robotv1

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 {
	ListProjectRobotsV1(ctx context.Context, projectNameOrID string) ([]*modelv2.Robot, error)
	AddProjectRobotV1(ctx context.Context, projectNameOrID string, r *modelv2.RobotCreateV1) error
	UpdateProjectRobotV1(ctx context.Context, projectNameOrID string, robotID int64, r *modelv2.Robot) error
	DeleteProjectRobotV1(ctx context.Context, projectNameOrID string, robotID 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 project related actions.

func NewClient

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

func (*RESTClient) AddProjectRobotV1

func (c *RESTClient) AddProjectRobotV1(ctx context.Context, projectNameOrID string, r *modelv2.RobotCreateV1) error

AddProjectRobotV1 creates the robot account 'r' and adds it to the project 'p'. and returns a 'RobotCreated' response.

func (*RESTClient) DeleteProjectRobotV1

func (c *RESTClient) DeleteProjectRobotV1(ctx context.Context, projectNameOrID string, robotID int64) error

DeleteProjectRobotV1 deletes a robot account from project p.

func (*RESTClient) ListProjectRobotsV1

func (c *RESTClient) ListProjectRobotsV1(ctx context.Context, projectNameOrID string) ([]*modelv2.Robot, error)

ListProjectRobotsV1 returns a list of all robot accounts in project p.

func (*RESTClient) UpdateProjectRobotV1

func (c *RESTClient) UpdateProjectRobotV1(ctx context.Context, projectNameOrID string, robotID int64, r *modelv2.Robot) error

UpdateProjectRobotV1 updates a robot account 'r' in project 'p' using the 'robotID'.

Jump to

Keyboard shortcuts

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