resources

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceBusSize = 10000
View Source
const ResourceCreatorUnknown = "unknown"

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsBlame

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

func NewAwsBlame

func NewAwsBlame(ctx context.Context, clients AwsClientPool) *AwsBlame

func (*AwsBlame) Lookup

func (b *AwsBlame) Lookup(resource service.ResourceInterface) (*ResourceEvents, error)

func (*AwsBlame) LookupAll

func (b *AwsBlame) LookupAll(items ...service.ResourceInterface) (map[string]*ResourceEvents, error)

func (*AwsBlame) WithResourceTypeList

func (b *AwsBlame) WithResourceTypeList(resourceTypes []types.ResourceType) *AwsBlame

func (*AwsBlame) WithTtl

func (b *AwsBlame) WithTtl(ttl time.Duration) *AwsBlame

type AwsClientPool

type AwsClientPool interface {
	GetContext() context.Context
	GetClient(ptypes.AwsAccountID, ptypes.AwsRegion) (*v3.Client, error)
}

type HandlerFunc

type HandlerFunc func(c ResourceReaderInterface) error

type MiddlewareInterface

type MiddlewareInterface interface {
	HandleResourceReader(next HandlerFunc) HandlerFunc
}

type Provider

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

func NewProvider

func NewProvider(resourceType types.ResourceType, proxyPool ...proxy.RepoProxyInterface) Provider

func (Provider) Run

func (r Provider) Run() *ResourceReader

Run fetches aws resources and sends to resource channel

type ProviderInterface

type ProviderInterface interface {
	Run() *ResourceReader
}

type ProxyFailure added in v0.7.0

type ProxyFailure struct {
	AccountID ptypes.AwsAccountID
	Region    ptypes.AwsRegion
	Err       error
}

ProxyFailure records a proxy that produced no resources because it could not be queried, so a caller can tell a short answer from a complete one.

These used to be logged and dropped, which left "this account holds no resources of that type" and "this account could not be reached" indistinguishable in the result.

type ResourceEvents

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

func NewResourceEvents

func NewResourceEvents(resource service.ResourceInterface, events ...cloudtrail.Event) *ResourceEvents

func (*ResourceEvents) GetEntity

func (r *ResourceEvents) GetEntity() service.ResourceInterface

func (*ResourceEvents) GetEvents

func (r *ResourceEvents) GetEvents() []cloudtrail.Event

func (*ResourceEvents) GetUser

func (r *ResourceEvents) GetUser() string

func (*ResourceEvents) GetUsername

func (r *ResourceEvents) GetUsername() string

type ResourceObserver

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

func NewResourceObserver

func NewResourceObserver(gatewayPool *proxy.RepoProxyPool, handler HandlerFunc) *ResourceObserver

NewResourceObserver creates a new resource handler

func (*ResourceObserver) Handler

func (r *ResourceObserver) Handler() HandlerFunc

Handler returns the handler function

func (*ResourceObserver) Serve

func (r *ResourceObserver) Serve(resourceTypes []types.ResourceType) error

Serve runs the resource handler

func (*ResourceObserver) Use

func (r *ResourceObserver) Use(middlewares ...MiddlewareInterface)

Use adds middleware to the resource handler

type ResourceReader

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

func NewResourceReader

func NewResourceReader(
	resourceType types.ResourceType,
	channel <-chan service.ResourceInterface,
	failures <-chan ProxyFailure,
) *ResourceReader

func (*ResourceReader) Failures added in v0.7.0

func (cr *ResourceReader) Failures() []ProxyFailure

Failures reports the proxies that could not be queried during this run: a region that errored or timed out. An empty slice means every proxy answered, so the resource list is complete rather than merely short.

func (*ResourceReader) Read

func (*ResourceReader) ResourceType

func (cr *ResourceReader) ResourceType() types.ResourceType

type ResourceReaderInterface added in v0.2.0

type ResourceReaderInterface interface {
	ResourceType() types.ResourceType
	Read() []service.ResourceInterface
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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