Documentation ¶
Overview ¶
This package provides a multiplexer for combine one or more gRPC event streams into a single stream. Useful for running the eventchecker across multiple gRPC connections simultaneously, for example in a multi-node cluster.
Index ¶
- type ClientMultiplexer
- func (cm *ClientMultiplexer) Connect(ctx context.Context, connTimeout time.Duration, addrs ...string) error
- func (cm *ClientMultiplexer) GetEvents(ctx context.Context, allowList, denyList []*tetragon.Filter) (chan GetEventsResult, error)
- func (cm *ClientMultiplexer) WithConnectBackoff(backoff time.Duration) *ClientMultiplexer
- func (cm *ClientMultiplexer) WithConnectRetries(retries uint) *ClientMultiplexer
- type GetEventsResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientMultiplexer ¶
type ClientMultiplexer struct {
// contains filtered or unexported fields
}
ClientMultiplexer multiplexes one or more GetEvents clients into a single stream
func NewClientMultiplexer ¶
func NewClientMultiplexer() *ClientMultiplexer
NewClientMultiplexer constructs a new ClientMultiplexer.
func (*ClientMultiplexer) Connect ¶
func (cm *ClientMultiplexer) Connect(ctx context.Context, connTimeout time.Duration, addrs ...string) error
Connect connects the ClientMultiplexer to one or more gRPC servers specified addrs
func (*ClientMultiplexer) GetEvents ¶
func (cm *ClientMultiplexer) GetEvents(ctx context.Context, allowList, denyList []*tetragon.Filter) (chan GetEventsResult, error)
GetEventsWithFilters calls GetEvents for each client in the multiplexer and returns a channel that multiplexes the GetEventsResponses. allowList and denyList can be used to filter what events we care about.
func (*ClientMultiplexer) WithConnectBackoff ¶
func (cm *ClientMultiplexer) WithConnectBackoff(backoff time.Duration) *ClientMultiplexer
WithConnectBackoff updates the backoff time between connection attempts to each gRPC server. The default is 1 second.
func (*ClientMultiplexer) WithConnectRetries ¶
func (cm *ClientMultiplexer) WithConnectRetries(retries uint) *ClientMultiplexer
WithConnectRetries updates the number of attempts this multiplexer will make to connect to each gRPC server. The default is 10.
type GetEventsResult ¶
type GetEventsResult struct { *tetragon.GetEventsResponse Error error }
GetEventsResult encapsulates a GetEventsResponse and an error