scanner

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2024 License: MIT Imports: 11 Imported by: 4

Documentation

Overview

Package scanner provides a mechanism for scanning resources and adding them to the item queue for processing. The scope of the scanner is determined by the resource types that are passed to it. The scanner will then run the lister for each resource type and add the resources to the item queue for processing.

Index

Constants

View Source
const DefaultParallelQueries = 16

DefaultParallelQueries is the number of parallel queries to run at any given time for a scanner.

Variables

This section is empty.

Functions

This section is empty.

Types

type IScanner

type IScanner interface {
	Run(resourceTypes []string)
	// contains filtered or unexported methods
}

type MutateOptsFunc

type MutateOptsFunc func(opts interface{}, resourceType string) interface{}

MutateOptsFunc is a function that can mutate the Options for a given resource type. This is useful for when you need to pass in a different set of Options for a given resource type. For example, AWS nuke needs to be able to populate the region and session for a given resource type give that it might only exist in us-east-1.

type Scanner

type Scanner struct {
	Items chan *queue.Item `hash:"ignore"`

	ResourceTypes []string
	Options       interface{}
	Owner         string
	// contains filtered or unexported fields
}

Scanner is collection of resource types that will be scanned for existing resources and added to the item queue for processing. These items will be filtered and then processed.

func New

func New(owner string, resourceTypes []string, opts interface{}) *Scanner

New creates a new scanner for the given resource types.

func (*Scanner) RegisterMutateOptsFunc

func (s *Scanner) RegisterMutateOptsFunc(morph MutateOptsFunc) error

RegisterMutateOptsFunc registers a mutate Options function for the scanner. The mutate Options function is called for each resource type that is being scanned. This allows you to mutate the Options for a given resource type.

func (*Scanner) Run

func (s *Scanner) Run(ctx context.Context) error

Run starts the scanner and runs the lister for each resource type.

func (*Scanner) SetParallelQueries

func (s *Scanner) SetParallelQueries(parallelQueries int64)

SetParallelQueries changes the number of parallel queries to run at any given time from the default for the scanner.

Jump to

Keyboard shortcuts

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