storage

package
v0.0.0-...-99ca45c Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrContentNotFound = fmt.Errorf("content not found")
View Source
var MaxDistance = uint256.MustFromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")

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
}

func NewMockStorage

func NewMockStorage() ContentStorage

type ContentType

type ContentType byte

type MockStorage

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

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
	DB                *sql.DB
	NodeId            enode.ID
	Spec              *common.Spec
	NetworkName       string
}

Jump to

Keyboard shortcuts

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