bus

package
v0.0.0-...-f7dc3f6 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPubSub

func NewPubSub(newEvent FuncNewEvent) *pubSub

Types

type Bus

type Bus interface {
	Publish(ctx context.Context, event cloudevents.Event)
	Subscribe(ctx context.Context, channelName string) <-chan BusEvent
}

func Provide

func Provide(s setting.Setting) (Bus, error)

type BusEvent

type BusEvent struct {
	Event cloudevents.Event
	Raw   []byte
	Err   error
}

type BusImpl

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

func (*BusImpl) Publish

func (b *BusImpl) Publish(ctx context.Context, event cloudevents.Event)

func (*BusImpl) Subscribe

func (b *BusImpl) Subscribe(ctx context.Context, channel string) <-chan BusEvent

type Connector

type Connector interface {
	Publish(ctx context.Context, data []byte) error
	Subscribe(ctx context.Context, channel chan []byte)
	Len() int
}

func NewEventChannel

func NewEventChannel(ctx context.Context, chanelName string) Connector

type FuncNewEvent

type FuncNewEvent func(ctx context.Context, channelName string) Connector

func NewEventRedis

func NewEventRedis(url string) (FuncNewEvent, error)

Jump to

Keyboard shortcuts

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