chunkstamp

package
v2.3.0-rc6 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(s storage.IndexStore, scope string, addr swarm.Address, batchId []byte) error

Delete removes a stamp associated with an chunk and batchID.

func DeleteAll

func DeleteAll(s storage.IndexStore, scope string, addr swarm.Address) error

DeleteAll removes all swarm.Stamp related to the given address.

func DeleteWithStamp

func DeleteWithStamp(
	writer storage.Writer,
	scope string,
	addr swarm.Address,
	stamp swarm.Stamp,
) error

func Load

func Load(s storage.Reader, scope string, addr swarm.Address) (swarm.Stamp, error)

Load returns first found swarm.Stamp related to the given address.

func LoadWithBatchID

func LoadWithBatchID(s storage.Reader, scope string, addr swarm.Address, batchID []byte) (swarm.Stamp, error)

LoadWithBatchID returns swarm.Stamp related to the given address and batchID.

func Store

func Store(s storage.IndexStore, scope string, chunk swarm.Chunk) error

Store creates new or updated an existing stamp index record related to the given scope and chunk.

Types

type Item added in v2.2.0

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

Item is the index used to represent a stamp for a chunk.

Going ahead we will support multiple stamps on chunks. This Item will allow mapping multiple stamps to a single address. For this reason, the address is part of the Namespace and can be used to iterate on all the stamps for this address.

func (*Item) Clone added in v2.2.0

func (i *Item) Clone() storage.Item

Clone implements the storage.Item interface.

func (*Item) ID added in v2.2.0

func (i *Item) ID() string

ID implements the storage.Item interface.

func (*Item) Marshal added in v2.2.0

func (i *Item) Marshal() ([]byte, error)

Marshal implements the storage.Item interface. address is not part of the payload which is stored, as address is part of the prefix, hence already known before querying this object. This will be reused during unmarshaling.

func (*Item) Namespace added in v2.2.0

func (i *Item) Namespace() string

Namespace implements the storage.Item interface.

func (*Item) SetScope added in v2.2.0

func (i *Item) SetScope(ns []byte)

func (Item) String added in v2.2.0

func (i Item) String() string

String implements the storage.Item interface.

func (*Item) Unmarshal added in v2.2.0

func (i *Item) Unmarshal(bytes []byte) error

Unmarshal implements the storage.Item interface.

Jump to

Keyboard shortcuts

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