Documentation ¶
Overview ¶
Package localfs provides block data from local filesystem.
Index ¶
- Variables
- func HeightDirectory(height base.Height) string
- func LoadBlock(st *Blockdata, height base.Height) (block.BaseBlockdataMap, block.Block, error)
- func LoadBlockByPath(st *Blockdata, prepath string) (block.BaseBlockdataMap, block.Block, error)
- func LoadData(prepath, dataType string) (block.BaseBlockdataMapItem, io.ReadCloser, error)
- func NewBaseBlockdataMapItem(f string) (block.BaseBlockdataMapItem, error)
- func OpenFile(prepath, dataType string) (string, io.ReadCloser, error)
- func ParseDataFileName(s string) (base.Height, string, string, error)
- type Blockdata
- func (st *Blockdata) Clean(remove bool) error
- func (st *Blockdata) Exists(height base.Height) (bool, error)
- func (st *Blockdata) ExistsReal(height base.Height) (exists bool, removed bool, err error)
- func (st *Blockdata) FS() fs.FS
- func (*Blockdata) Hint() hint.Hint
- func (st *Blockdata) Initialize() error
- func (*Blockdata) IsLocal() bool
- func (st *Blockdata) NewSession(height base.Height) (blockdata.Session, error)
- func (st *Blockdata) Remove(height base.Height) error
- func (st *Blockdata) RemoveAll(height base.Height) error
- func (st *Blockdata) Root() string
- func (st *Blockdata) SaveSession(session blockdata.Session) (block.BlockdataMap, error)
- func (st *Blockdata) Writer() blockdata.Writer
- type FS
- type Session
- func (ss *Session) AddOperations(ops ...operation.Operation) error
- func (ss *Session) AddStates(sts ...state.State) error
- func (ss *Session) Cancel() error
- func (ss *Session) CloseOperations() error
- func (ss *Session) CloseStates() error
- func (ss *Session) Height() base.Height
- func (ss *Session) Import(dataType string, r io.Reader) (string, error)
- func (ss *Session) SetACCEPTVoteproof(voteproof base.Voteproof) error
- func (ss *Session) SetBlock(blk block.Block) error
- func (ss *Session) SetINITVoteproof(voteproof base.Voteproof) error
- func (ss *Session) SetManifest(manifest block.Manifest) error
- func (ss *Session) SetOperationsTree(ft tree.FixedTree) error
- func (ss *Session) SetProposal(sfs base.SignedBallotFact) error
- func (ss *Session) SetStatesTree(ft tree.FixedTree) error
- func (ss *Session) SetSuffrageInfo(suffrageInfo block.SuffrageInfo) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( LocalFSBlockdataType = hint.Type("localfs-blockdata") LocalFSBlockdataHint = hint.NewHint(LocalFSBlockdataType, "v0.0.1") )
View Source
var ( BlockDirectoryHeightFormat = "%021s" BlockDirectoryRemovedTouchFile = ".removed" BlockFileFormats = "%d-%s-%s.jsonld.gz" // <height>-<data>-<checksum>.jsonld.gz BlockFileGlobFormats = "*-%s-*.jsonld.gz" // -<data>-*.jsonld.gz )
View Source
var ( DefaultFilePermission os.FileMode = 0o644 DefaultDirectoryPermission os.FileMode = 0o755 )
Functions ¶
func HeightDirectory ¶
func LoadBlockByPath ¶
func LoadData ¶
func LoadData(prepath, dataType string) (block.BaseBlockdataMapItem, io.ReadCloser, error)
func NewBaseBlockdataMapItem ¶
func NewBaseBlockdataMapItem(f string) (block.BaseBlockdataMapItem, error)
Types ¶
type Blockdata ¶
func (*Blockdata) ExistsReal ¶
func (*Blockdata) Initialize ¶
func (*Blockdata) NewSession ¶
func (*Blockdata) Remove ¶
Remove removes block directory by height. Remove does not remove the directory and inside files, it just creates .removd file with time. .removed file helps CleanByHeight to clean directories.
func (*Blockdata) SaveSession ¶
type Session ¶
func NewSession ¶
func (*Session) CloseOperations ¶
func (*Session) CloseStates ¶
func (*Session) SetACCEPTVoteproof ¶
func (*Session) SetINITVoteproof ¶
func (*Session) SetProposal ¶
func (ss *Session) SetProposal(sfs base.SignedBallotFact) error
func (*Session) SetSuffrageInfo ¶
func (ss *Session) SetSuffrageInfo(suffrageInfo block.SuffrageInfo) error
Click to show internal directories.
Click to hide internal directories.