Documentation
¶
Index ¶
- Constants
- type AwsBlame
- func (b *AwsBlame) Lookup(resource service.ResourceInterface) (*ResourceEvents, error)
- func (b *AwsBlame) LookupAll(items ...service.ResourceInterface) (map[string]*ResourceEvents, error)
- func (b *AwsBlame) WithResourceTypeList(resourceTypes []types.ResourceType) *AwsBlame
- func (b *AwsBlame) WithTtl(ttl time.Duration) *AwsBlame
- type AwsClientPool
- type HandlerFunc
- type MiddlewareInterface
- type Provider
- type ProviderInterface
- type ProxyFailure
- type ResourceEvents
- type ResourceObserver
- type ResourceReader
- type ResourceReaderInterface
Constants ¶
const DefaultRegionTimeout = 60 * time.Second
DefaultRegionTimeout bounds how long one proxy may take to answer.
Without a bound, Read() waits on every proxy indefinitely, so a single region whose endpoint does not route holds the whole result set hostage and the caller gets nothing instead of every other region's resources. The calls behind a proxy are paginated list operations against one region, so a minute is generous. The cost of the bound is that a genuinely slow region is reported as a failure rather than waited for — the right trade for a caller that has a request deadline of its own.
const ResourceBusSize = 10000
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
type AwsClientPool ¶
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 (cr *ResourceReader) Read() []service.ResourceInterface
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
}