harbor

package
v0.0.0-...-53bcd79 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Access

type Access struct {
	Action   string `json:"action"`
	Resource string `json:"resource"`
}

type CVEItem

type CVEItem struct {
	CVEId string `json:"cve_id"`
}

type CVEWhitelist

type CVEWhitelist struct {
	Items []CVEItem `json:"items,omitempty"`
}

type Harbor

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

func New

func New(host, username, password string) *Harbor

func (*Harbor) CreateRobotAccount

func (h *Harbor) CreateRobotAccount(projectId int, robotRequest *NewRobotAccountRequest) (*RobotAccount, error)

func (*Harbor) DeleteProject

func (h *Harbor) DeleteProject(projectId int) error

func (*Harbor) DeleteRobotAccount

func (h *Harbor) DeleteRobotAccount(projectId, robotId int) error

func (*Harbor) ExistProject

func (h *Harbor) ExistProject(name string) (bool, error)

func (*Harbor) GetRobotAccounts

func (h *Harbor) GetRobotAccounts(projectId int) ([]*RobotAccount, error)

func (*Harbor) ListProjects

func (h *Harbor) ListProjects() ([]Project, error)

func (*Harbor) NewProject

func (h *Harbor) NewProject(p *NewProjectRequest) error

func (*Harbor) SetTransport

func (h *Harbor) SetTransport(t http.RoundTripper)

type NewProjectRequest

type NewProjectRequest struct {
	ProjectName  string          `json:"project_name"`
	CVEWhitelist CVEWhitelist    `json:"cve_whitelist,omitempty"`
	CountLimit   int             `json:"count_limit,omitempty"`
	StorageLimit int             `json:"storage_limit,omitempty"`
	Metadata     ProjectMetadata `json:"metadata,omitempty"`
}

type NewRobotAccountRequest

type NewRobotAccountRequest struct {
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	Access      []Access `json:"access,omitempty"`
}

type Project

type Project struct {
	Id       int             `json:"project_id,omitempty"`
	OwnerId  int             `json:"owner_id,omitempty"`
	Name     string          `json:"name"`
	Metadata ProjectMetadata `json:"metadata"`
}

type ProjectMetadata

type ProjectMetadata struct {
	Public               string `json:"public,omitempty"`
	EnableContentTrust   string `json:"enable_content_trust,omitempty"`
	AutoScan             string `json:"auto_scan,omitempty"`
	Severity             string `json:"severity,omitempty"`
	ReuseSysCVEWhitelist string `json:"reuse_sys_cve_whitelist,omitempty"`
	PreventVUL           string `json:"prevent_vul,omitempty"`
}

type RobotAccount

type RobotAccount struct {
	Id           int    `json:"id,omitempty"`
	ProjectId    int    `json:"project_id,omitempty"`
	Name         string `json:"name"`
	Description  string `json:"description,omitempty"`
	Token        string `json:"token,omitempty"`
	Disabled     bool   `json:"disabled,omitempty"`
	ExpiresAt    int    `json:"expires_at,omitempty"`
	CreationTime string `json:"creation_time,omitempty"`
	UpdateTime   string `json:"update_time,omitempty"`
}

Jump to

Keyboard shortcuts

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