workdir

package
v0.0.0-...-bd7b10a Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

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

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

WithLogger configures the logger that will be used. The default is a no-op logger never emits logs.

Jump to

Keyboard shortcuts

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