core

package
v0.0.0-...-09d2262 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAXMESSAGE = 1024

MAXMESSAGE is the size of channels

Functions

func Decapsulation

func Decapsulation(messageType string, m *protobuf.Message) any

Decapsulation decapsulates a message to it's original type

func Encapsulation

func Encapsulation(messageType string, ID []byte, sender uint32, payloadMessage any) *protobuf.Message

Encapsulation encapsulates a message to a general type(*protobuf.Message)

func MakeDispatcheChannels

func MakeDispatcheChannels(receiveChannel chan *protobuf.Message, N uint32) *sync.Map

MakeDispatcheChannels dispatche messages from receiveChannel and make a double layer Map : (messageType) --> (id) --> (channel)

func MakeReceiveChannel

func MakeReceiveChannel(port string) chan *protobuf.Message

MakeReceiveChannel returns a channel receiving messages

func MakeSendChannel

func MakeSendChannel(hostIP string, hostPort string) chan *protobuf.Message

MakeSendChannel returns a channel to send messages to hostIP

Types

This section is empty.

Jump to

Keyboard shortcuts

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