test

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: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {
	kademlia.Node
}

func InitPeer

func InitPeer(ip string, port, bootPort int) *Peer

func NewPeer

func NewPeer(ip string, port, bootPort int, isBootstrapNode bool) *Peer

func (*Peer) Store

func (p *Peer) Store(entity string, data *[]byte) (*[]byte, error)

type Storage

type Storage struct {
	KV map[string][]byte
}

func NewStorage

func NewStorage() *Storage

func (*Storage) GetKeys

func (s *Storage) GetKeys() map[string][][]byte

func (*Storage) Handle

func (s *Storage) Handle(action string, request string, data *[]byte) (response *[]byte, err error)

func (*Storage) MainEntity

func (s *Storage) MainEntity() string

func (*Storage) Read

func (s *Storage) Read(entity string, key []byte) (data *[]byte, err error)

func (*Storage) Store

func (s *Storage) Store(entity string, key []byte, data *[]byte) (*[]byte, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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