Documentation ¶
Index ¶
- type StreamerClient
- type StreamerOpt
- func WithCacheManager(cache agentcache.Manager) StreamerOpt
- func WithEventSyncError(cb func()) StreamerOpt
- func WithHarvester(hClient harvester.Harvest, sequence events.SequenceProvider) StreamerOpt
- func WithOnStreamConnection() StreamerOpt
- func WithUserAgent(userAgent string) StreamerOpt
- func WithWatchTopic(wt *management.WatchTopic) StreamerOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StreamerClient ¶
type StreamerClient struct {
// contains filtered or unexported fields
}
StreamerClient client for starting a watch controller stream and handling the events
func NewStreamerClient ¶
func NewStreamerClient( apiClient events.APIClient, cfg config.CentralConfig, getToken auth.TokenGetter, handlers []handler.Handler, options ...StreamerOpt, ) (*StreamerClient, error)
NewStreamerClient creates a StreamerClient
func (*StreamerClient) Healthcheck ¶
func (s *StreamerClient) Healthcheck(_ string) *hc.Status
Healthcheck - health check for stream client
func (*StreamerClient) Start ¶
func (s *StreamerClient) Start() error
Start creates and starts everything needed for a stream connection to central.
func (*StreamerClient) Status ¶
func (s *StreamerClient) Status() error
Status returns the health status
func (*StreamerClient) UpdateAgentStatus ¶ added in v1.1.105
func (s *StreamerClient) UpdateAgentStatus(state, prevState, message string) error
type StreamerOpt ¶
type StreamerOpt func(client *StreamerClient)
StreamerOpt func for setting fields on the StreamerClient
func WithCacheManager ¶
func WithCacheManager(cache agentcache.Manager) StreamerOpt
WithCacheManager sets a cache manager
func WithEventSyncError ¶
func WithEventSyncError(cb func()) StreamerOpt
WithEventSyncError sets the callback func to run when there is an error syncing events
func WithHarvester ¶
func WithHarvester(hClient harvester.Harvest, sequence events.SequenceProvider) StreamerOpt
WithHarvester configures the streaming client to use harvester for syncing initial events
func WithOnStreamConnection ¶
func WithOnStreamConnection() StreamerOpt
WithOnStreamConnection func to execute when a connection to central is made
func WithUserAgent ¶ added in v1.1.96
func WithUserAgent(userAgent string) StreamerOpt
WithUserAgent sets the userAgent for gRPC stream
func WithWatchTopic ¶
func WithWatchTopic(wt *management.WatchTopic) StreamerOpt
WithWatchTopic sets the watch topic