gc

package
v5.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 8 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 {
	NewGarbageCollection(ctx context.Context, gcSchedule *model.Schedule) error
	UpdateGarbageCollection(ctx context.Context,
		newGCSchedule *model.Schedule) error
	GetGarbageCollectionExecution(ctx context.Context, id int64) (*model.GCHistory, error)
	GetGarbageCollectionSchedule(ctx context.Context) (*model.GCHistory, error)
	ResetGarbageCollection(ctx context.Context) 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 garbage collection related actions.

func NewClient

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

func (*RESTClient) GetGarbageCollectionExecution

func (c *RESTClient) GetGarbageCollectionExecution(ctx context.Context, id int64) (*model.GCHistory, error)

GetGarbageCollectionExecution Returns a garbage collection execution identified by its id.

func (*RESTClient) GetGarbageCollectionSchedule

func (c *RESTClient) GetGarbageCollectionSchedule(ctx context.Context) (*model.GCHistory, error)

GetGarbageCollectionSchedule returns the system GC schedule.

func (*RESTClient) NewGarbageCollection

func (c *RESTClient) NewGarbageCollection(ctx context.Context, gcSchedule *model.Schedule) error

NewGarbageCollection creates a new garbage collection schedule.

func (*RESTClient) ResetGarbageCollection

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

ResetGarbageCollection resets the system GC schedule to it's default values containing "None" as the Schedule Type, which effectively deactivates the schedule. For this to work correctly, a GC schedule must exist beforehand.

func (*RESTClient) UpdateGarbageCollection

func (c *RESTClient) UpdateGarbageCollection(ctx context.Context,
	newGCSchedule *model.Schedule) error

UpdateGarbageCollection updates the system GC schedule.

Jump to

Keyboard shortcuts

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