Documentation
¶
Index ¶
- type AckMessageFunc
- type ClientHandle
- func (this *ClientHandle) AddRoom(ctx context.Context, roomId string) (Room, error)
- func (this *ClientHandle) GetClientID() string
- func (this *ClientHandle) GetRoomProxyManager() RoomProxyManager
- func (this *ClientHandle) GetRooms() []string
- func (this *ClientHandle) RemoveRoom(ctx context.Context, roomId string) error
- type ClientOptions
- type GetMetricsOptions
- type HandleMessageFunc
- type HandleRoomEjectedFunc
- type Message
- type Metrics
- type Options
- type RedisQueueClient
- type RedisQueueClientProviderFunc
- type RedisQueueShardsProvider
- type Room
- type RoomMetrics
- type RoomProxyManager
- type RoomProxyManagerOptions
- type ShardingOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AckMessageFunc ¶
type ClientHandle ¶ added in v0.3.0
type ClientHandle struct {
// contains filtered or unexported fields
}
func (*ClientHandle) GetClientID ¶ added in v0.3.1
func (this *ClientHandle) GetClientID() string
func (*ClientHandle) GetRoomProxyManager ¶ added in v0.3.1
func (this *ClientHandle) GetRoomProxyManager() RoomProxyManager
func (*ClientHandle) GetRooms ¶ added in v0.3.1
func (this *ClientHandle) GetRooms() []string
func (*ClientHandle) RemoveRoom ¶ added in v0.3.0
func (this *ClientHandle) RemoveRoom(ctx context.Context, roomId string) error
type ClientOptions ¶ added in v0.3.0
type ClientOptions struct {
MessageHandler HandleMessageFunc
ClientEjectedHandler func(ctx context.Context, client *ClientHandle) error
}
func (*ClientOptions) Validate ¶ added in v0.3.0
func (o *ClientOptions) Validate() error
type GetMetricsOptions ¶
type GetMetricsOptions struct {
TopRoomsLimit int
}
type HandleRoomEjectedFunc ¶
type Options ¶
type Options struct {
RedisOptions *redis.Options
ClientTimeout time.Duration
Sync bool
RedisKeyPrefix string
// HandleMessage HandleMessageFunc
HandleRoomEjected HandleRoomEjectedFunc
}
type RedisQueueClient ¶
type RedisQueueClient interface {
Subscribe(ctx context.Context, room string, msgHandlerFunc HandleMessageFunc) error
Unsubscribe(ctx context.Context, room string) error
Close() error
GetMetrics(ctx context.Context, options *GetMetricsOptions) (*Metrics, error)
Send(ctx context.Context, room string, data interface{}, priority int) error
SendOutOfBand(ctx context.Context, room string, data interface{}) error
Peek(ctx context.Context, room string, offset int, limit int) ([]*Message, error)
}
func NewShardedClient ¶ added in v0.2.0
func NewShardedClient(ctx context.Context, shardProvider RedisQueueShardsProvider) (RedisQueueClient, error)
type RedisQueueClientProviderFunc ¶ added in v0.3.0
type RedisQueueClientProviderFunc func(ctx context.Context, roomEjectedFunc HandleRoomEjectedFunc) (RedisQueueClient, error)
type RedisQueueShardsProvider ¶ added in v0.2.0
type RedisQueueShardsProvider interface {
GetTotalShardsCount(ctx context.Context) (uint32, error)
GetRoomShardId(ctx context.Context, room string) (uint32, error)
GetShardOptions(ctx context.Context, shardId uint32) (*Options, error)
}
func NewRedisClusterShardProvider ¶ added in v0.2.0
type RoomMetrics ¶
type RoomProxyManager ¶ added in v0.3.0
type RoomProxyManager interface {
AddClient(ctx context.Context, options *ClientOptions) (*ClientHandle, error)
RemoveClient(ctx context.Context, client *ClientHandle) error
Close() error
GetMetrics(ctx context.Context, options *GetMetricsOptions) (*Metrics, error)
Send(ctx context.Context, room string, data interface{}, priority int) error
SendOutOfBand(ctx context.Context, room string, data interface{}) error
Peek(ctx context.Context, room string, offset int, limit int) ([]*Message, error)
}
func NewRoomProxyManager ¶ added in v0.3.0
func NewRoomProxyManager(ctx context.Context, options *RoomProxyManagerOptions) (RoomProxyManager, error)
type RoomProxyManagerOptions ¶ added in v0.3.0
type RoomProxyManagerOptions struct {
RedisQueueClientProvider RedisQueueClientProviderFunc
}
func (*RoomProxyManagerOptions) Validate ¶ added in v0.3.0
func (o *RoomProxyManagerOptions) Validate() error
type ShardingOptions ¶ added in v0.2.0
type ShardingOptions struct {
TotalShardsCount int
}
func (*ShardingOptions) Validate ¶ added in v0.2.0
func (o *ShardingOptions) Validate() error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.