service

package
v2.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerPool

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

HandlerPool ...

func NewHandlerPool

func NewHandlerPool() *HandlerPool

NewHandlerPool ...

func (*HandlerPool) GetHandlers

func (h *HandlerPool) GetHandlers() map[string]*component.Handler

GetHandlers ...

func (*HandlerPool) ProcessHandlerMessage

func (h *HandlerPool) ProcessHandlerMessage(
	ctx context.Context,
	rt *route.Route,
	serializer serialize.Serializer,
	handlerHooks *pipeline.HandlerHooks,
	session session.Session,
	data []byte,
	msgTypeIface interface{},
	remote bool,
) ([]byte, error)

ProcessHandlerMessage ...

func (*HandlerPool) Register

func (h *HandlerPool) Register(serviceName string, name string, handler *component.Handler)

Register ...

type HandlerService

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

HandlerService service

func NewHandlerService

func NewHandlerService(
	packetDecoder codec.PacketDecoder,
	serializer serialize.Serializer,
	localProcessBufferSize int,
	remoteProcessBufferSize int,
	server *cluster.Server,
	remoteService *RemoteService,
	agentFactory agent.AgentFactory,
	metricsReporters []metrics.Reporter,
	handlerHooks *pipeline.HandlerHooks,
	handlerPool *HandlerPool,
) *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

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 acceptor.PlayerConn)

Handle handles messages from a conn

func (*HandlerService) Register

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

Register registers components

func (*HandlerService) SetHandlerHooks

func (h *HandlerService) SetHandlerHooks(handlerHooks *pipeline.HandlerHooks)

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,
	sessionPool session.SessionPool,
	handlerHooks *pipeline.HandlerHooks,
	handlerPool *HandlerPool,
) *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

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

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

func (*RemoteService) SetHandlerHooks

func (h *RemoteService) SetHandlerHooks(handlerHooks *pipeline.HandlerHooks)

Jump to

Keyboard shortcuts

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