emitter

package
v0.0.0-...-59e6379 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Emitter

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

Emitter Socket.IO redis base emitter

func NewEmitter

func NewEmitter(opts *Options) *Emitter

NewEmitter Emitter constructor

func (*Emitter) Broadcast

func (e *Emitter) Broadcast() *Emitter

Broadcast flag

func (*Emitter) Close

func (e *Emitter) Close()

Close release redis client

func (*Emitter) Emit

func (e *Emitter) Emit(data ...interface{}) (*Emitter, error)

Emit Send the packet

func (*Emitter) In

func (e *Emitter) In(room string) *Emitter

In Limit emission to a certain `room`

func (*Emitter) JSON

func (e *Emitter) JSON() *Emitter

JSON flag

func (*Emitter) Of

func (e *Emitter) Of(namespace string) *Emitter

Of Limit emission to certain `namespace`

func (*Emitter) To

func (e *Emitter) To(room string) *Emitter

To Limit emission to a certain `room`

func (*Emitter) Volatile

func (e *Emitter) Volatile() *Emitter

Volatile flag

type Options

type Options struct {
	// host to connect to redis on (localhost)
	Host string
	// port to connect to redis on (6379)
	Port int
	// password to connect to redis
	Password string
	// DB
	DB int
	// the name of the key to pub/sub events on as prefix (socket.io)
	Key string
	// unix domain socket to connect to redis on ("/tmp/redis.sock")
	Socket string
	// redis client
	Redis *redis.Client
}

Options ...

Jump to

Keyboard shortcuts

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