webhook

package
v5.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	ListProjectWebhookPolicies(ctx context.Context, projectID int) ([]*modelv2.WebhookPolicy, error)
	AddProjectWebhookPolicy(ctx context.Context, projectID int, policy *modelv2.WebhookPolicy) error
	UpdateProjectWebhookPolicy(ctx context.Context, projectID int, policy *modelv2.WebhookPolicy) error
	DeleteProjectWebhookPolicy(ctx context.Context, projectID int, policyID int64) error
}

type RESTClient

type RESTClient struct {
	// Options contains optional configuration when making API calls.
	Options *config.Options

	// The new client of the harbor v2 API
	V2Client *v2client.Harbor

	// AuthInfo contains the auth information that is provided on API calls.
	AuthInfo runtime.ClientAuthInfoWriter
}

RESTClient is a subclient for handling webhook related actions.

func NewClient

func NewClient(v2Client *v2client.Harbor, opts *config.Options, authInfo runtime.ClientAuthInfoWriter) *RESTClient

func (*RESTClient) AddProjectWebhookPolicy

func (c *RESTClient) AddProjectWebhookPolicy(ctx context.Context, projectID int, policy *modelv2.WebhookPolicy) error

AddProjectWebhookPolicy adds a webhook policy to project p.

func (*RESTClient) DeleteProjectWebhookPolicy

func (c *RESTClient) DeleteProjectWebhookPolicy(ctx context.Context, projectID int, policyID int64) error

DeleteProjectWebhookPolicy deletes the webhook policy identified by 'policyID' from the project identified by 'projectID'.

func (*RESTClient) ListProjectWebhookPolicies

func (c *RESTClient) ListProjectWebhookPolicies(ctx context.Context, projectID int) ([]*modelv2.WebhookPolicy, error)

ListProjectWebhookPolicies returns a list of all webhook policies in project p.

func (*RESTClient) UpdateProjectWebhookPolicy

func (c *RESTClient) UpdateProjectWebhookPolicy(ctx context.Context, projectID int, policy *modelv2.WebhookPolicy) error

UpdateProjectWebhookPolicy updates the WebhookPolicy 'policy' in the project identified by 'projectID'.

Jump to

Keyboard shortcuts

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