storage

package
v0.0.0-...-817dee4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrepareProvideMessage

func PrepareProvideMessage(identity *ed25519.KeyPairEd25519, hash *encoding.Multihash, location StorageLocation) []byte

Types

type NodeDetailsStorage

type NodeDetailsStorage map[int]interface{}

type NodeStorage

type NodeStorage map[string]NodeDetailsStorage

type ProviderStore

type ProviderStore interface {
	CanProvide(hash *encoding.Multihash, kind []types.StorageLocationType) bool
	Provide(hash *encoding.Multihash, kind []types.StorageLocationType) (StorageLocation, error)
}

type SignedStorageLocation

type SignedStorageLocation interface {
	String() string
	NodeId() *encoding.NodeId
	Location() StorageLocation
}

func NewSignedStorageLocation

func NewSignedStorageLocation(NodeID *encoding.NodeId, Location StorageLocation) SignedStorageLocation

type SignedStorageLocationImpl

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

func (*SignedStorageLocationImpl) Location

func (*SignedStorageLocationImpl) NodeId

func (ssl *SignedStorageLocationImpl) NodeId() *encoding.NodeId

func (*SignedStorageLocationImpl) String

func (ssl *SignedStorageLocationImpl) String() string

type StorageLocation

type StorageLocation interface {
	BytesURL() string
	OutboardBytesURL() string
	String() string
	ProviderMessage() []byte
	Type() int
	Parts() []string
	BinaryParts() [][]byte
	Expiry() int64
	SetProviderMessage(msg []byte)
	SetType(t int)
	SetParts(p []string)
	SetBinaryParts(bp [][]byte)
	SetExpiry(e int64)
}

func NewStorageLocation

func NewStorageLocation(Type int, Parts []string, Expiry int64) StorageLocation

type StorageLocationImpl

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

func (*StorageLocationImpl) BinaryParts

func (s *StorageLocationImpl) BinaryParts() [][]byte

func (*StorageLocationImpl) BytesURL

func (s *StorageLocationImpl) BytesURL() string

func (*StorageLocationImpl) Expiry

func (s *StorageLocationImpl) Expiry() int64

func (*StorageLocationImpl) OutboardBytesURL

func (s *StorageLocationImpl) OutboardBytesURL() string

func (*StorageLocationImpl) Parts

func (s *StorageLocationImpl) Parts() []string

func (*StorageLocationImpl) ProviderMessage

func (s *StorageLocationImpl) ProviderMessage() []byte

func (*StorageLocationImpl) SetBinaryParts

func (s *StorageLocationImpl) SetBinaryParts(bp [][]byte)

func (*StorageLocationImpl) SetExpiry

func (s *StorageLocationImpl) SetExpiry(e int64)

func (*StorageLocationImpl) SetParts

func (s *StorageLocationImpl) SetParts(p []string)

func (*StorageLocationImpl) SetProviderMessage

func (s *StorageLocationImpl) SetProviderMessage(msg []byte)

func (*StorageLocationImpl) SetType

func (s *StorageLocationImpl) SetType(t int)

func (*StorageLocationImpl) String

func (s *StorageLocationImpl) String() string

func (*StorageLocationImpl) Type

func (s *StorageLocationImpl) Type() int

type StorageLocationMap

type StorageLocationMap map[int]NodeStorage

func NewStorageLocationMap

func NewStorageLocationMap() StorageLocationMap

func (*StorageLocationMap) DecodeMsgpack

func (s *StorageLocationMap) DecodeMsgpack(dec *msgpack.Decoder) error

func (StorageLocationMap) EncodeMsgpack

func (s StorageLocationMap) EncodeMsgpack(enc *msgpack.Encoder) error

type StorageLocationProvider

type StorageLocationProvider interface {
	Start() error
	Next() (SignedStorageLocation, error)
	All() ([]SignedStorageLocation, error)
	Upvote(uri SignedStorageLocation) error
	Downvote(uri SignedStorageLocation) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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