goharborclient

package module
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2020 License: MIT Imports: 12 Imported by: 0

README

goharbor-client

GitHub license Go Report Card Go Doc Release

Maintainability Test Coverage Actions Status

STABILITY NOTICE: This project is still under development and not stable yet - breaking changes may happen at any time and without notice


A Go client library enabling programs to perform CRUD operations on the goharbor API.

This client library utilizes types generated by go-swagger.

Installation

Install this library using go get:

$ go get github.com/mittwald/goharbor-client

Usage

Example usage of the client can be found in the package examples.

Documentation

For more specific documentation, please refer to the godoc of this library.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

Client is an interface that groups all sub-package methods.

type RESTClient added in v1.0.0

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

RESTClient implements the Client interface as a REST client

func NewRESTClient added in v1.0.0

func NewRESTClient(cl *client.Harbor, authInfo runtime.ClientAuthInfoWriter) *RESTClient

NewRESTClient constructs a new REST client containing each sub client.

func NewRESTClientForHost added in v1.0.0

func NewRESTClientForHost(u, username, password string) (*RESTClient, error)

NewRESTClientForHost constructs a new REST client containing a swagger API client using the defined host string + basePath as well as basic auth info.

func (*RESTClient) AddProjectMember added in v1.0.0

func (c *RESTClient) AddProjectMember(ctx context.Context, p *model.Project, u *model.User, roleID int) error

AddProjectMember wraps the AddProjectMember method of the project sub-package.

func (*RESTClient) AddProjectMetadata added in v1.0.0

func (c *RESTClient) AddProjectMetadata(ctx context.Context,
	p *model.Project, key project.MetadataKey, value string) error

AddProjectMetadata wraps the AddProjectMetadata method of the project sub-package.

func (*RESTClient) DeleteProject added in v1.0.0

func (c *RESTClient) DeleteProject(ctx context.Context, p *model.Project) error

func (*RESTClient) DeleteProjectMember added in v1.0.0

func (c *RESTClient) DeleteProjectMember(ctx context.Context, p *model.Project, u *model.User) error

DeleteProjectMember wraps the DeleteProjectMember method of the project sub-package.

func (*RESTClient) DeleteProjectMetadataValue added in v1.0.0

func (c *RESTClient) DeleteProjectMetadataValue(ctx context.Context,
	p *model.Project, key project.MetadataKey) error

DeleteProjectMetadataValue wraps the DeleteProjectMetadataValue method of the project sub-package.

func (*RESTClient) DeleteRegistry added in v1.0.0

func (c *RESTClient) DeleteRegistry(ctx context.Context, r *model.Registry) error

DeleteRegistry wraps the DeleteRegistry method of the registry sub-package.

func (*RESTClient) DeleteReplicationPolicy added in v1.0.1

func (c *RESTClient) DeleteReplicationPolicy(ctx context.Context, r *model.ReplicationPolicy) error

DeleteReplicationPolicy wraps the DeleteReplicationPolicy method of the replication sub-package.

func (*RESTClient) DeleteUser added in v1.0.0

func (c *RESTClient) DeleteUser(ctx context.Context, u *model.User) error

DeleteUser wraps the DeleteUser method of the user sub-package.

func (*RESTClient) GetProject added in v1.0.0

func (c *RESTClient) GetProject(ctx context.Context, name string) (*model.Project, error)

GetProject wraps the GetProject method of the project sub-package.

func (*RESTClient) GetRegistry added in v1.0.0

func (c *RESTClient) GetRegistry(ctx context.Context, name string) (*model.Registry, error)

GetRegistry wraps the GetRegistry method of the registry sub-package.

func (*RESTClient) GetReplicationExecutions added in v1.0.1

func (c *RESTClient) GetReplicationExecutions(ctx context.Context,
	r *model.ReplicationExecution) ([]*model.ReplicationExecution, error)

GetReplicationExecutions wraps the GetReplicationExecutions method of the replication sub-package.

func (*RESTClient) GetReplicationExecutionsByID added in v1.0.1

func (c *RESTClient) GetReplicationExecutionsByID(ctx context.Context, id int64) (*model.ReplicationExecution, error)

GetReplicationExecutionsByID wraps the GetReplicationExecutionsByID method of the replication sub-package.

func (*RESTClient) GetReplicationPolicy added in v1.0.1

func (c *RESTClient) GetReplicationPolicy(ctx context.Context, name string) (*model.ReplicationPolicy, error)

GetReplicationPolicy wraps the GetReplicationPolicy method of the replication sub-package.

func (*RESTClient) GetReplicationPolicyByID added in v1.0.1

func (c *RESTClient) GetReplicationPolicyByID(ctx context.Context, id int64) (*model.ReplicationPolicy, error)

GetReplicationPolicyByID wraps the GetReplicationPolicyByID method of the replication sub-package.

func (*RESTClient) GetSystemGarbageCollection added in v1.0.0

func (c *RESTClient) GetSystemGarbageCollection(ctx context.Context) (*model.AdminJobSchedule, error)

GetSystemGarbageCollection wraps the GetSystemGarbageCollection method of the system sub-package.

func (*RESTClient) GetUser added in v1.0.0

func (c *RESTClient) GetUser(ctx context.Context, username string) (*model.User, error)

