message

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Defines the structure for the Request and Response messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RequestMessage

type RequestMessage struct {
	Type     string // PING | SYNC | FIND_SUCCESSOR | CLOSEST_PRECEDING_NODE | PUT
	TargetId uint64 // ID of the parameter node passed to the destination
	IP       string // IP of the parameter node passed to the destination
	Payload  map[uint64][]string
	HopCount int
}

Sample message structure. To be replaced with a struct for protobuff

func (*RequestMessage) PrintContent

func (msg *RequestMessage) PrintContent()

***************************************

UTILITY FUNCTIONS

***************************************

Message utility function to print the request message

type ResponseMessage

type ResponseMessage struct {
	Type          string // PING | SYNC | ACK | FIND_SUCCESSOR | CLOSEST_PRECEDING_NODE
	Nodeid        uint64 // ID of the node in the response message
	IP            string // IP of the node in the response message
	QueryResponse []string
	Payload       map[uint64][]string
}

func (*ResponseMessage) PrintContent

func (msg *ResponseMessage) PrintContent()

Message utility function to print the response message

Jump to

Keyboard shortcuts

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