Documentation ¶
Overview ¶
Package fs1tools provides tools for managing and maintaining ZODB FileStorage v1 databases.
Index ¶
- Variables
- func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error)
- func Reindex(ctx context.Context, path string, progress func(*fs1.IndexUpdateProgress)) error
- func Verify(w io.Writer, path string, verbose int, progress bool) (err error)
- func VerifyIndexFor(ctx context.Context, path string, ntxn int, ...) (err error)
- type Dumper
- type DumperFsDump
- type DumperFsDumpVerbose
- type DumperFsTail
- type Verifier
Constants ¶
This section is empty.
Variables ¶
var Prog = prog.MainProg{
Name: "fs1",
Summary: "Fs1 is a tool for managing and maintaining ZODB FileStorage v1 databases",
Commands: commands,
HelpTopics: helpTopics,
}
main fs1 driver
Functions ¶
func Dump ¶
Dump dumps content of a FileStorage file @ path.
To do so it reads file header and then iterates over all transactions in the file. The logic to actually output information and, if needed read/process data, should be implemented by Dumper d.
func Verify ¶
Verify verifies content of a FileStorage file @ path.
Only data part of the database is verified (the *.fs file). Use VerifyIndexFor to verify the index part (*.fs.index).
func VerifyIndexFor ¶
func VerifyIndexFor(ctx context.Context, path string, ntxn int, progress func(*fs1.IndexVerifyProgress)) (err error)
VerifyIndexFor verifies that on-disk index for FileStorage file @ path is correct
Types ¶
type Dumper ¶
type Dumper interface { // DumperName defines concise name to use in error-reporting when using this dumper. DumperName() string // DumpFileHeader dumps fh to buf DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error // DumpTxn dumps current transaction from it to buf. // // It is dumper responsibility to iterate over data records inside // transaction if it needs to dump information about data records. // // If dumper return io.EOF the whole dumping process finishes. DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error // DumpEndOK is called at the end of successfull dump. DumpEndOK(buf *xfmt.Buffer) error }
Dumper is interface to implement various dumping modes
type DumperFsDump ¶
type DumperFsDump struct {
// contains filtered or unexported fields
}
DumperFsDump implements dumping with the same format as in fsdump/py originally written by Jeremy Hylton:
https://github.com/zopefoundation/ZODB/blob/master/src/ZODB/FileStorage/fsdump.py https://github.com/zopefoundation/ZODB/commit/ddcb46a2
func (*DumperFsDump) DumpFileHeader ¶
func (d *DumperFsDump) DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error
func (*DumperFsDump) DumperName ¶
func (d *DumperFsDump) DumperName() string
type DumperFsDumpVerbose ¶
type DumperFsDumpVerbose struct { }
DumperFsDumpVerbose implements a very verbose dumper with output identical to fsdump.Dumper in zodb/py originally written by Jeremy Hylton:
https://github.com/zopefoundation/ZODB/blob/master/src/ZODB/FileStorage/fsdump.py https://github.com/zopefoundation/ZODB/commit/4d86e4e0
func (*DumperFsDumpVerbose) DumpEndOK ¶
func (d *DumperFsDumpVerbose) DumpEndOK(buf *xfmt.Buffer) error
func (*DumperFsDumpVerbose) DumpFileHeader ¶
func (d *DumperFsDumpVerbose) DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error
func (*DumperFsDumpVerbose) DumperName ¶
func (d *DumperFsDumpVerbose) DumperName() string
type DumperFsTail ¶
type DumperFsTail struct { Ntxn int // max # of transactions to dump // contains filtered or unexported fields }
DumperFsTail implements dumping with the same format as in fstail/py originally written by Jeremy Hylton:
https://github.com/zopefoundation/ZODB/blob/master/src/ZODB/scripts/fstail.py https://github.com/zopefoundation/ZODB/commit/551122cc
func (*DumperFsTail) DumpFileHeader ¶
func (d *DumperFsTail) DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error
func (*DumperFsTail) DumperName ¶
func (d *DumperFsTail) DumperName() string
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier implements Dumper that is used by Verify.