Documentation
¶
Index ¶
- type BaseGcpResource
- func (br *BaseGcpResource) CancelContext()
- func (br *BaseGcpResource) GetAndSetIdentifiers(_ context.Context, _ config.Config) ([]string, error)
- func (br *BaseGcpResource) GetAndSetResourceConfig(_ config.Config) config.ResourceType
- func (br *BaseGcpResource) GetNukableStatus(identifier string) (error, bool)
- func (br *BaseGcpResource) Init(projectID string)
- func (br *BaseGcpResource) IsNukable(identifier string) (bool, error)
- func (br *BaseGcpResource) MaxBatchSize() int
- func (br *BaseGcpResource) Nuke(_ []string) error
- func (br *BaseGcpResource) PrepareContext(parentContext context.Context, resourceConfig config.ResourceType) error
- func (br *BaseGcpResource) ResourceIdentifiers() []string
- func (br *BaseGcpResource) ResourceName() string
- func (br *BaseGcpResource) SetNukableStatus(identifier string, err error)
- type GCSBucketAPI
- type GCSBuckets
- func (b *GCSBuckets) GetAndSetIdentifiers(c context.Context, configObj config.Config) ([]string, error)
- func (b *GCSBuckets) GetAndSetResourceConfig(configObj config.Config) config.ResourceType
- func (b *GCSBuckets) Init(projectID string)
- func (b *GCSBuckets) MaxBatchSize() int
- func (b *GCSBuckets) Nuke(identifiers []string) error
- func (b *GCSBuckets) ResourceIdentifiers() []string
- func (b *GCSBuckets) ResourceName() string
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 (*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 (*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