types

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TemporaryR2TokenName                   = "CFNUKE-TEMPORARY-R2ADMIN"
	WorkersR2StorageWritePermissionGroupId = "bf7481a1826f439697cb59a20b22293e"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountCollector added in v0.8.2

type AccountCollector func(*Credentials) (Resources, error)

AccountCollector collects resources at the account level (no zone context)

type Credentials

type Credentials struct {
	APIKey         string
	AccountID      string
	User           string
	Mode           Mode
	S3AccessKeyID  string
	S3AccessSecret string
}

type Mode

type Mode string
const (
	Account Mode = "account"
	Token   Mode = "token"
)

type Removable

type Removable interface {
	// Some resources require the ID others the name for a delete operation
	Remove(accountID string, resourceID string, resourceName string) error
}

type Resource

type Resource struct {
	Removable
	AccountID    string
	ResourceID   string
	ResourceName string
	ProductName  string

	Error atomic.Value // stores error message string for failed resources
	// contains filtered or unexported fields
}

func (*Resource) GetError added in v0.7.0

func (r *Resource) GetError() string

GetError returns the error message for the resource (thread-safe)

func (*Resource) Remove

func (r *Resource) Remove(ctx context.Context) error

func (*Resource) SetError added in v0.7.0

func (r *Resource) SetError(err error)

SetError stores an error message for the resource (thread-safe)

func (*Resource) SetState added in v0.5.1

func (r *Resource) SetState(s ResourceState)

SetState sets the state of the resource (thread-safe)

func (*Resource) State

func (r *Resource) State() ResourceState

State returns the current state of the resource (thread-safe)

type ResourceState

type ResourceState int32
const (
	// Ready is the default state (zero value) for new resources
	Ready ResourceState = iota
	Removing
	Deleted
	Failed
	Filtered
	Hidden
)

func (ResourceState) String

func (i ResourceState) String() string

type Resources

type Resources []*Resource

func (Resources) NumOf

func (r Resources) NumOf(state ResourceState) int

func (Resources) VisibleCount

func (r Resources) VisibleCount() int

type Zone added in v0.8.2

type Zone struct {
	ID   string
	Name string
}

Zone represents a Cloudflare DNS zone

type ZoneCollector added in v0.8.2

type ZoneCollector func(*Credentials, *Zone) (Resources, error)

ZoneCollector collects resources for a specific zone

Jump to

Keyboard shortcuts

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