subscribers

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast

type Broadcast func(string, *types.Data)

type HttpSubscriber

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

func (*HttpSubscriber) Subscribe

func (sub *HttpSubscriber) Subscribe(callback Broadcast)

Subscribe to events to broadcast.

func (*HttpSubscriber) UnSubscribe added in v1.1.0

func (sub *HttpSubscriber) UnSubscribe()

Unsubscribe from events to broadcast.

type HttpSubscriberData

type HttpSubscriberData struct {
	Channels []string `json:"channels"`
	Channel  string   `json:"channel"`
	Name     string   `json:"name"`
	Data     string   `json:"data"`
	SocketId string   `json:"socket_id"`
}

type RedisSubscriber

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

func (*RedisSubscriber) Subscribe

func (sub *RedisSubscriber) Subscribe(callback Broadcast)

Subscribe to events to broadcast.

func (*RedisSubscriber) UnSubscribe added in v1.1.0

func (sub *RedisSubscriber) UnSubscribe()

Unsubscribe from events to broadcast.

type Subscriber

type Subscriber interface {
	// Subscribe to incoming events.
	Subscribe(Broadcast)

	// Unsubscribe from events to broadcast.
	UnSubscribe()
}

func NewHttpSubscriber

func NewHttpSubscriber(express *express.Express, _options *options.Config) Subscriber

Create new instance of http subscriber.

func NewRedisSubscriber

func NewRedisSubscriber(_options *options.Config) (Subscriber, error)

Create a new instance of subscriber.

Jump to

Keyboard shortcuts

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