Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSize ¶
FormatSize turns a byte count into a human readable string.
func Listen ¶
func Listen[T any](parent context.Context, sl StreamListener[T], sc StreamConfig) error
Types ¶
type StreamConfig ¶
func DefaultStreamConfig ¶
func DefaultStreamConfig(name string) StreamConfig
type StreamListener ¶
type StreamListener[T any] interface { // Connect indicates how the stream listener should connect and setup its primary stream Connect(context.Context) error // Produce indicates how to receive a series of messages on the connection Produce() ([]T, error) // Filter applies to produced items to determine whether they should be counted Filter(T) bool // Size applies to produced items to indicate its byte size Size(T) int // OnUpdate is a flexible trigger that can fire on each produced item OnUpdate(T) }
Click to show internal directories.
Click to hide internal directories.