module

package
v0.0.0-...-b68bda3 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: AGPL-3.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPoolSise = 300

Variables

View Source
var DefaultRootPath = filepath.Join(os.TempDir(), "harbor")

Functions

func Check

func Check(rt *goja.Runtime, err error)

func Checkf

func Checkf(rt *goja.Runtime, err error, format string, a ...interface{})

func ExportTo

func ExportTo(rt *goja.Runtime, target interface{}, args ...goja.Value)

func IDFromLocation

func IDFromLocation(rt *goja.Runtime, loc string) int64

func NameFromLocation

func NameFromLocation(loc string) string

func Throwf

func Throwf(rt *goja.Runtime, format string, a ...interface{})

Types

type ContentStore

type ContentStore struct {
	Runtime  *goja.Runtime
	Store    content.Store
	RootPath string
}

func (*ContentStore) Free

func (s *ContentStore) Free()

func (*ContentStore) Generate

func (s *ContentStore) Generate(humanSize goja.Value) (*ocispec.Descriptor, error)

func (*ContentStore) GenerateMany

func (s *ContentStore) GenerateMany(humanSize goja.Value, count int) ([]*ocispec.Descriptor, error)

type GetCatalogQuery

type GetCatalogQuery struct {
	N    int    `js:"n"`
	Last string `js:"last"`
}

type Harbor

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

func (*Harbor) CreateArtifactTag

func (h *Harbor) CreateArtifactTag(projectName, repositoryName, reference, newTag string) string

func (*Harbor) CreateProject

func (h *Harbor) CreateProject(body goja.Value) string

func (*Harbor) CreateProjectMember

func (h *Harbor) CreateProjectMember(projectName string, userID int64, roleIDs ...int64) string

func (*Harbor) CreateRegistry

func (h *Harbor) CreateRegistry(r models.Registry) int64

func (*Harbor) CreateReplicationPolicy

func (h *Harbor) CreateReplicationPolicy(policy models.ReplicationPolicy) int64

func (*Harbor) CreateRobot

func (h *Harbor) CreateRobot(robot models.RobotCreate) int64

func (*Harbor) CreateScanner

func (h *Harbor) CreateScanner(registration models.ScannerRegistrationReq) string

func (*Harbor) CreateUser

func (h *Harbor) CreateUser(username string, passwords ...string) int64

func (*Harbor) DeleteAllProjects

func (h *Harbor) DeleteAllProjects(excludeProjects []string)

func (*Harbor) DeleteArtifact

func (h *Harbor) DeleteArtifact(projectName, repositoryName, reference string)

func (*Harbor) DeleteProject

func (h *Harbor) DeleteProject(projectName string, args ...goja.Value)

func (*Harbor) DeleteRegistry

func (h *Harbor) DeleteRegistry(id int64)

func (*Harbor) DeleteReplicationPolicy

func (h *Harbor) DeleteReplicationPolicy(id int64)

func (*Harbor) DeleteRepository

func (h *Harbor) DeleteRepository(projectName, repositoryName string)

func (*Harbor) DeleteUser

func (h *Harbor) DeleteUser(userid int64)

func (*Harbor) Free

func (h *Harbor) Free()

func (*Harbor) GetArtifact

func (h *Harbor) GetArtifact(projectName, repositoryName, reference string) *models.Artifact

func (*Harbor) GetCatalog

func (h *Harbor) GetCatalog(args ...goja.Value) map[string]interface{}

func (*Harbor) GetGC

func (h *Harbor) GetGC(id int64) *models.GCHistory

func (*Harbor) GetManifest

func (h *Harbor) GetManifest(ref string) map[string]interface{}

func (*Harbor) GetProject

func (h *Harbor) GetProject(projectName string) *models.Project

func (*Harbor) GetReplicationExecution

func (h *Harbor) GetReplicationExecution(executionID int64) *models.ReplicationExecution

func (*Harbor) GetRepository

func (h *Harbor) GetRepository(projectName, repositoryName string) *models.Repository

func (*Harbor) GetScanAllMetrics

func (h *Harbor) GetScanAllMetrics() *models.Stats

func (*Harbor) Initialize

func (h *Harbor) Initialize(c goja.ConstructorCall)

func (*Harbor) ListArtifactTags

func (h *Harbor) ListArtifactTags(projectName, repositoryName, digestOrTag string, args ...goja.Value) []*models.Tag

func (*Harbor) ListArtifacts

func (h *Harbor) ListArtifacts(projectName, repositoryName string, args ...goja.Value) ListArtifactsResult

func (*Harbor) ListAuditLogs

func (h *Harbor) ListAuditLogs(args ...goja.Value) ListAuditLogsResult

func (*Harbor) ListAuditLogsOfProject

func (h *Harbor) ListAuditLogsOfProject(projectName string, args ...goja.Value) ListAuditLogsOfProjectResult

func (*Harbor) ListProjectMembers

func (h *Harbor) ListProjectMembers(projectName string, args ...goja.Value) ListProjectMembersResult

