harbor

package
v0.60.4 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HaborRegistryUsername = "harbor_registry_user"
)
View Source
const Namespace = "harbor"

Variables

This section is empty.

Functions

func BulkDelete added in v0.21.3

func BulkDelete(p *platform.Platform, concurrency int, file string, expectedCount int) error

func CheckManifest added in v0.21.3

func CheckManifest(p *platform.Platform, image string) error

func Defaults

func Defaults(p *types.PlatformConfig)

func Deploy

func Deploy(p *platform.Platform) error

func IntegrityCheck added in v0.21.1

func IntegrityCheck(p *platform.Platform, concurrency int) (chan Tag, error)

func IntegrityCheckFromFile added in v0.21.1

func IntegrityCheckFromFile(p *platform.Platform, concurrency int, file string) (chan Tag, error)

func ListImages added in v0.21.1

func ListImages(p *platform.Platform, concurrency int) (chan Image, error)

func ListImagesWithTags added in v0.21.1

func ListImagesWithTags(p *platform.Platform, concurrency int) (chan Tag, error)

func ReplicateAll

func ReplicateAll(p *platform.Platform) error

func Test

func Test(p *platform.Platform, test *console.TestResults)

func UpdateSettings

func UpdateSettings(p *platform.Platform) error

Types

type Artifact added in v0.21.1

type Artifact struct {
	ID                int           `json:"id,omitempty"`
	Type              string        `json:"type,omitempty"`
	MediaType         string        `json:"media_type,omitempty"`
	ManifestMediaType string        `json:"manifest_media_type,omitempty"`
	ProjectID         int           `json:"project_id,omitempty"`
	RepositoryID      int           `json:"repository_id,omitempty"`
	Digest            string        `json:"digest,omitempty"`
	Size              int           `json:"size,omitempty"`
	Tags              []ArtifactTag `json:"tags"`
}

type ArtifactTag added in v0.21.1

type ArtifactTag struct {
	Name string `json:"name"`
}

type Client

type Client struct {
	logger.Logger
	// contains filtered or unexported fields
}

func NewClient

func NewClient(p *platform.Platform) (*Client, error)

NewClient creates a new harbor client using proxy dialer

func (*Client) GetStatus

func (harbor *Client) GetStatus() (*Status, error)

func (*Client) ListMembers

func (harbor *Client) ListMembers(project string) ([]ProjectMember, error)

func (*Client) ListReplicationPolicies

func (harbor *Client) ListReplicationPolicies() (policies []ReplicationPolicy, customErr error)

func (*Client) TriggerReplication

func (harbor *Client) TriggerReplication(id int) (*Replication, error)

func (*Client) UpdateSettings

func (harbor *Client) UpdateSettings(settings types.HarborSettings) error

type Error added in v0.21.1

type Error struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type ErrorResponse added in v0.21.1

type ErrorResponse struct {
	Errors []Error `json:"errors"`
}

func (*ErrorResponse) String added in v0.21.1

func (e *ErrorResponse) String() string

type Image added in v0.21.1

type Image struct {
	ID            int    `json:"id,omitempty"`
	ProjectID     int    `json:"project_id,omitempty"`
	Name          string `json:"name,omitempty"`
	Description   string `json:"description,omitempty"`
	ArtifactCount int    `json:"artifact_count,omitempty"`
	PullCount     int    `json:"pull_count,omitempty"`

	ProjectName string `json:"-"`
}

type IngressClient added in v0.21.1

type IngressClient struct {
	logger.Logger
	// contains filtered or unexported fields
}

func NewIngressClient added in v0.21.1

func NewIngressClient(p *platform.Platform) (*IngressClient, error)

NewIngressClient creates a new harbor client using the harbor ingress

func (*IngressClient) DeleteTag added in v0.21.3

func (harbor *IngressClient) DeleteTag(tag Tag) error

func (*IngressClient) GetManifest added in v0.21.1

func (harbor *IngressClient) GetManifest(project, image, tag string) (*Manifest, error)

func (*IngressClient) ListArtifacts added in v0.21.1

func (harbor *IngressClient) ListArtifacts(project string, image string) ([]Artifact, error)

func (*IngressClient) ListImages added in v0.21.1

func (harbor *IngressClient) ListImages(project string) ([]Image, error)

func (*IngressClient) ListProjects added in v0.21.1

func (harbor *IngressClient) ListProjects() ([]Project, error)

type IntegrityCheckFile added in v0.21.3

