resource

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2025 License: MIT Imports: 3 Imported by: 9

Documentation

Overview

Package resource provides a way to interact with resources. This provides multiple interfaces to test against as resources can optionally implement these interfaces.

All new resources should implement Properties() and UniqueKey(), but not String(). Without UniqueKey(), libnuke attempts to use Properties() to match resources, which does not work if any of the properties change in value during the run. UniqueKey() is also useful in older resources that still implement String(), to prevent libnuke from mistakenly identifying resources that were recreated with the same String() value after being nuked.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Resource
	Filter() error
}

type HandleWaitHook added in v0.15.0

type HandleWaitHook interface {
	Resource
	HandleWait(context.Context) error
}

HandleWaitHook is an interface that allows a resource to handle waiting for a resource to be deleted. This is useful for resources that may take a while to delete, typically where the delete operation happens asynchronously from the initial delete command. This allows libnuke to not block during the delete operation.

type LegacyStringer

type LegacyStringer interface {
	Resource
	String() string
}

type PropertyGetter

type PropertyGetter interface {
	Resource
	Properties() types.Properties
}

type QueueItemHook added in v0.16.0

type QueueItemHook interface {
	Resource
	BeforeEnqueue(interface{})
}

QueueItemHook is an interface that allows a resource to modify the queue item to which it belongs to. For advanced use only, please use with caution!

type Resource

type Resource interface {
	Remove(ctx context.Context) error
}

type SettingsGetter

type SettingsGetter interface {
	Resource
	Settings(setting *settings.Setting)
}

type UniqueKeyGetter added in v1.1.0

type UniqueKeyGetter interface {
	Resource
	UniqueKey() string
}

UniqueKeyGetter is an interface that allows a resource to provide a key that uniquely identifies an instance of a resource. UniqueKey() can return any field that uniquely identifies the resource and whose value is random or non- deterministic. For example, an EC2 instance ID (i-1234567890abcdef0), or resource name with creation time appended.

Jump to

Keyboard shortcuts

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