purge

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	CreatePurgeSchedule(ctx context.Context, schedule *model.Schedule) error
	RunPurge(ctx context.Context, dryRun bool) error
	ListPurgeHistory(ctx context.Context) ([]*model.ExecHistory, error)
	GetPurgeJob(ctx context.Context, id int64) (*model.ExecHistory, error)
	GetPurgeJobLog(ctx context.Context, id int64) (string, error)
	GetPurgeSchedule(ctx context.Context) (*model.ExecHistory, error)
	StopPurge(ctx context.Context, id int64) error
	UpdatePurgeSchedule(ctx context.Context, schedule *model.Schedule) 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 purge related actions.

func NewClient

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

func (*RESTClient) CreatePurgeSchedule

func (c *RESTClient) CreatePurgeSchedule(ctx context.Context, schedule *model.Schedule) error

CreatePurgeSchedule creates a new purge schedule.

func (*RESTClient) GetPurgeJob

func (c *RESTClient) GetPurgeJob(ctx context.Context, id int64) (*model.ExecHistory, error)

func (*RESTClient) GetPurgeJobLog

func (c *RESTClient) GetPurgeJobLog(ctx context.Context, id int64) (string, error)

func (*RESTClient) GetPurgeSchedule

func (c *RESTClient) GetPurgeSchedule(ctx context.Context) (*model.ExecHistory, error)

func (*RESTClient) ListPurgeHistory

func (c *RESTClient) ListPurgeHistory(ctx context.Context) ([]*model.ExecHistory, error)

ListPurgeHistory lists all purge history entries. While the APIs purge service exposes a method called 'GetPurgeHistory', it technically returns a list of purge schedules.

func (*RESTClient) RunPurge

func (c *RESTClient) RunPurge(ctx context.Context, dryRun bool) error

RunPurge runs a manual purge job.

func (*RESTClient) StopPurge

func (c *RESTClient) StopPurge(ctx context.Context, id int64) error

func (*RESTClient) UpdatePurgeSchedule

func (c *RESTClient) UpdatePurgeSchedule(ctx context.Context, schedule *model.Schedule) error

Jump to

Keyboard shortcuts

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