resources

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2025 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.EntityInterface) (*ResourceEvents, error)

func (*AwsBlame) LookupAll

func (b *AwsBlame) LookupAll(items ...service.EntityInterface) (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) (*v2.Client, error)
}

type HandlerFunc

type HandlerFunc func(c *ResourceReader) 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, gatewayPool ...gateway.RepoGatewayInterface) 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 ResourceEvents

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

func NewResourceEvents

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

func (*ResourceEvents) GetEntity

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

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 *gateway.RepoGatewayPool, 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.EntityInterface) *ResourceReader

func (*ResourceReader) Read

func (cr *ResourceReader) Read() []service.EntityInterface

func (*ResourceReader) ResourceType

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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