processgc

package
v0.9.15 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package processgc provices an Account Manager Garbage Collection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyGC

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

KeyGC is a service account key garbage collector background process.

func NewKeyGC

func NewKeyGC(name string, warehouse clouds.AccountManager, store storage.Store, maxRequestedTTL time.Duration, keysPerAccount int, accountFilter func(account *clouds.Account) bool) *KeyGC

NewKeyGC creates a new key garbage collector.

func (*KeyGC) CleanupWork

func (k *KeyGC) CleanupWork(ctx context.Context, state *pb.Process, workName string, process *processlib.Process) error

CleanupWork has a worker perform the work needed to clean up a work item that was active previously.

func (*KeyGC) ProcessActiveWork

func (k *KeyGC) ProcessActiveWork(ctx context.Context, state *pb.Process, workName string, work *pb.Process_Work, process *processlib.Process) error

ProcessActiveWork has a worker perform the work needed to process an active work item.

func (*KeyGC) RegisterWork

func (k *KeyGC) RegisterWork(workName string, params *pb.Process_Params, tx storage.Tx) (*pb.Process_Work, error)

RegisterWork adds a work item to the state for workers to process.

func (*KeyGC) Run

func (k *KeyGC) Run(ctx context.Context)

Run schedules a background process. Typically this will be on its own go routine.

func (*KeyGC) UnregisterWork

func (k *KeyGC) UnregisterWork(workName string, tx storage.Tx) error

UnregisterWork (eventually) removes a work item from the active state, and allows cleanup work to be performed.

func (*KeyGC) UpdateSettings

func (k *KeyGC) UpdateSettings(maxRequestedTTL time.Duration, keysPerAccount int, tx storage.Tx) error

UpdateSettings alters resource management settings.

func (*KeyGC) Wait

func (k *KeyGC) Wait(ctx context.Context, duration time.Duration) bool

Wait indicates that the worker should wait for the next active cycle to begin.

func (*KeyGC) WaitCondition

func (k *KeyGC) WaitCondition(fn func(ctx context.Context, duration time.Duration) bool)

WaitCondition registers a callback that is called and checks conditions before every wait cycle.

Jump to

Keyboard shortcuts

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