func (*Harbor) ListProjects

func (h *Harbor) ListProjects(args ...goja.Value) ListProjectsResult

func (*Harbor) ListQuotas

func (h *Harbor) ListQuotas(args ...goja.Value) ListQuotasResult

func (*Harbor) ListRegistries

func (h *Harbor) ListRegistries(args ...goja.Value) ListRegistriesResult

func (*Harbor) ListReplicationPolicies

func (h *Harbor) ListReplicationPolicies(args ...goja.Value) ListReplicationPoliciesResult

func (*Harbor) ListRepositories

func (h *Harbor) ListRepositories(projectName string, args ...goja.Value) ListRepositoriesResult

func (*Harbor) ListUsers

func (h *Harbor) ListUsers(args ...goja.Value) ListUsersResult

func (*Harbor) PrepareArtifactTags

func (h *Harbor) PrepareArtifactTags(option PrepareArtifactTagsOption) string

func (*Harbor) PrepareArtifacts

func (h *Harbor) PrepareArtifacts(option PrepareArtifactsOption)

func (*Harbor) Pull

func (h *Harbor) Pull(ref string, args ...goja.Value)

func (*Harbor) Push

func (h *Harbor) Push(option PushOption, args ...goja.Value) string

func (*Harbor) SearchUsers

func (h *Harbor) SearchUsers(args ...goja.Value) SearchUsersResult

func (*Harbor) SetScannerAsDefault

func (h *Harbor) SetScannerAsDefault(registrationID string)

func (*Harbor) StartGC

func (h *Harbor) StartGC() int64

func (*Harbor) StartGCAndWait

func (h *Harbor) StartGCAndWait()

func (*Harbor) StartReplication

func (h *Harbor) StartReplication(policyID int64) int64

func (*Harbor) StartScanAll

func (h *Harbor) StartScanAll()

type ListArtifactsResult

type ListArtifactsResult struct {
	Artifacts []*models.Artifact `js:"artifacts"`
	Total     int64              `js:"total"`
}

type ListAuditLogsOfProjectResult

type ListAuditLogsOfProjectResult struct {
	Logs  []*models.AuditLog `js:"logs"`
	Total int64              `js:"total"`
}

type ListAuditLogsResult

type ListAuditLogsResult struct {
	AuditLogs []*models.AuditLog `js:"logs"`
	Total     int64              `js:"total"`
}

type ListProjectMembersResult

type ListProjectMembersResult struct {
	ProjectMembers []*models.ProjectMemberEntity `js:"projectMembers"`
	Total          int64                         `js:"total"`
}

type ListProjectsResult

type ListProjectsResult struct {
	Projects []*models.Project `js:"projects"`
	Total    int64             `js:"total"`
}

type ListQuotasResult

type ListQuotasResult struct {
	Quotas []*models.Quota `js:"quotas"`
	Total  int64           `js:"total"`
}

type ListRegistriesResult

type ListRegistriesResult struct {
	Registries []*models.Registry `js:"registries"`
}

type ListReplicationPoliciesResult

type ListReplicationPoliciesResult struct {
	Policies []*models.ReplicationPolicy `js:"policies"`
	Total    int64                       `js:"total"`
}

type ListRepositoriesResult

type ListRepositoriesResult struct {
	Repositories []*models.Repository `js:"repositories"`
	Total        int64                `js:"total"`
}

type ListUsersResult

type ListUsersResult struct {
	Users []*models.UserResp `js:"users"`
	Total int64              `js:"total"`
}

type Module

type Module struct {
	*Harbor
}

func (*Module) Exports

func (m *Module) Exports() modules.Exports

type Option

type Option struct {
	Scheme   string // http or https
	Host     string
	Username string
	Password string
	Insecure bool // Allow insecure server connections when using SSL
}

type PrepareArtifactTagsOption

type PrepareArtifactTagsOption struct {
	ProjectName    string     `js:"projectName"`
	RepositoryName string     `js:"repositoryName"`
	ArtifactSize   goja.Value `js:"artifactSize"`
	TagsCount      int        `js:"tagsCount"`
}

type PrepareArtifactsOption

type PrepareArtifactsOption struct {
	ProjectName    string     `js:"projectName"`
	RepositoryName string     `js:"repositoryName"`
	ArtifactSize   goja.Value `js:"artifactSize"`
	ArtifactsCount int        `js:"artifactsCount"`
}

type PullOption

type PullOption struct {
	Discard bool
}

type PushOption

type PushOption struct {
	Ref   string
	Store *ContentStore
	Blobs []ocispec.Descriptor
}

type RootModule

type RootModule struct{}

func New

func New() *RootModule

New creates a new instance of the root module.

func (*RootModule) NewModuleInstance

func (*RootModule) NewModuleInstance(vu modules.VU) modules.Instance

type SearchUsersResult

type SearchUsersResult struct {
	Users []*models.UserSearchRespItem `js:"users"`
	Total int64                        `js:"total"`
}

Jump to

Keyboard shortcuts

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