kademlia

package
v0.0.0-...-42ee62e Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	pb.UnimplementedNodeServer
	// contains filtered or unexported fields
}

func NewNode

func NewNode(nodeIP string, nodePort, bootstrapPort int, infra infrastructure.IInfrastructure, isBootstrapNode bool) *Node

func (*Node) CreateGRPCServer

func (n *Node) CreateGRPCServer(grpcServerAddress string)

Create gRPC Server

func (*Node) FindAll

func (fn *Node) FindAll(ctx context.Context, query *pb.Query) (*pb.FindValueResponse, error)

func (*Node) FindNode

func (n *Node) FindNode(ctx context.Context, target *pb.Target) (*pb.KBucket, error)

func (*Node) FindValue

func (fn *Node) FindValue(ctx context.Context, target *pb.Target) (*pb.FindValueResponse, error)

func (*Node) GetAll

func (fn *Node) GetAll(entity string, criteria string, maxResults int32) ([][]byte, error)

func (*Node) GetValue

func (fn *Node) GetValue(entity string, key string) ([]byte, error)

func (*Node) LookUp

func (fn *Node) LookUp(target []byte) ([]basic.NodeInfo, error)

func (*Node) Ping

func (n *Node) Ping(ctx context.Context, sender *pb.NodeInfo) (*pb.NodeInfo, error)

func (*Node) PrintRoutingTable

func (n *Node) PrintRoutingTable()

func (*Node) Republish

func (fn *Node) Republish()

func (*Node) Store

func (n *Node) Store(ctx context.Context, data *pb.StoreData) (*pb.Response, error)

func (*Node) StoreValue

func (fn *Node) StoreValue(entity string, key string, data *[]byte) (*[]byte, error)

type NodeClient

type NodeClient struct {
	pb.NodeClient
	IP   string
	Port int
}

func NewNodeClient

func NewNodeClient(ip string, port int) (*NodeClient, error)

func (*NodeClient) Ping

func (fn *NodeClient) Ping(sender basic.NodeInfo) (*basic.NodeInfo, error)

Jump to

Keyboard shortcuts

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