Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GarbageCollector ¶
type GarbageCollector struct {
// contains filtered or unexported fields
}
A GarbageCollector garbage collects the working directories of Terraform workspaces that no longer exist.
func NewGarbageCollector ¶
func NewGarbageCollector(c client.Client, parentDir string, o ...GarbageCollectorOption) *GarbageCollector
NewGarbageCollector returns a garbage collector that garbage collects the working directories of Terraform workspaces.
func (*GarbageCollector) Run ¶
func (gc *GarbageCollector) Run(ctx context.Context)
Run the garbage collector. Blocks until the supplied context is done.
type GarbageCollectorOption ¶
type GarbageCollectorOption func(*GarbageCollector)
A GarbageCollectorOption configures a new GarbageCollector.
func WithFs ¶
func WithFs(fs afero.Afero) GarbageCollectorOption
WithFs configures the afero filesystem implementation in which work dirs will be garbage collected. The default is the real operating system filesystem.
func WithInterval ¶
func WithInterval(i time.Duration) GarbageCollectorOption
WithInterval configures how often garbage collection will run. The default interval is one hour.
func WithLogger ¶
func WithLogger(l logging.Logger) GarbageCollectorOption
WithLogger configures the logger that will be used. The default is a no-op logger never emits logs.