utils

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClosestNodeToKey added in v0.4.4

func ClosestNodeToKey(key []byte, id1 []byte, id2 []byte) int

func DeserializeMessage

func DeserializeMessage(conn *net.TCPConn) (*[]structs.Node, error)

func DisplayHelp added in v0.3.0

func DisplayHelp()

func GetFullNodeClient added in v0.4.4

func GetFullNodeClient(ip *string, port *int) pb.FullNodeClient

func GetIpFromHost added in v0.3.0

func GetIpFromHost() string

func GetKBucketFromNodeArray added in v0.4.4

func GetKBucketFromNodeArray(nodes *[]structs.Node) *pb.KBucket

func GetSha1Hash added in v0.4.7

func GetSha1Hash(data string) []byte

func NewID added in v0.4.4

func NewID(ip string, port int) ([]byte, error)

newID generates a new random ID

func SerializeMessage

func SerializeMessage(q *[]structs.Node) (*[]byte, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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