Documentation ¶
Overview ¶
blockset provides a registry of BlockLayers, that can be (Un)Marshaled and retrieve blocks from a Torus storage interface. This is the package which allows abstractions atop individual files, such as error correction, redundancy checking, further replication, and the like.
Index ¶
- Constants
- func CreateBlockset(b torus.BlockLayer, store torus.BlockStore, subLayer blockset) (torus.Blockset, error)
- func CreateBlocksetFromSpec(spec torus.BlockLayerSpec, store torus.BlockStore) (torus.Blockset, error)
- func MustParseBlockLayerSpec(s string) torus.BlockLayerSpec
- func ParseBlockLayerKind(s string) (torus.BlockLayerKind, error)
- func ParseBlockLayerSpec(s string) (torus.BlockLayerSpec, error)
- func RegisterBlockset(b torus.BlockLayerKind, newFunc CreateBlocksetFunc)
- func UnmarshalFromProto(layers []*models.BlockLayer, store torus.BlockStore) (torus.Blockset, error)
- type CreateBlocksetFunc
Constants ¶
const ( Base torus.BlockLayerKind = iota CRC Replication )
Constants for each type of layer, for serializing/deserializing
Variables ¶
This section is empty.
Functions ¶
func CreateBlockset ¶
func CreateBlockset(b torus.BlockLayer, store torus.BlockStore, subLayer blockset) (torus.Blockset, error)
CreateBlockset creates a Blockset of type b, with serialized data, backing store, and subLayer, if any) with the provided address.
func CreateBlocksetFromSpec ¶
func CreateBlocksetFromSpec(spec torus.BlockLayerSpec, store torus.BlockStore) (torus.Blockset, error)
func MustParseBlockLayerSpec ¶
func MustParseBlockLayerSpec(s string) torus.BlockLayerSpec
func ParseBlockLayerKind ¶
func ParseBlockLayerKind(s string) (torus.BlockLayerKind, error)
func ParseBlockLayerSpec ¶
func ParseBlockLayerSpec(s string) (torus.BlockLayerSpec, error)
func RegisterBlockset ¶
func RegisterBlockset(b torus.BlockLayerKind, newFunc CreateBlocksetFunc)
RegisterBlockset is the hook used for implementations of blocksets to register themselves to the system. This is usually called in the init() of the package that implements the blockset.
func UnmarshalFromProto ¶
func UnmarshalFromProto(layers []*models.BlockLayer, store torus.BlockStore) (torus.Blockset, error)
Types ¶
type CreateBlocksetFunc ¶
type CreateBlocksetFunc func(opts string, store torus.BlockStore, subLayer blockset) (blockset, error)
CreateBlocksetFunc is the signature of a constructor used to create a BlockLayer.