subscription

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidChannelName = errors.New("invalid channel channel")

Functions

func IsValidPublishName

func IsValidPublishName(channel string) bool

isValidPublishName

func IsValidSubscriptionName

func IsValidSubscriptionName(channel string) bool

Types

type Subscription

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

func NewSubscription

func NewSubscription(chanel string, unsub Unsubscriber, msgCh chan *message.Message) (*Subscription, error)

todo error

func (*Subscription) MsgChannel

func (s *Subscription) MsgChannel() chan *message.Message

func (*Subscription) Name

func (s *Subscription) Name() string

func (*Subscription) OnMessage

func (s *Subscription) OnMessage(onMessage func(channel string, msg message.Data)) error

func (*Subscription) Unsubscribe

func (s *Subscription) Unsubscribe() error

Unsubscribe ...

type Unsubscriber

type Unsubscriber func(subscription *Subscription) error

Jump to

Keyboard shortcuts

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