gc

package
v5.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: MIT Imports: 8 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 {
	NewGarbageCollection(ctx context.Context, gcSchedule *modelv2.Schedule) error
	UpdateGarbageCollection(ctx context.Context,
		newGCSchedule *modelv2.Schedule) error
	GetGarbageCollectionExecution(ctx context.Context, id int64) (*modelv2.GCHistory, error)
	GetGarbageCollectionSchedule(ctx context.Context) (*modelv2.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 system 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) (*modelv2.GCHistory, error)

GetGarbageCollectionExecution Returns a garbage collection execution identified by its id.

func (*RESTClient) GetGarbageCollectionSchedule

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

GetGarbageCollectionSchedule returns the system GC schedule.

func (*RESTClient) NewGarbageCollection

func (c *RESTClient) NewGarbageCollection(ctx context.Context, gcSchedule *modelv2.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 *modelv2.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