subscribe

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast added in v0.0.5

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

func NewBroadcast added in v0.0.5

func NewBroadcast() *Broadcast

func (*Broadcast) Publish added in v0.0.5

func (b *Broadcast) Publish(ctx context.Context, message *Message)

func (*Broadcast) RegisterSession added in v0.0.5

func (b *Broadcast) RegisterSession(sessionId string, pub Publisher)

func (*Broadcast) UnregisterSession added in v0.0.5

func (b *Broadcast) UnregisterSession(id string)

type BufferedBroadcast added in v1.1.0

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

func NewBufferedBroadcast added in v1.1.0

func NewBufferedBroadcast(n int) *BufferedBroadcast

func (*BufferedBroadcast) Publish added in v1.1.0

func (bb *BufferedBroadcast) Publish(ctx context.Context, msg *Message)

func (*BufferedBroadcast) RegisterSession added in v1.1.0

func (bb *BufferedBroadcast) RegisterSession(ctx context.Context, pub Publisher)

type FilterFunc added in v1.3.0

type FilterFunc func(*Message) bool

func FilterAnd added in v1.3.0

func FilterAnd(filterFuncs ...FilterFunc) FilterFunc

func FilterKeys added in v1.3.0

func FilterKeys(keys []string) (FilterFunc, error)

func FilterMaxAge added in v1.3.0

func FilterMaxAge(age string) (FilterFunc, error)

func FilterMinOffset added in v1.3.0

func FilterMinOffset(minOffset int64) FilterFunc

type FilterPublisher added in v1.0.0

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

func NewFilterPublisher added in v1.0.0

func NewFilterPublisher(pub Publisher) *FilterPublisher

func (*FilterPublisher) Publish added in v1.0.0

func (p *FilterPublisher) Publish(ctx context.Context, message *Message)

func (*FilterPublisher) SetFilter added in v1.0.0

func (p *FilterPublisher) SetFilter(f FilterFunc)
type Header struct {
	Key   string
	Value string
}

type KafkaClient

type KafkaClient interface {
	PollFetches(ctx context.Context) kgo.Fetches
}

type KafkaSubscriber

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

func NewKafkaSubscriber

func NewKafkaSubscriber(cli KafkaClient, pub Publisher) *KafkaSubscriber

func (*KafkaSubscriber) Subscribe

func (k *KafkaSubscriber) Subscribe(ctx context.Context)

type Message

type Message struct {
	Key       string
	Value     []byte
	Headers   []Header
	Timestamp time.Time
	Topic     string
	Partition int32
	Offset    int64
}

type Publisher

type Publisher interface {
	Publish(ctx context.Context, message *Message)
}

type Publishers added in v0.0.5

type Publishers []Publisher

func (Publishers) Publish added in v0.0.5

func (pubs Publishers) Publish(ctx context.Context, message *Message)

type SenderStream added in v1.2.0

type SenderStream interface {
	grpc.ServerStreamingServer[protobuf.Message]
}

type StreamPublisher added in v1.2.0

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

func NewStreamPublisher added in v1.2.0

func NewStreamPublisher(stream grpc.ServerStreamingServer[protobuf.Message]) *StreamPublisher

func (*StreamPublisher) Publish added in v1.2.0

func (s *StreamPublisher) Publish(ctx context.Context, message *Message)

Jump to

Keyboard shortcuts

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