harbor

package
v0.0.0-...-c94c68f Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNotFoundErr

func IsNotFoundErr(err error) bool

IsNotFoundErr checks if the error is a not found error.

Types

type Client

type Client struct {
	Project      string
	HarborClient *harbor.ClientSet
	// contains filtered or unexported fields
}

Client is a wrapper around the Harbor API client.

func New

func New(config *ClientConf) (*Client, error)

New creates a new Harbor client.

func (*Client) CreateProject

func (client *Client) CreateProject(public *models.ProjectPublic) (*models.ProjectPublic, error)

CreateProject creates a project in Harbor.

func (*Client) CreateRepository

func (client *Client) CreateRepository(public *models.RepositoryPublic) (*models.RepositoryPublic, error)

CreateRepository creates a repository in Harbor.

func (*Client) CreateRobot

func (client *Client) CreateRobot(public *models.RobotPublic) (*models.RobotPublic, error)

CreateRobot creates a robot in Harbor.

func (*Client) CreateWebhook

func (client *Client) CreateWebhook(public *models.WebhookPublic) (*models.WebhookPublic, error)

CreateWebhook creates a webhook in Harbor.

func (*Client) DeleteProject

func (client *Client) DeleteProject(id int) error

DeleteProject deletes a project from Harbor.

func (*Client) DeleteRepository

func (client *Client) DeleteRepository(name string) error

DeleteRepository deletes a repository from Harbor.

func (*Client) DeleteRobot

func (client *Client) DeleteRobot(id int) error

DeleteRobot deletes a robot in Harbor.

func (*Client) DeleteWebhook

func (client *Client) DeleteWebhook(id int) error

DeleteWebhook deletes a webhook from Harbor.

func (*Client) ReadProject

func (client *Client) ReadProject(id int) (*models.ProjectPublic, error)

ReadProject reads a project from Harbor.

func (*Client) ReadRepository

func (client *Client) ReadRepository(name string) (*models.RepositoryPublic, error)

ReadRepository reads a repository from Harbor.

func (*Client) ReadRobot

func (client *Client) ReadRobot(id int) (*models.RobotPublic, error)

ReadRobot reads a robot from Harbor.

func (*Client) ReadWebhook

func (client *Client) ReadWebhook(id int) (*models.WebhookPublic, error)

ReadWebhook reads a webhook from Harbor.

func (*Client) UpdateProject

func (client *Client) UpdateProject(public *models.ProjectPublic) (*models.ProjectPublic, error)

UpdateProject updates a project in Harbor.

func (*Client) UpdateRepository

func (client *Client) UpdateRepository(public *models.RepositoryPublic) (*models.RepositoryPublic, error)

UpdateRepository updates a repository in Harbor.

func (*Client) UpdateRobot

func (client *Client) UpdateRobot(public *models.RobotPublic) (*models.RobotPublic, error)

UpdateRobot updates a robot in Harbor.

func (*Client) UpdateWebhook

func (client *Client) UpdateWebhook(public *models.WebhookPublic) (*models.WebhookPublic, error)

UpdateWebhook updates a webhook in Harbor.

type ClientConf

type ClientConf struct {
	URL      string
	Username string
	Password string
	Project  string
}

ClientConf is a configuration struct for the Harbor client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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