stream

package
v1.1.60 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

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) Stop

func (s *StreamerClient) Stop()

Stop stops the StreamerClient

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 WithWatchTopic

func WithWatchTopic(wt *management.WatchTopic) StreamerOpt

WithWatchTopic sets the watch topic

Jump to

Keyboard shortcuts

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