protocol

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package protocol implements the Monitoring protocol

Package protocol implements the Monitoring protocol

Package protocol implements the Monitoring protocol

Index

Constants

View Source
const (
	// ProtocolID is the protocol ID for the Monitoring protocol
	ProtocolID = 0x13

	// MethodPingDaemon is the method ID for the method PingDaemon
	MethodPingDaemon = 0x1

	// MethodGetClusterMembers is the method ID for the method GetClusterMembers
	MethodGetClusterMembers = 0x2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	Endpoint() nex.EndpointInterface
	SetEndpoint(endpoint nex.EndpointInterface)
	SetHandlerPingDaemon(handler func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error))
	SetHandlerGetClusterMembers(handler func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error))
}

Interface implements the methods present on the Monitoring protocol struct

type Protocol

type Protocol struct {
	PingDaemon        func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error)
	GetClusterMembers func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error)
	Patches           nex.ServiceProtocol
	PatchedMethods    []uint32
	// contains filtered or unexported fields
}

Protocol handles the Monitoring protocol

func NewProtocol

func NewProtocol() *Protocol

NewProtocol returns a new Monitoring protocol

func (*Protocol) Endpoint

func (protocol *Protocol) Endpoint() nex.EndpointInterface

Endpoint returns the endpoint implementing the protocol

func (*Protocol) HandlePacket

func (protocol *Protocol) HandlePacket(packet nex.PacketInterface)

HandlePacket sends the packet to the correct RMC method handler

func (*Protocol) SetEndpoint

func (protocol *Protocol) SetEndpoint(endpoint nex.EndpointInterface)

SetEndpoint sets the endpoint implementing the protocol

func (*Protocol) SetHandlerGetClusterMembers

func (protocol *Protocol) SetHandlerGetClusterMembers(handler func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error))

SetHandlerGetClusterMembers sets the handler for the GetClusterMembers method

func (*Protocol) SetHandlerPingDaemon

func (protocol *Protocol) SetHandlerPingDaemon(handler func(err error, packet nex.PacketInterface, callID uint32) (*nex.RMCMessage, *nex.Error))

SetHandlerPingDaemon sets the handler for the PingDaemon method

Jump to

Keyboard shortcuts

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