type IntegrityCheckFile struct {
	Artifacts []Tag `yaml:"artifacts"`
	Count     int   `yaml:"count"`
}

type Manifest added in v0.21.1

type Manifest struct {
	SchemaVersion int             `json:"schemaVersion"`
	MediaType     string          `json:"mediaType"`
	Config        ManifestLayer   `json:"config"`
	Layers        []ManifestLayer `json:"layers"`
}

type ManifestLayer added in v0.21.1

type ManifestLayer struct {
	MediaType string `json:"mediaType"`
	Size      int    `json:"size"`
	Digest    string `json:"digest"`
}

type Project

type Project struct {
	ID   int    `json:"id,omitempty"`
	Name string `json:"name,omitempty"`
}

func ListProjects added in v0.21.1

func ListProjects(p *platform.Platform) ([]Project, error)

type ProjectMember

type ProjectMember struct {
	ID         int    `json:"id,omitempty"`
	ProjectID  int    `json:"project_id,omitempty"`
	EntityName string `json:"entity_name,omitempty"`
	RoleName   string `json:"role_name,omitempty"`
	RoleID     int    `json:"role_id,omitempty"`
	EntityID   int    `json:"entity_id,omitempty"`
	EntityType string `json:"entity_type,omitempty"`
}

type Replication

type Replication struct {
	ID         int    `json:"id,omitempty"`
	PolicyID   int    `json:"policy_id,omitempty"`
	Status     string `json:"status,omitempty"`
	StatusText string `json:"status_text,omitempty"`
	Trigger    string `json:"trigger,omitempty"`
	Total      int    `json:"total,omitempty"`
	Failed     int    `json:"failed,omitempty"`
	Succeed    int    `json:"succeed,omitempty"`
	InProgress int    `json:"in_progress,omitempty"`
	Stopped    int    `json:"stopped,omitempty"`
	StartTime  string `json:"start_time,omitempty"`
	EndTime    string `json:"end_time,omitempty"`
}

type ReplicationFilter

type ReplicationFilter struct {
	Type  string `json:"type,omitempty"`
	Value string `json:"value,omitempty"`
}

type ReplicationPolicy

type ReplicationPolicy struct {
	ID            int                 `json:"id,omitempty"`
	Name          string              `json:"name,omitempty"`
	Description   string              `json:"description,omitempty"`
	SrcRegistry   ReplicationRegistry `json:"src_registry,omitempty"`
	DestRegistry  ReplicationRegistry `json:"dest_registry,omitempty"`
	DestNamespace string              `json:"dest_namespace,omitempty"`
	Trigger       ReplicationTrigger  `json:"trigger,omitempty"`
	Filters       []ReplicationFilter `json:"filters,omitempty"`
	Deletion      bool                `json:"deletion,omitempty"`
	Override      bool                `json:"override,omitempty"`
	Enabled       bool                `json:"enabled,omitempty"`
	CreationTime  string              `json:"creation_time,omitempty"`
	UpdateTime    string              `json:"update_time,omitempty"`
}

type ReplicationRegistry

type ReplicationRegistry struct {
	ID         int    `json:"id,omitempty"`
	URL        string `json:"url,omitempty"`
	Name       string `json:"name,omitempty"`
	Credential struct {
		Type         string `json:"type,omitempty"`
		AccessKey    string `json:"access_key,omitempty"`
		AccessSecret string `json:"access_secret,omitempty"`
	} `json:"credential,omitempty"`
	Type         string `json:"type,omitempty"`
	Insecure     bool   `json:"insecure,omitempty"`
	Description  string `json:"description,omitempty"`
	Status       string `json:"status,omitempty"`
	CreationTime string `json:"creation_time,omitempty"`
	UpdateTime   string `json:"update_time,omitempty"`
}

type ReplicationTrigger

type ReplicationTrigger struct {
	Type            string `json:"type,omitempty"`
	TriggerSettings struct {
		Cron string `json:"cron,omitempty"`
	} `json:"trigger_settings,omitempty"`
}

type Status

type Status struct {
	Status     string `json:"status"`
	Components []struct {
		Name   string `json:"name"`
		Status string `json:"status"`
	} `json:"components"`
}

type Tag added in v0.21.1

type Tag struct {
	Name           string `json:"-" yaml:"tag"`
	ProjectName    string `json:"-" yaml:"project"`
	RepositoryName string `json:"-" yaml:"repository"`
	Digest         string `json:"-" yaml:"digest"`
}

Jump to

Keyboard shortcuts

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