websocket

package
v6.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Kick

func Kick(uid string) (existed bool, err error)

Kick kicks the uid offline.

func Serve

func Serve(outerSrvCfg micro.SrvConfig, protoFunc tp.ProtoFunc)

Serve starts websocket gateway service.

Types

type Gw

type Gw struct {
	tp.CallCtx
}

Gw long connection controller.

func (*Gw) WsKick

func (g *Gw) WsKick(args *types.SocketKickArgs) (*types.SocketKickReply, *tp.Status)

SocketKick kicks the uid offline.

func (*Gw) WsMpush

func (g *Gw) WsMpush(args *types.WsMpushArgs) (*types.WsMpushReply, *tp.Status)

WsMpush multi-push messages to the specified users.

func (*Gw) WsPush

func (g *Gw) WsPush(args *types.WsPushArgs) (*types.WsPushReply, *tp.Status)

WsPush pushes message to the specified user.

func (*Gw) WsTotal

func (g *Gw) WsTotal(*types.WsTotalArgs) (*types.WsTotalReply, *tp.Status)

WsTotal returns the long connections total.

Jump to

Keyboard shortcuts

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