wsredis

package
v1.0.2-0...-2da3d3e Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doner

type Doner interface {
	Done()
}

type JSONMessage

type JSONMessage struct {
	Type    string `json:"type"`
	Payload string `json:"payload"`
}

type RedisAdapter

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

func NewRedisAdapter

func NewRedisAdapter(
	pubRedis *redis.Client,
	subRedis *redis.Client,
	prefix string,
	room string,
) *RedisAdapter

func (*RedisAdapter) Add

func (a *RedisAdapter) Add(client wsadapter.Client) (err error)

func (*RedisAdapter) Broadcast

func (a *RedisAdapter) Broadcast(msg wsmessage.Message) error

func (*RedisAdapter) Clients

func (a *RedisAdapter) Clients() (map[string]string, error)

Returns IDs of all known clients connected to this room

func (*RedisAdapter) Close

func (a *RedisAdapter) Close() (err error)

func (*RedisAdapter) Emit

func (a *RedisAdapter) Emit(clientID string, msg wsmessage.Message) error

func (*RedisAdapter) Metadata

func (a *RedisAdapter) Metadata(clientID string) (metadata string, ok bool)

func (*RedisAdapter) Remove

func (a *RedisAdapter) Remove(clientID string) (err error)

func (*RedisAdapter) SetMetadata

func (a *RedisAdapter) SetMetadata(clientID string, metadata string) (ok bool)

func (*RedisAdapter) Size

func (a *RedisAdapter) Size() (size int, err error)

Returns count of all known clients connected to this room

Jump to

Keyboard shortcuts

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