GetUser wraps the GetUser method of the user sub-package.

func (*RESTClient) ListProjectMembers added in v1.0.0

func (c *RESTClient) ListProjectMembers(ctx context.Context, p *model.Project) ([]*model.ProjectMemberEntity, error)

ListProjectMembers wraps the ListProjectMembers method of the project sub-package.

func (*RESTClient) ListProjectMetadata added in v1.0.0

func (c *RESTClient) ListProjectMetadata(ctx context.Context, p *model.Project) (*model.ProjectMetadata, error)

ListProjectMetadata wraps the ListProjectMetadata method of the project sub-package.

func (*RESTClient) ListProjects added in v1.0.0

func (c *RESTClient) ListProjects(ctx context.Context, nameFilter string) ([]*model.Project, error)

ListProjects wraps the ListProjects method of the project sub-package.

func (*RESTClient) NewProject added in v1.0.0

func (c *RESTClient) NewProject(ctx context.Context, name string,
	countLimit int, storageLimit int) (*model.Project, error)

NewProject wraps the NewProject method of the project sub-package.

func (*RESTClient) NewRegistry added in v1.0.0

func (c *RESTClient) NewRegistry(ctx context.Context, name, registryType, url string,
	credential *model.RegistryCredential, insecure bool) (*model.Registry, error)

NewRegistry wraps the NewRegistry method of the registry sub-package.

func (*RESTClient) NewReplicationPolicy added in v1.0.1

func (c *RESTClient) NewReplicationPolicy(ctx context.Context, destRegistry, srcRegistry *model.Registry,
	replicateDeletion, override, enablePolicy bool, filters []*model.ReplicationFilter,
	trigger *model.ReplicationTrigger, destNamespace, description, name string) (*model.ReplicationPolicy, error)

NewReplicationPolicy wraps the NewReplicationPolicy method of the replication sub-package.

func (*RESTClient) NewSystemGarbageCollection added in v1.0.0

func (c *RESTClient) NewSystemGarbageCollection(ctx context.Context,
	cron, scheduleType string) (*model.AdminJobSchedule, error)

NewSystemGarbageCollection wraps the NewSystemGarbageCollection method of the system sub-package.

func (*RESTClient) NewUser added in v1.0.0

func (c *RESTClient) NewUser(ctx context.Context, username, email, realname, password, comments string) (*model.User, error)

NewUser wraps the NewUser method of the user sub-package.

func (*RESTClient) ResetSystemGarbageCollection added in v1.0.0

func (c *RESTClient) ResetSystemGarbageCollection(ctx context.Context) error

ResetSystemGarbageCollection wraps the ResetSystemGarbageCollection method of the system sub-package.

func (*RESTClient) TriggerReplicationExecution added in v1.0.1

func (c *RESTClient) TriggerReplicationExecution(ctx context.Context, r *model.ReplicationExecution) error

TriggerReplicationExecution wraps the TriggerReplicationExecution method of the replication sub-package.

func (*RESTClient) UpdateProject added in v1.0.0

func (c *RESTClient) UpdateProject(ctx context.Context, p *model.Project, countLimit int, storageLimit int) error

UpdateProject wraps the UpdateProject method of the project sub-package.

func (*RESTClient) UpdateProjectMemberRole added in v1.0.0

func (c *RESTClient) UpdateProjectMemberRole(ctx context.Context, p *model.Project, u *model.User, roleID int) error

UpdateProjectMemberRole wraps the UpdateProjectMemberRole method of the project sub-package.

func (*RESTClient) UpdateProjectMetadata added in v1.0.0

func (c *RESTClient) UpdateProjectMetadata(ctx context.Context,
	p *model.Project, key project.MetadataKey, value string) error

UpdateProjectMetadata wraps the UpdateProjectMetadata method of the project sub-package.

func (*RESTClient) UpdateRegistry added in v1.0.1

func (c *RESTClient) UpdateRegistry(ctx context.Context, r *model.Registry) error

UpdateRegistry wraps the UpdateRegistry method of the registry sub-package.

func (*RESTClient) UpdateReplicationPolicy added in v1.0.1

func (c *RESTClient) UpdateReplicationPolicy(ctx context.Context, r *model.ReplicationPolicy) error

UpdateReplicationPolicy wraps the UpdateReplicationPolicy method of the replication sub-package.

func (*RESTClient) UpdateSystemGarbageCollection added in v1.0.0

func (c *RESTClient) UpdateSystemGarbageCollection(ctx context.Context,
	newGcSchedule *model.AdminJobScheduleObj) error

UpdateSystemGarbageCollection wraps the UpdateSystemGarbageCollection method of the system sub-package.

func (*RESTClient) UpdateUser added in v1.0.0

func (c *RESTClient) UpdateUser(ctx context.Context, u *model.User) error

UpdateUser wraps the UpdateUser method of the user sub-package.

func (*RESTClient) UpdateUserPassword added in v1.0.1

func (c *RESTClient) UpdateUserPassword(ctx context.Context, id int64, password *model.Password) error

UpdateUserPassword wraps the UpdateUserPassword method of the user sub-package.

Directories

Path Synopsis
internal
model

Jump to

Keyboard shortcuts

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