Documentation ¶
Overview ¶
Package processgc provices an Account Manager Garbage Collection.
Index ¶
- type KeyGC
- func (k *KeyGC) CleanupWork(ctx context.Context, state *pb.Process, workName string, ...) error
- func (k *KeyGC) ProcessActiveWork(ctx context.Context, state *pb.Process, workName string, work *pb.Process_Work, ...) error
- func (k *KeyGC) RegisterWork(workName string, params *pb.Process_Params, tx storage.Tx) (*pb.Process_Work, error)
- func (k *KeyGC) Run(ctx context.Context)
- func (k *KeyGC) UnregisterWork(workName string, tx storage.Tx) error
- func (k *KeyGC) UpdateSettings(maxRequestedTTL time.Duration, keysPerAccount int, tx storage.Tx) error
- func (k *KeyGC) Wait(ctx context.Context, duration time.Duration) bool
- func (k *KeyGC) WaitCondition(fn func(ctx context.Context, duration time.Duration) bool)
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 ¶
Run schedules a background process. Typically this will be on its own go routine.
func (*KeyGC) UnregisterWork ¶
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.