garbage

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// Run runs the garbage collector. Collects every 30 seconds, or when the
	// collector is shutting down.
	Run(ctx context.Context) error

	// Push pushes a key to the garbage collector to be deleted.
	Push(key string)

	// Pop removes a key from the garbage collector.
	Pop(key string)
}

Interface is a garbage collector. It is used to queue-up deletion of ETCD keys so that they can be deleted in bulk and not interrupt triggering. Keys can be pulled from garbage collection queue. Runs every 30s.

func New

func New(opts Options) (Interface, error)

New creates a new garbage collector.

type Options

type Options struct {
	// Log is the logger for the collector to use.
	Log logr.Logger

	// Client is the ETCD client to use for deleting keys.
	Client client.Interface

	// CollectionInterval is the interval at which the garbage collector runs.
	// When nil, defaults to 180 seconds.
	CollectionInterval *time.Duration
}

Options is the configuration for the garbage collector.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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