harbor_api

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package harbor_api

Index

Constants

View Source
const (
	ProjectNoStorageLimit int64 = -1
)

Variables

This section is empty.

Functions

func NewProjectReq

func NewProjectReq(reqCfg ProjectReqConfig) *models.ProjectReq

Types

type ArtifactURI

type ArtifactURI struct {
	Project    string
	Repository string
	Tag        string
}

func (ArtifactURI) String

func (a ArtifactURI) String() string

Example: library/s3fstest:latest

type CallBack

type CallBack struct {
	CallBackAttrs
}

type CallBackAttr

type CallBackAttr map[CallBackOpt]CallBackAttribute

type CallBackAttribute

type CallBackAttribute struct {
	// contains filtered or unexported fields
}

type CallBackAttrs

type CallBackAttrs map[CallBackType]CallBackAttr

type CallBackOpt

type CallBackOpt string

type CallBackType

type CallBackType string
const (
	ProjectCallBack CallBackType = "Project"
	RepoCallBack    CallBackType = "Repository"
)

type Client

type Client struct {

	// callback variant
	CallBack *CallBack
	// contains filtered or unexported fields
}

func New

func New(
	harborRegistry string,
	harborInsecure bool,
	harborUsername,
	harborPassword string) (*Client, error)

func (*Client) CopyArtifact

func (c *Client) CopyArtifact(toArtifactURI, fromArtifactURI ArtifactURI) (*artifact.CopyArtifactCreated, error)

func (*Client) CreateAdmin

func (c *Client) CreateAdmin(userCreationReq *models.UserCreationReq) (*user.CreateUserCreated, error)

func (*Client) CreateArtifactTag

func (c *Client) CreateArtifactTag(toArtifactURI, fromArtifactURI ArtifactURI) (*artifact.CreateTagCreated, error)

func (*Client) CreateProject

func (c *Client) CreateProject(projectReqConfig ProjectReqConfig) (*project.CreateProjectCreated, error)

CreateProject preserve a project named: public create new project for each user by a specified name restrict the quota of each user

func (*Client) DeleteAdmin

func (c *Client) DeleteAdmin(userID int64) (*user.DeleteUserOK, error)

func (*Client) DeleteArtifact

func (c *Client) DeleteArtifact(artifactURI ArtifactURI) (*artifact.DeleteArtifactOK, error)

func (*Client) DeleteProject

func (c *Client) DeleteProject(projectName string) (*project.DeleteProjectOK, error)

func (*Client) ExportArtifact

func (c *Client) ExportArtifact() (string, error)

ExportArtifact Download the image.tar.gz file to local

func (*Client) GC added in v1.1.4

func (c *Client) GC(gcFn ...util.Func)

func (*Client) GenerateArtifact

func (c *Client) GenerateArtifact() error

GenerateArtifact generate image from Dockerfile and push it to project

func (*Client) GetArtifact

func (c *Client) GetArtifact(artifactURI ArtifactURI) (*artifact.GetArtifactOK, error)

func (*Client) GetAuth added in v1.1.3

func (c *Client) GetAuth() (string, error)

func (*Client) ImportOfflineArtifact

func (c *Client) ImportOfflineArtifact() error

ImportOfflineArtifact Upload the image.tar.gz file to project

func (*Client) ListArtifacts

func (c *Client) ListArtifacts(artifactURI ArtifactURI) (*artifact.ListArtifactsOK, error)

func (*Client) ListProjects

func (c *Client) ListProjects() (*project.ListProjectsOK, error)

func (*Client) ListRepositories

func (c *Client) ListRepositories(projectName string) (*repository.ListRepositoriesOK, error)

func (*Client) WithCallBack

func (c *Client) WithCallBack(callback *CallBack) *Client

func (*Client) WithContext

func (c *Client) WithContext(ctx context.Context) *Client

func (*Client) WithHttpClient

func (c *Client) WithHttpClient(httpCli *http.Client) *Client

func (*Client) WithPageConfig

func (c *Client) WithPageConfig(pCfg *util.Page) *Client

type ProjectReqConfig

type ProjectReqConfig struct {
	MetaDataPublic string
	ProjectName    string
	RegistryId     int64
	StorageLimit   int64
}

Directories

Path Synopsis
Package harbor_inst/client.go was generated by codegen, please fix its package dependency, but do not modify its functionality
Package harbor_inst/client.go was generated by codegen, please fix its package dependency, but do not modify its functionality

Jump to

Keyboard shortcuts

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