Documentation ¶
Index ¶
- Constants
- func GetWatchTopic(cfg config.CentralConfig, client APIClient) (*management.WatchTopic, error)
- type APIClient
- type EventListener
- type Listener
- type NewListenerFunc
- type NewRequestQueueFunc
- type RequestQueue
- type SequenceProvider
- type WatchTopicValues
- func NewDiscoveryWatchTopic(name, scope string, agentResourceGroupKind v1.GroupKind, ...) WatchTopicValues
- func NewGovernanceAgentWatchTopic(name, scope string, agentResourceGroupKind v1.GroupKind, ...) WatchTopicValues
- func NewTraceWatchTopic(name, scope string, agentResourceGroupKind v1.GroupKind, ...) WatchTopicValues
Constants ¶
const ( // WatchTopicFilterTypeCreated filter type name WatchTopicFilterTypeCreated = "created" // WatchTopicFilterTypeUpdated filter type name WatchTopicFilterTypeUpdated = "updated" // WatchTopicFilterTypeDeleted filter type name WatchTopicFilterTypeDeleted = "deleted" )
Variables ¶
This section is empty.
Functions ¶
func GetWatchTopic ¶
func GetWatchTopic(cfg config.CentralConfig, client APIClient) (*management.WatchTopic, error)
GetWatchTopic retrieves a watch topic based on the agent config. Creates a watch topic if one does not exist.
Types ¶
type APIClient ¶
type APIClient interface { GetResource(url string) (*apiv1.ResourceInstance, error) CreateResourceInstance(ri apiv1.Interface) (*apiv1.ResourceInstance, error) DeleteResourceInstance(ri apiv1.Interface) error GetAPIV1ResourceInstances(map[string]string, string) ([]*apiv1.ResourceInstance, error) }
APIClient -
type EventListener ¶
type EventListener struct {
// contains filtered or unexported fields
}
EventListener holds the various caches to save events into as they get written to the source channel.
func NewEventListener ¶
func NewEventListener( source chan *proto.Event, client APIClient, sequenceManager SequenceProvider, cbs ...handler.Handler, ) *EventListener
NewEventListener creates a new EventListener to process events based on the provided Handlers.
func (*EventListener) HandleResource ¶
func (em *EventListener) HandleResource( ctx context.Context, eventMetadata *proto.EventMeta, resource *apiv1.ResourceInstance, )
HandleResource loops through all the handlers and passes the event to each one for processing.
func (*EventListener) Listen ¶
func (em *EventListener) Listen() chan error
Listen starts a loop that will process events as they are sent on the channel
type Listener ¶
type Listener interface { Listen() chan error Stop() }
Listener starts the EventListener
type NewListenerFunc ¶
type NewListenerFunc func( source chan *proto.Event, client APIClient, sequenceManager SequenceProvider, cbs ...handler.Handler, ) *EventListener
NewListenerFunc type for creating a new listener
type NewRequestQueueFunc ¶ added in v1.1.105
type NewRequestQueueFunc func(requestCh chan *proto.Request) RequestQueue
NewRequestQueueFunc type for creating a new request queue
type RequestQueue ¶ added in v1.1.105
func NewRequestQueue ¶ added in v1.1.105
func NewRequestQueue(requestCh chan *proto.Request) RequestQueue
NewRequestQueue creates a new queue for the requests to be sent for watch subscription
type SequenceProvider ¶
SequenceProvider - Interface to provide event sequence ID to harvester client to fetch events
func NewSequenceProvider ¶
func NewSequenceProvider(cacheManager agentcache.Manager, watchTopicName string) SequenceProvider
NewSequenceProvider creates a new SequenceProvider
type WatchTopicValues ¶
WatchTopicValues values to populate the watch topic template
func NewDiscoveryWatchTopic ¶
func NewDiscoveryWatchTopic(name, scope string, agentResourceGroupKind v1.GroupKind, features watchTopicFeatures) WatchTopicValues
NewDiscoveryWatchTopic creates a WatchTopic template string. Using a template instead of unmarshalling into a struct to avoid sending a request with empty fields
func NewGovernanceAgentWatchTopic ¶
func NewGovernanceAgentWatchTopic(name, scope string, agentResourceGroupKind v1.GroupKind, features watchTopicFeatures) WatchTopicValues
NewGovernanceAgentWatchTopic creates a WatchTopic template string
func NewTraceWatchTopic ¶
func NewTraceWatchTopic(name, scope string, agentResourceGroupKind v1.GroupKind, features watchTopicFeatures) WatchTopicValues
NewTraceWatchTopic creates a WatchTopic template string