storage

package
v0.0.0-...-4b51c2d Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContentNotFound = fmt.Errorf("content not found")
View Source
var ErrInsufficientRadius = fmt.Errorf("insufficient radius")
View Source
var MaxDistance = uint256.MustFromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")
View Source
var SizeKey = []byte("size")

Functions

This section is empty.

Types

type ContentKey

type ContentKey struct {
	// contains filtered or unexported fields
}

func NewContentKey

func NewContentKey(selector ContentType, data []byte) *ContentKey

func (*ContentKey) Encode

func (c *ContentKey) Encode() []byte

type ContentStorage

type ContentStorage interface {
	Get(contentKey []byte, contentId []byte) ([]byte, error)

	Put(contentKey []byte, contentId []byte, content []byte) error

	Radius() *uint256.Int

	Close() error
}

func NewMockStorage

func NewMockStorage() ContentStorage

type ContentType

type ContentType byte

type MockStorage

type MockStorage struct {
	Db map[string][]byte
}

func (*MockStorage) Close

func (m *MockStorage) Close() error

func (*MockStorage) Get

func (m *MockStorage) Get(contentKey []byte, contentId []byte) ([]byte, error)

func (*MockStorage) Put

func (m *MockStorage) Put(contentKey []byte, contentId []byte, content []byte) error

func (*MockStorage) Radius

func (m *MockStorage) Radius() *uint256.Int

type PortalStorageConfig

type PortalStorageConfig struct {
	StorageCapacityMB uint64
	NodeId            enode.ID
	Spec              *common.Spec
	NetworkName       string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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