subscription

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeService

type NodeService interface {
	Subscribe(ctx context.Context) (_ <-chan model.NodeChangedEvent, err error)
}

func NewNodeService

func NewNodeService(subscription Subscription) NodeService

type Service

type Service[T model.NodeChangedEvent] interface {
	Notify(event T) error
	Subscribe(ctx context.Context) (<-chan T, error)
	HasSubscribers() bool
}

func NewPeerService

func NewPeerService(subscription Subscription) Service[*model.PeerChangedEvent]

func NewServerService

func NewServerService(subscription Subscription) Service[*model.ServerChangedEvent]

func NewUserService

func NewUserService(subscription Subscription) Service[*model.UserChangedEvent]

type Subscription

type Subscription interface {
	Notify(bytes []byte, channel string) error
	Subscribe(ctx context.Context, channel string) (<-chan []byte, error)
	HasSubscribers(channel string) bool
}

func NewInMemorySubscription

func NewInMemorySubscription() Subscription

Jump to

Keyboard shortcuts

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