stream

package
v1.0.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GripStream

type GripStream interface {
	// PublishHttpStream publishes an HTTP stream format message to all of the configured PubControlClients
	// with a specified channel, message, and optional ID, previous ID, and callback.
	// Note that the 'http_stream' parameter can be provided as either an HttpStreamFormat
	// instance or a string / byte array (in which case an HttpStreamFormat instance will
	// automatically be created and have the 'content' field set to the specified value).
	PublishHttpStream(channel string, content interface{}, id string, prevID string) error

	Publish(channel string, item *pubcontrol.Item) error
}

GripStream is the interface for publishing events to a grip channel

type StreamWorker

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

StreamWorker is the type that subscribes to the SSEEvent Stream that the EventListener forwards SSEEvents from the embedded SDKs to and forwards them on to clients

func NewStreamWorker

func NewStreamWorker(l log.Logger, gpc GripStream, reg *prometheus.Registry) StreamWorker

NewStreamWorker creates a StreamWorker

func (StreamWorker) Pub

func (s StreamWorker) Pub(ctx context.Context, event stream.Event) (err error)

Pub makes StreamWorker implement the golang sdks stream.EventStreamListener interface.

Jump to

Keyboard shortcuts

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