handler

package
v1.1.121 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: Apache-2.0 Imports: 21 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetActionFromContext

func GetActionFromContext(ctx context.Context) proto.Event_Type

GetActionFromContext retrieve event type from the context

func NewEventContext

func NewEventContext(action proto.Event_Type, eventMetadata *proto.EventMeta, kind, name string) context.Context

NewEventContext - create a context for the new event

func RefreshTeamCache added in v1.1.121

func RefreshTeamCache(apicClient apicClient, cache agentCache)

func WithWatchTopicFeatures added in v1.1.115

func WithWatchTopicFeatures(feature watchTopicFeatures) watchTopicOptions

func WithWatchTopicGroupKind added in v1.1.115

func WithWatchTopicGroupKind(groupKinds []v1.GroupKind) watchTopicOptions

Types

type AgentResourceUpdateHandler added in v1.1.115

type AgentResourceUpdateHandler interface {
	AgentResourceUpdate(ctx context.Context, resource *v1.ResourceInstance)
}

Register an AgentResourceUpdateHandler in an agent to trigger events when changes to the resource is made

type ComplianceAgentHandler added in v1.1.115

type ComplianceAgentHandler interface {
	TriggerProcessing()
}

type Handler

type Handler interface {
	// Handle receives the type of the event context, event metadata and the API Server resource, if it exists.
	Handle(ctx context.Context, eventMetadata *proto.EventMeta, resource *v1.ResourceInstance) error
}

Handler interface used by the EventListener to process events.

func NewACLHandler

func NewACLHandler(agentCacheManager agentcache.Manager) Handler

NewACLHandler creates a Handler for Access Requests

func NewAPDHandler added in v1.1.109

func NewAPDHandler(agentCacheManager agentcache.Manager) Handler

NewAPDHandler creates a Handler for Application Profile Definitions

func NewAPISvcHandler

func NewAPISvcHandler(agentCacheManager agentcache.Manager, envName string) Handler

NewAPISvcHandler creates a Handler for API Services.

func NewARDHandler

func NewARDHandler(agentCacheManager agentcache.Manager) Handler

NewARDHandler creates a Handler for Access Requests

func NewAccessRequestHandler

func NewAccessRequestHandler(prov prov.AccessProvisioner, cache agentcache.Manager, client client, customUnitHandler customUnitHandler) Handler

NewAccessRequestHandler creates a Handler for Access Requests

func NewAgentResourceHandler

func NewAgentResourceHandler(agentResourceManager resource.Manager, sampler sampling, cache agentCache, apiClient apicClient) Handler

NewAgentResourceHandler - creates a Handler for Agent resources

func NewCRDHandler

func NewCRDHandler(agentCacheManager agentcache.Manager) Handler

NewCRDHandler creates a Handler for Credential Request Definitions

func NewCRRHandler added in v1.1.118

func NewCRRHandler(agentCacheManager agentcache.Manager) Handler

NewCRRHandler creates a Handler for Compliance Runtime Results

func NewCredentialHandler

func NewCredentialHandler(prov credProv, client client, providerRegistry oauth.IdPRegistry) Handler

NewCredentialHandler creates a Handler for Credentials

func NewEnvironmentHandler added in v1.1.52

func NewEnvironmentHandler(agentCacheManager agentcache.Manager, credentialConfig config.CredentialConfig, envName string) Handler

NewEnvironmentHandler creates a Handler for Environments.

func NewInstanceHandler

func NewInstanceHandler(agentCacheManager agentcache.Manager, envName string) Handler

NewInstanceHandler creates a Handler for API Service Instances.

func NewManagedApplicationHandler

func NewManagedApplicationHandler(prov prov.ApplicationProvisioner, cache agentcache.Manager, client client) Handler

NewManagedApplicationHandler creates a Handler for Credentials

func NewManagedApplicationProfileHandler added in v1.1.109

func NewManagedApplicationProfileHandler(prov prov.ApplicationProfileProvisioner, cache managedApplicationProfileCache, client client) Handler

NewManagedApplicationProfileHandler creates a Handler for Credentials

func NewTraceAccessRequestHandler

func NewTraceAccessRequestHandler(cache agentcache.Manager, client client) Handler

NewTraceAccessRequestHandler creates a Handler for Access Requests for trace agent

func NewTraceManagedApplicationHandler

func NewTraceManagedApplicationHandler(cache agentcache.Manager) Handler

NewTraceManagedApplicationHandler creates a Handler for Access Requests for trace agent

func NewWatchResourceHandler

func NewWatchResourceHandler(agentCacheManager agentcache.Manager, opts ...watchTopicOptions) Handler

NewWatchResourceHandler creates a Handler for custom watch resources to store resource in agent cache

type ProxyHandler

type ProxyHandler interface {
	// RegisterTargetHandler adds the target handler
	RegisterTargetHandler(name string, resourceHandler Handler)
	// UnregisterTargetHandler removes the specified handler
	UnregisterTargetHandler(name string)
}

ProxyHandler interface to represent the proxy resource handler.

type StreamWatchProxyHandler

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

StreamWatchProxyHandler - proxy handler for stream watch

func NewStreamWatchProxyHandler

func NewStreamWatchProxyHandler() *StreamWatchProxyHandler

NewStreamWatchProxyHandler - creates a Handler to proxy target resource handler

func (*StreamWatchProxyHandler) Handle

func (h *StreamWatchProxyHandler) Handle(ctx context.Context, eventMetadata *proto.EventMeta, resource *v1.ResourceInstance) error

Handle receives the type of the event (add, update, delete), event metadata and updated API Server resource

func (*StreamWatchProxyHandler) RegisterTargetHandler

func (h *StreamWatchProxyHandler) RegisterTargetHandler(name string, resourceHandler Handler)

RegisterTargetHandler adds the target handler

func (*StreamWatchProxyHandler) UnregisterTargetHandler

func (h *StreamWatchProxyHandler) UnregisterTargetHandler(name string)

UnregisterTargetHandler removes the specified handler

type TraceabilityTriggerHandler added in v1.1.113

type TraceabilityTriggerHandler interface {
	TriggerTraceability()
}

Jump to

Keyboard shortcuts

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