Versions in this module Expand all Collapse all v2 v2.0.1 Jun 3, 2020 Changes in this version + const CheckpointFreq + const NumLevels + func BucketPath(bucket Hash) string + func Categories() []string + func CategoryCheckpointPath(cat string, chk uint32) string + func DumpXdrAsJson(args []string) error + func IsCheckpoint(i uint32) bool + func Mirror(src *Archive, dst *Archive, opts *CommandOptions) error + func NextCheckpoint(i uint32) uint32 + func PrevCheckpoint(i uint32) uint32 + func RangePaths(r Range) []string + func Repair(src *Archive, dst *Archive, opts *CommandOptions) error + func SortTxsForHash(txset *xdr.TransactionSet) error + func WriteFramedXdr(out io.Writer, in interface{}) error + type Archive struct + func Connect(u string, opts ConnectOptions) (*Archive, error) + func MustConnect(u string, opts ConnectOptions) *Archive + func (a *Archive) BucketExists(bucket Hash) (bool, error) + func (a *Archive) CategoryCheckpointExists(cat string, chk uint32) (bool, error) + func (a *Archive) GetBucketPathForHash(hash Hash) string + func (a *Archive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error) + func (a *Archive) GetPathHAS(path string) (HistoryArchiveState, error) + func (a *Archive) GetRootHAS() (HistoryArchiveState, error) + func (a *Archive) GetXdrStream(pth string) (*XdrStream, error) + func (a *Archive) GetXdrStreamForHash(hash Hash) (*XdrStream, error) + func (a *Archive) ListAllBucketHashes() (chan Hash, chan error) + func (a *Archive) ListAllBuckets() (chan string, chan error) + func (a *Archive) ListBucket(dp DirPrefix) (chan string, chan error) + func (a *Archive) ListCategoryCheckpoints(cat string, pth string) (chan uint32, chan error) + func (a *Archive) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error + func (a *Archive) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error + func (a *Archive) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error + func (arch *Archive) CheckBucketsMissing() map[Hash]bool + func (arch *Archive) CheckCheckpointFilesMissing(opts *CommandOptions) map[string][]uint32 + func (arch *Archive) ClearCachedInfo() + func (arch *Archive) Log(opts *CommandOptions) error + func (arch *Archive) MustGetBucketSize(hash Hash) int64 + func (arch *Archive) MustGetLedgerHeaderHistoryEntries(chk uint32) []xdr.LedgerHeaderHistoryEntry + func (arch *Archive) MustGetTransactionHistoryEntries(chk uint32) []xdr.TransactionHistoryEntry + func (arch *Archive) NoteCheckpointFile(cat string, chk uint32, present bool) + func (arch *Archive) NoteExistingBucket(bucket Hash) + func (arch *Archive) NoteReferencedBucket(bucket Hash) bool + func (arch *Archive) ReportBucketStats() + func (arch *Archive) ReportCheckpointStats() + func (arch *Archive) ReportInvalid(opts *CommandOptions) error + func (arch *Archive) ReportMissing(opts *CommandOptions) error + func (arch *Archive) Scan(opts *CommandOptions) error + func (arch *Archive) ScanAllBuckets() error + func (arch *Archive) ScanBuckets(opts *CommandOptions) error + func (arch *Archive) ScanCheckpoints(opts *CommandOptions) error + func (arch *Archive) ScanCheckpointsFast(opts *CommandOptions) error + func (arch *Archive) ScanCheckpointsSlow(opts *CommandOptions) error + func (arch *Archive) VerifyBucketEntries(h Hash) error + func (arch *Archive) VerifyBucketHash(h Hash) error + func (arch *Archive) VerifyCategoryCheckpoint(cat string, chk uint32) error + func (arch *Archive) VerifyLedgerHeaderHistoryEntry(entry *xdr.LedgerHeaderHistoryEntry) error + func (arch *Archive) VerifyTransactionHistoryEntry(entry *xdr.TransactionHistoryEntry) error + func (arch *Archive) VerifyTransactionHistoryResultEntry(entry *xdr.TransactionHistoryResultEntry) error + type ArchiveBackend interface + CanListFiles func() bool + Exists func(path string) (bool, error) + GetFile func(path string) (io.ReadCloser, error) + ListFiles func(path string) (chan string, chan error) + PutFile func(path string, in io.ReadCloser) error + Size func(path string) (int64, error) + type ArchiveInterface interface + BucketExists func(bucket Hash) (bool, error) + CategoryCheckpointExists func(cat string, chk uint32) (bool, error) + GetCheckpointHAS func(chk uint32) (HistoryArchiveState, error) + GetPathHAS func(path string) (HistoryArchiveState, error) + GetRootHAS func() (HistoryArchiveState, error) + GetXdrStream func(pth string) (*XdrStream, error) + GetXdrStreamForHash func(hash Hash) (*XdrStream, error) + ListAllBucketHashes func() (chan Hash, chan error) + ListAllBuckets func() (chan string, chan error) + ListBucket func(dp DirPrefix) (chan string, chan error) + ListCategoryCheckpoints func(cat string, pth string) (chan uint32, chan error) + PutCheckpointHAS func(chk uint32, has HistoryArchiveState, opts *CommandOptions) error + PutPathHAS func(path string, has HistoryArchiveState, opts *CommandOptions) error + PutRootHAS func(has HistoryArchiveState, opts *CommandOptions) error + type CommandOptions struct + Concurrency int + DryRun bool + Force bool + Range Range + Thorough bool + Verify bool + type ConnectOptions struct + Context context.Context + S3Endpoint string + S3Region string + UnsignedRequests bool + type DirPrefix [3]uint8 + func CheckpointPrefix(seq uint32) DirPrefix + func HashPrefix(h Hash) DirPrefix + func (d DirPrefix) Path() string + type FsArchiveBackend struct + func (b *FsArchiveBackend) CanListFiles() bool + func (b *FsArchiveBackend) Exists(pth string) (bool, error) + func (b *FsArchiveBackend) GetFile(pth string) (io.ReadCloser, error) + func (b *FsArchiveBackend) ListFiles(pth string) (chan string, chan error) + func (b *FsArchiveBackend) PutFile(pth string, in io.ReadCloser) error + func (b *FsArchiveBackend) Size(pth string) (int64, error) + type Hash [sha256.Size]byte + func DecodeHash(s string) (Hash, error) + func EmptyXdrArrayHash() Hash + func HashEmptyTxSet(previousLedgerHash Hash) Hash + func HashTxSet(txset *xdr.TransactionSet) (Hash, error) + func HashXdr(x interface{}) (Hash, error) + func MustDecodeHash(s string) Hash + func (h Hash) IsZero() bool + func (h Hash) String() string + type HistoryArchiveState struct + CurrentBuckets [NumLevels]struct{ ... } + CurrentLedger uint32 + Server string + Version int + func (h *HistoryArchiveState) BucketListHash() (xdr.Hash, error) + func (h *HistoryArchiveState) Buckets() ([]Hash, error) + func (h *HistoryArchiveState) LevelSummary() (string, int, error) + func (h *HistoryArchiveState) Range() Range + func (has *HistoryArchiveState) GetChangedBuckets(arch *Archive, prevHas *HistoryArchiveState) (string, int, int64) + type HttpArchiveBackend struct + func (b *HttpArchiveBackend) CanListFiles() bool + func (b *HttpArchiveBackend) Exists(pth string) (bool, error) + func (b *HttpArchiveBackend) GetFile(pth string) (io.ReadCloser, error) + func (b *HttpArchiveBackend) Head(pth string) (*http.Response, error) + func (b *HttpArchiveBackend) ListFiles(pth string) (chan string, chan error) + func (b *HttpArchiveBackend) PutFile(pth string, in io.ReadCloser) error + func (b *HttpArchiveBackend) Size(pth string) (int64, error) + type MockArchive struct + func (m *MockArchive) BucketExists(bucket Hash) (bool, error) + func (m *MockArchive) CategoryCheckpointExists(cat string, chk uint32) (bool, error) + func (m *MockArchive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error) + func (m *MockArchive) GetPathHAS(path string) (HistoryArchiveState, error) + func (m *MockArchive) GetRootHAS() (HistoryArchiveState, error) + func (m *MockArchive) GetXdrStream(pth string) (*XdrStream, error) + func (m *MockArchive) GetXdrStreamForHash(hash Hash) (*XdrStream, error) + func (m *MockArchive) ListAllBucketHashes() (chan Hash, chan error) + func (m *MockArchive) ListAllBuckets() (chan string, chan error) + func (m *MockArchive) ListBucket(dp DirPrefix) (chan string, chan error) + func (m *MockArchive) ListCategoryCheckpoints(cat string, pth string) (chan uint32, chan error) + func (m *MockArchive) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error + func (m *MockArchive) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error + func (m *MockArchive) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error + type MockArchiveBackend struct + func (b *MockArchiveBackend) CanListFiles() bool + func (b *MockArchiveBackend) Exists(pth string) (bool, error) + func (b *MockArchiveBackend) GetFile(pth string) (io.ReadCloser, error) + func (b *MockArchiveBackend) ListFiles(pth string) (chan string, chan error) + func (b *MockArchiveBackend) PutFile(pth string, in io.ReadCloser) error + func (b *MockArchiveBackend) Size(pth string) (int64, error) + type Range struct + High uint32 + Low uint32 + func MakeRange(low uint32, high uint32) Range + func (r Range) Checkpoints() chan uint32 + func (r Range) Size() int + func (r Range) String() string + type S3ArchiveBackend struct + func (b *S3ArchiveBackend) CanListFiles() bool + func (b *S3ArchiveBackend) Exists(pth string) (bool, error) + func (b *S3ArchiveBackend) GetFile(pth string) (io.ReadCloser, error) + func (b *S3ArchiveBackend) Head(pth string) (*http.Response, error) + func (b *S3ArchiveBackend) ListFiles(pth string) (chan string, chan error) + func (b *S3ArchiveBackend) PutFile(pth string, in io.ReadCloser) error + func (b *S3ArchiveBackend) Size(pth string) (int64, error) + type XdrStream struct + func NewXdrGzStream(in io.ReadCloser) (*XdrStream, error) + func NewXdrStream(in io.ReadCloser) *XdrStream + func (x *XdrStream) BytesRead() int64 + func (x *XdrStream) Close() error + func (x *XdrStream) Discard(n int64) (int64, error) + func (x *XdrStream) ExpectedHash() ([sha256.Size]byte, bool) + func (x *XdrStream) ReadOne(in interface{}) error + func (x *XdrStream) SetExpectedHash(hash [sha256.Size]byte)