service

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2019 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerService

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

HandlerService service

func NewHandlerService

func NewHandlerService(
	dieChan chan bool,
	packetDecoder codec.PacketDecoder,
	packetEncoder codec.PacketEncoder,
	serializer serialize.Serializer,
	heartbeatTime time.Duration,
	messagesBufferSize,
	localProcessBufferSize,
	remoteProcessBufferSize int,
	server *cluster.Server,
	remoteService *RemoteService,
	messageEncoder message.Encoder,
	metricsReporters []metrics.Reporter,
) *HandlerService

NewHandlerService creates and returns a new handler service

func (*HandlerService) Dispatch

func (h *HandlerService) Dispatch(thread int)

Dispatch message to corresponding logic handler

func (*HandlerService) Docs added in v0.7.6

func (h *HandlerService) Docs(getPtrNames bool) (map[string]interface{}, error)

Docs returns documentation for handlers

func (*HandlerService) DumpServices

func (h *HandlerService) DumpServices()

DumpServices outputs all registered services

func (*HandlerService) Handle

func (h *HandlerService) Handle(conn net.Conn)

Handle handles messages from a conn

func (*HandlerService) Register

func (h *HandlerService) Register(comp component.Component, opts []component.Option) error

Register registers components

type RemoteService

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

RemoteService struct

func NewRemoteService

func NewRemoteService(
	rpcClient cluster.RPCClient,
	rpcServer cluster.RPCServer,
	sd cluster.ServiceDiscovery,
	encoder codec.PacketEncoder,
	serializer serialize.Serializer,
	router *router.Router,
	messageEncoder message.Encoder,
	server *cluster.Server,
) *RemoteService

NewRemoteService creates and return a new RemoteService

func (*RemoteService) AddRemoteBindingListener

func (r *RemoteService) AddRemoteBindingListener(bindingListener cluster.RemoteBindingListener)

AddRemoteBindingListener adds a listener

func (*RemoteService) Call

Call processes a remote call

func (*RemoteService) DoRPC

func (r *RemoteService) DoRPC(ctx context.Context, serverID string, route *route.Route, protoData []byte) (*protos.Response, error)

DoRPC do rpc and get answer

func (*RemoteService) Docs added in v0.7.6

func (r *RemoteService) Docs(getPtrNames bool) (map[string]interface{}, error)

Docs returns documentation for remotes

func (*RemoteService) DumpServices

func (r *RemoteService) DumpServices()

DumpServices outputs all registered services

func (*RemoteService) KickUser added in v0.7.6

func (r *RemoteService) KickUser(ctx context.Context, kick *protos.KickMsg) (*protos.KickAnswer, error)

KickUser sends a kick to user

func (*RemoteService) PushToUser

func (r *RemoteService) PushToUser(ctx context.Context, push *protos.Push) (*protos.Response, error)

PushToUser sends a push to user

func (*RemoteService) RPC

func (r *RemoteService) RPC(ctx context.Context, serverID string, route *route.Route, reply proto.Message, arg proto.Message) error

RPC makes rpcs

func (*RemoteService) Register

func (r *RemoteService) Register(comp component.Component, opts []component.Option) error

Register registers components

func (*RemoteService) SessionBindRemote

func (r *RemoteService) SessionBindRemote(ctx context.Context, msg *protos.BindMsg) (*protos.Response, error)

SessionBindRemote is called when a remote server binds a user session and want us to acknowledge it

Jump to

Keyboard shortcuts

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