subscription

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 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, authToken string, msgCh chan *message.Message) (*Subscription, error)

todo error

func (*Subscription) AuthToken added in v0.0.3

func (s *Subscription) AuthToken() string

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) StartMessageLoop added in v0.0.4

func (s *Subscription) StartMessageLoop(inMsg *message.Message, callback 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