Skip to main content

NewGarbageCollector

Creates a new GarbageCollector instance, initializing it with a Kubernetes client, an interval for garbage collection runs, and a maximum time-to-live (TTL) for resources.

def NewGarbageCollector(
c: client.Client,
interval: time.Duration,
maxTTL: time.Duration
) - > *GarbageCollector

Creates a new GarbageCollector instance. This function initializes a GarbageCollector with the provided client, interval, and maximum time-to-live (TTL) settings.

Parameters

NameTypeDescription
cclient.ClientThe client interface used by the GarbageCollector to interact with external services or resources.
intervaltime.DurationThe duration between successive garbage collection runs.
maxTTLtime.DurationThe maximum time-to-live for items managed by the GarbageCollector. Items older than this duration will be considered for collection.

Returns

TypeDescription
*GarbageCollectorA pointer to a newly created GarbageCollector instance.