Documentation ¶
Index ¶
- func RunRpcServer(options *rpc.ServerOptions, gate gate.Gateway, ...) error
- type ConnectionMetrics
- type GatewayMetrics
- type GatewayServer
- func (c *GatewayServer) EnqueueMessage(id gate.ID, msg *messages.GlideMessage) error
- func (c *GatewayServer) ExitClient(id gate.ID) error
- func (c *GatewayServer) GetState() GatewayMetrics
- func (c *GatewayServer) HandleConnection(conn conn.Connection) gate.ID
- func (c *GatewayServer) Run() error
- func (c *GatewayServer) SetClientID(oldID, newID gate.ID) error
- func (c *GatewayServer) SetMessageHandler(h gate.MessageHandler)
- type MessageMetrics
- type RpcServer
- func (r *RpcServer) CreateChannel(ctx context.Context, request *proto.CreateChannelRequest, ...) error
- func (r *RpcServer) EnqueueMessage(ctx context.Context, request *proto.EnqueueMessageRequest, ...) error
- func (r *RpcServer) ExitClient(ctx context.Context, request *proto.ExitClientRequest, ...) error
- func (r *RpcServer) IsOnline(ctx context.Context, request *proto.IsOnlineRequest, ...) error
- func (r *RpcServer) Publish(ctx context.Context, request *proto.PublishRequest, response *proto.Response) error
- func (r *RpcServer) RemoveChannel(ctx context.Context, request *proto.RemoveChannelRequest, ...) error
- func (r *RpcServer) SetClientID(ctx context.Context, request *proto.SetIDRequest, response *proto.Response) error
- func (r *RpcServer) Subscribe(ctx context.Context, request *proto.SubscribeRequest, response *proto.Response) error
- func (r *RpcServer) UnSubscribe(ctx context.Context, request *proto.UnsubscribeRequest, ...) error
- func (r *RpcServer) UpdateChannel(ctx context.Context, request *proto.UpdateChannelRequest, ...) error
- func (r *RpcServer) UpdateSubscriber(ctx context.Context, request *proto.UpdateSubscriberRequest, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunRpcServer ¶
func RunRpcServer(options *rpc.ServerOptions, gate gate.Gateway, subscribe subscription.Subscribe) error
Types ¶
type ConnectionMetrics ¶ added in v1.2.0
type ConnectionMetrics struct { ConnectionCounter metrics.Counter LoginCounter metrics.Counter OnlineTempCounter metrics.Counter MaxOnline metrics.Gauge AliveMeter metrics.Meter AliveLoggedMeter metrics.Meter AliveTempH metrics.Histogram AliveLoggedH metrics.Histogram }
func NewConnectionMetrics ¶ added in v1.2.0
func NewConnectionMetrics() *ConnectionMetrics
func (*ConnectionMetrics) Connected ¶ added in v1.2.0
func (c *ConnectionMetrics) Connected()
func (*ConnectionMetrics) Exit ¶ added in v1.2.0
func (c *ConnectionMetrics) Exit(info gate.Info)
func (*ConnectionMetrics) Login ¶ added in v1.2.0
func (c *ConnectionMetrics) Login()
type GatewayMetrics ¶ added in v1.2.0
type GatewayMetrics struct { ServerId string Addr string Port int StartAt time.Time RunningHours float64 Message *MessageMetrics Conn *ConnectionMetrics }
type GatewayServer ¶
func (*GatewayServer) EnqueueMessage ¶ added in v1.1.0
func (c *GatewayServer) EnqueueMessage(id gate.ID, msg *messages.GlideMessage) error
func (*GatewayServer) ExitClient ¶ added in v1.2.0
func (c *GatewayServer) ExitClient(id gate.ID) error
func (*GatewayServer) GetState ¶ added in v1.1.0
func (c *GatewayServer) GetState() GatewayMetrics
func (*GatewayServer) HandleConnection ¶
func (c *GatewayServer) HandleConnection(conn conn.Connection) gate.ID
HandleConnection 当一个用户连接建立后, 由该方法创建 Client 实例 Client 并管理该连接, 返回该由连接创建客户端的标识 id 返回的标识 id 是一个临时 id, 后续连接认证后会改变
func (*GatewayServer) Run ¶
func (c *GatewayServer) Run() error
func (*GatewayServer) SetClientID ¶ added in v1.2.0
func (c *GatewayServer) SetClientID(oldID, newID gate.ID) error
func (*GatewayServer) SetMessageHandler ¶
func (c *GatewayServer) SetMessageHandler(h gate.MessageHandler)
type MessageMetrics ¶ added in v1.2.0
type MessageMetrics struct { MessageInMeter metrics.Meter MessageOutMeter metrics.Meter OutCounter metrics.Counter FailsCounter metrics.Counter InCounter metrics.Counter InHistogram metrics.Histogram OutHistogram metrics.Histogram }
func NewMessageMetrics ¶ added in v1.2.0
func NewMessageMetrics() *MessageMetrics
func (*MessageMetrics) In ¶ added in v1.2.0
func (m *MessageMetrics) In()
func (*MessageMetrics) Out ¶ added in v1.2.0
func (m *MessageMetrics) Out()
func (*MessageMetrics) OutFailed ¶ added in v1.2.0
func (m *MessageMetrics) OutFailed()
type RpcServer ¶
type RpcServer struct {
// contains filtered or unexported fields
}
func (*RpcServer) CreateChannel ¶ added in v1.1.0
func (*RpcServer) EnqueueMessage ¶
func (*RpcServer) ExitClient ¶
func (*RpcServer) IsOnline ¶
func (r *RpcServer) IsOnline(ctx context.Context, request *proto.IsOnlineRequest, response *proto.IsOnlineResponse) error
func (*RpcServer) RemoveChannel ¶ added in v1.1.0
func (*RpcServer) SetClientID ¶
func (*RpcServer) UnSubscribe ¶ added in v1.1.0
func (*RpcServer) UpdateChannel ¶ added in v1.1.0
func (*RpcServer) UpdateSubscriber ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.