utils

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: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAWSS3Client

func CreateAWSS3Client(accessKeyID, accessKeySecret, accountID string) *s3.Client

func CreateCFClient

func CreateCFClient(creds *types.Credentials) *cloudflare.Client

func CreateTemporaryR2Token

func CreateTemporaryR2Token(creds *types.Credentials) (string, string, error)

func DeleteTemporaryR2Token

func DeleteTemporaryR2Token(creds *types.Credentials, resources types.Resources) error

func FetchZones added in v0.8.2

func FetchZones(creds *types.Credentials, excludeZones []string) ([]*types.Zone, error)

FetchZones retrieves all zones for the account, excluding any zones in the excludeZones list

func PrettyPrintStatus

func PrettyPrintStatus(resources types.Resources)

func PrintFailedResources added in v0.7.0

func PrintFailedResources(resources types.Resources)

PrintFailedResources outputs all resources that failed deletion along with their error messages

func PrintStatusWithContext

func PrintStatusWithContext(wg *sync.WaitGroup, ctx context.Context, resources types.Resources)

func SpinWhile added in v0.6.0

func SpinWhile[T any](message string, fn func() T) (T, time.Duration)

SpinWhile runs a function while displaying a spinner with the given message Returns the result of the function and the duration it took

func SpinWhileWithError added in v0.6.0

func SpinWhileWithError[T any](message string, fn func() (T, error)) (T, error)

SpinWhileWithError runs a function while displaying a spinner Returns the result and error of the function

Types

type ScanLogger added in v0.8.1

type ScanLogger struct {
	// contains filtered or unexported fields
}

ScanLogger collects warnings and errors during scanning and writes them to a log file

func GetLogger added in v0.8.1

func GetLogger() *ScanLogger

GetLogger returns the global scan logger instance

func (*ScanLogger) EntryCount added in v0.8.1

func (l *ScanLogger) EntryCount() int

EntryCount returns the number of logged entries

func (*ScanLogger) Flush added in v0.8.1

func (l *ScanLogger) Flush() error

Flush writes all entries to the log file

func (*ScanLogger) HasEntries added in v0.8.1

func (l *ScanLogger) HasEntries() bool

HasEntries returns true if there are any logged entries

func (*ScanLogger) LogError added in v0.8.1

func (l *ScanLogger) LogError(format string, args ...interface{})

LogError logs an error message

func (*ScanLogger) LogFilePath added in v0.8.1

func (l *ScanLogger) LogFilePath() string

LogFilePath returns the path to the log file

func (*ScanLogger) LogWarning added in v0.8.1

func (l *ScanLogger) LogWarning(format string, args ...interface{})

LogWarning logs a warning message

func (*ScanLogger) PrintSummary added in v0.8.1

func (l *ScanLogger) PrintSummary()

PrintSummary prints a red warning message if there were errors/warnings

Jump to

Keyboard shortcuts

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