resources

package
v0.43.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseGcpResource

type BaseGcpResource struct {
	// A key-value of identifiers and nukable status
	Nukables map[string]error
	Timeout  time.Duration
	Context  context.Context

	// The GCP project ID
	ProjectID string
	// contains filtered or unexported fields
}

BaseGcpResource struct and its associated methods to serve as a placeholder or template for a resource that is not yet fully implemented within a system or framework. Its purpose is to provide a skeleton structure that adheres to a specific interface or contract expected by the system without containing the actual implementation details.

func (*BaseGcpResource) CancelContext

func (br *BaseGcpResource) CancelContext()

CancelContext cancels the context for the resource operation

func (*BaseGcpResource) GetAndSetIdentifiers

func (br *BaseGcpResource) GetAndSetIdentifiers(_ context.Context, _ config.Config) ([]string, error)

func (*BaseGcpResource) GetAndSetResourceConfig

func (br *BaseGcpResource) GetAndSetResourceConfig(_ config.Config) config.ResourceType

func (*BaseGcpResource) GetNukableStatus

func (br *BaseGcpResource) GetNukableStatus(identifier string) (error, bool)

func (*BaseGcpResource) Init

func (br *BaseGcpResource) Init(projectID string)

func (*BaseGcpResource) IsNukable

func (br *BaseGcpResource) IsNukable(identifier string) (bool, error)

func (*BaseGcpResource) MaxBatchSize

func (br *BaseGcpResource) MaxBatchSize() int

func (*BaseGcpResource) Nuke

func (br *BaseGcpResource) Nuke(_ []string) error

func (*BaseGcpResource) PrepareContext

func (br *BaseGcpResource) PrepareContext(parentContext context.Context, resourceConfig config.ResourceType) error

PrepareContext creates a new context with timeout for the resource operation

func (*BaseGcpResource) ResourceIdentifiers

func (br *BaseGcpResource) ResourceIdentifiers() []string

func (*BaseGcpResource) ResourceName

func (br *BaseGcpResource) ResourceName() string

func (*BaseGcpResource) SetNukableStatus

func (br *BaseGcpResource) SetNukableStatus(identifier string, err error)

type GCSBucketAPI

type GCSBucketAPI interface {
	Buckets(ctx context.Context, projectID string) *storage.BucketIterator
	Bucket(name string) *storage.BucketHandle
}

GCSBucketAPI represents the interface for GCS bucket operations

type GCSBuckets

type GCSBuckets struct {
	BaseGcpResource
	Client GCSBucketAPI
	Names  []string
}

GCSBuckets represents all GCS buckets in a project

func (*GCSBuckets) GetAndSetIdentifiers

func (b *GCSBuckets) GetAndSetIdentifiers(c context.Context, configObj config.Config) ([]string, error)

func (*GCSBuckets) GetAndSetResourceConfig

func (b *GCSBuckets) GetAndSetResourceConfig(configObj config.Config) config.ResourceType

func (*GCSBuckets) Init

func (b *GCSBuckets) Init(projectID string)

func (*GCSBuckets) MaxBatchSize

func (b *GCSBuckets) MaxBatchSize() int

func (*GCSBuckets) Nuke

func (b *GCSBuckets) Nuke(identifiers []string) error

Nuke deletes the specified GCS buckets

func (*GCSBuckets) ResourceIdentifiers

func (b *GCSBuckets) ResourceIdentifiers() []string

func (*GCSBuckets) ResourceName

func (b *GCSBuckets) ResourceName() string

Jump to

Keyboard shortcuts

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