Documentation

Overview

    Package fs1tools provides tools for managing and maintaining ZODB FileStorage v1 databases.

    Index

    Constants

    This section is empty.

    Variables

    View Source
    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

      func Dump(w io.Writer, path string, dir fs1.IterDir, d Dumper) (err error)

        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 Reindex

        func Reindex(ctx context.Context, path string, progress func(*fs1.IndexUpdateProgress)) error

          Reindex rebuilds index for FileStorage file @ path

          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
            }

              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) DumpTxn

                func (d *DumperFsDump) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) 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) DumpFileHeader

                  func (d *DumperFsDumpVerbose) DumpFileHeader(buf *xfmt.Buffer, fh *fs1.FileHeader) error

                  func (*DumperFsDumpVerbose) DumpTxn

                  func (d *DumperFsDumpVerbose) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) 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) DumpTxn

                    func (d *DumperFsTail) DumpTxn(buf *xfmt.Buffer, it *fs1.Iter) error

                    func (*DumperFsTail) DumperName

                    func (d *DumperFsTail) DumperName() string