Documentation ¶
Index ¶
- Constants
- func BucketPath(bucket Hash) string
- func Categories() []string
- func CategoryCheckpointPath(cat string, chk uint32) string
- func DumpXdrAsJson(args []string) error
- 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
- func (a *Archive) BucketExists(bucket Hash) bool
- func (a *Archive) CategoryCheckpointExists(cat string, chk uint32) bool
- func (arch *Archive) CheckBucketsMissing() map[Hash]bool
- func (arch *Archive) CheckCheckpointFilesMissing(opts *CommandOptions) map[string][]uint32
- func (arch *Archive) ClearCachedInfo()
- 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) 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 (arch *Archive) NoteCheckpointFile(cat string, chk uint32, present bool)
- func (arch *Archive) NoteExistingBucket(bucket Hash)
- func (arch *Archive) NoteReferencedBucket(bucket Hash) bool
- 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) 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
- type ByHash
- type ByUint32
- type CommandOptions
- type ConnectOptions
- type DirPrefix
- type FsArchiveBackend
- func (b *FsArchiveBackend) CanListFiles() bool
- func (b *FsArchiveBackend) Exists(pth string) bool
- 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
- type Hash
- type HistoryArchiveState
- type HttpArchiveBackend
- func (b *HttpArchiveBackend) CanListFiles() bool
- func (b *HttpArchiveBackend) Exists(pth string) bool
- func (b *HttpArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
- func (b *HttpArchiveBackend) ListFiles(pth string) (chan string, chan error)
- func (b *HttpArchiveBackend) PutFile(pth string, in io.ReadCloser) error
- type MockArchiveBackend
- func (b *MockArchiveBackend) CanListFiles() bool
- func (b *MockArchiveBackend) Exists(pth string) bool
- 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
- type Range
- type S3ArchiveBackend
- func (b *S3ArchiveBackend) CanListFiles() bool
- func (b *S3ArchiveBackend) Exists(pth string) bool
- func (b *S3ArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
- func (b *S3ArchiveBackend) ListFiles(pth string) (chan string, chan error)
- func (b *S3ArchiveBackend) PutFile(pth string, in io.ReadCloser) error
- type XdrStream
Constants ¶
View Source
const CheckpointFreq = uint32(64)
View Source
const NumLevels = 11
Variables ¶
This section is empty.
Functions ¶
func BucketPath ¶
func Categories ¶
func Categories() []string
func CategoryCheckpointPath ¶
func DumpXdrAsJson ¶
func NextCheckpoint ¶
func PrevCheckpoint ¶
func RangePaths ¶
Returns an array of path prefixes to walk to enumerate all the objects in the provided range.
func SortTxsForHash ¶
func SortTxsForHash(txset *xdr.TransactionSet) error
func WriteFramedXdr ¶
Types ¶
type Archive ¶
type Archive struct {
// contains filtered or unexported fields
}
func MustConnect ¶
func MustConnect(u string, opts *ConnectOptions) *Archive
func (*Archive) BucketExists ¶
func (*Archive) CategoryCheckpointExists ¶
func (*Archive) CheckBucketsMissing ¶
func (*Archive) CheckCheckpointFilesMissing ¶
func (arch *Archive) CheckCheckpointFilesMissing(opts *CommandOptions) map[string][]uint32
func (*Archive) ClearCachedInfo ¶
func (arch *Archive) ClearCachedInfo()
func (*Archive) GetCheckpointHAS ¶
func (a *Archive) GetCheckpointHAS(chk uint32) (HistoryArchiveState, error)
func (*Archive) GetPathHAS ¶
func (a *Archive) GetPathHAS(path string) (HistoryArchiveState, error)
func (*Archive) GetRootHAS ¶
func (a *Archive) GetRootHAS() (HistoryArchiveState, error)
func (*Archive) ListAllBucketHashes ¶
func (*Archive) ListAllBuckets ¶
func (*Archive) ListCategoryCheckpoints ¶
func (*Archive) NoteCheckpointFile ¶
func (*Archive) NoteExistingBucket ¶
func (*Archive) NoteReferencedBucket ¶
func (*Archive) PutCheckpointHAS ¶
func (a *Archive) PutCheckpointHAS(chk uint32, has HistoryArchiveState, opts *CommandOptions) error
func (*Archive) PutPathHAS ¶
func (a *Archive) PutPathHAS(path string, has HistoryArchiveState, opts *CommandOptions) error
func (*Archive) PutRootHAS ¶
func (a *Archive) PutRootHAS(has HistoryArchiveState, opts *CommandOptions) error
func (*Archive) ReportBucketStats ¶
func (arch *Archive) ReportBucketStats()
func (*Archive) ReportCheckpointStats ¶
func (arch *Archive) ReportCheckpointStats()
func (*Archive) ReportInvalid ¶
func (arch *Archive) ReportInvalid(opts *CommandOptions) error
func (*Archive) ReportMissing ¶
func (arch *Archive) ReportMissing(opts *CommandOptions) error
func (*Archive) Scan ¶
func (arch *Archive) Scan(opts *CommandOptions) error
func (*Archive) ScanAllBuckets ¶
func (*Archive) ScanBuckets ¶
func (arch *Archive) ScanBuckets(opts *CommandOptions) error
func (*Archive) ScanCheckpoints ¶
func (arch *Archive) ScanCheckpoints(opts *CommandOptions) error
func (*Archive) ScanCheckpointsFast ¶
func (arch *Archive) ScanCheckpointsFast(opts *CommandOptions) error
func (*Archive) ScanCheckpointsSlow ¶
func (arch *Archive) ScanCheckpointsSlow(opts *CommandOptions) error
func (*Archive) VerifyBucketEntries ¶
func (*Archive) VerifyBucketHash ¶
func (*Archive) VerifyCategoryCheckpoint ¶
func (*Archive) VerifyLedgerHeaderHistoryEntry ¶
func (arch *Archive) VerifyLedgerHeaderHistoryEntry(entry *xdr.LedgerHeaderHistoryEntry) error
func (*Archive) VerifyTransactionHistoryEntry ¶
func (arch *Archive) VerifyTransactionHistoryEntry(entry *xdr.TransactionHistoryEntry) error
func (*Archive) VerifyTransactionHistoryResultEntry ¶
func (arch *Archive) VerifyTransactionHistoryResultEntry(entry *xdr.TransactionHistoryResultEntry) error
type ArchiveBackend ¶
type ArchiveBackend interface { Exists(path string) bool GetFile(path string) (io.ReadCloser, error) PutFile(path string, in io.ReadCloser) error ListFiles(path string) (chan string, chan error) CanListFiles() bool }
func MakeFsBackend ¶
func MakeFsBackend(pth string, opts *ConnectOptions) ArchiveBackend
func MakeHttpBackend ¶
func MakeHttpBackend(base *url.URL, opts *ConnectOptions) ArchiveBackend
func MakeMockBackend ¶
func MakeMockBackend(opts *ConnectOptions) ArchiveBackend
func MakeS3Backend ¶
func MakeS3Backend(bucket string, prefix string, opts *ConnectOptions) ArchiveBackend
type CommandOptions ¶
type ConnectOptions ¶
type ConnectOptions struct {
S3Region string
}
type DirPrefix ¶
type DirPrefix [3]uint8
func CheckpointPrefix ¶
func HashPrefix ¶
func (DirPrefix) PathPrefix ¶
type FsArchiveBackend ¶
type FsArchiveBackend struct {
// contains filtered or unexported fields
}
func (*FsArchiveBackend) CanListFiles ¶
func (b *FsArchiveBackend) CanListFiles() bool
func (*FsArchiveBackend) Exists ¶
func (b *FsArchiveBackend) Exists(pth string) bool
func (*FsArchiveBackend) GetFile ¶
func (b *FsArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
func (*FsArchiveBackend) ListFiles ¶
func (b *FsArchiveBackend) ListFiles(pth string) (chan string, chan error)
func (*FsArchiveBackend) PutFile ¶
func (b *FsArchiveBackend) PutFile(pth string, in io.ReadCloser) error
type Hash ¶
func DecodeHash ¶
func EmptyXdrArrayHash ¶
func EmptyXdrArrayHash() Hash
func HashEmptyTxSet ¶
func MustDecodeHash ¶
type HistoryArchiveState ¶
type HistoryArchiveState struct { Version int `json:"version"` Server string `json:"server"` CurrentLedger uint32 `json:"currentLedger"` CurrentBuckets [NumLevels]struct { Curr string `json:"curr"` Snap string `json:"snap"` Next struct { State uint32 `json:"state"` Output string `json:"output,omitempty"` } `json:"next"` } `json:"currentBuckets"` }
func (*HistoryArchiveState) Buckets ¶
func (h *HistoryArchiveState) Buckets() []Hash
func (*HistoryArchiveState) LevelSummary ¶
func (h *HistoryArchiveState) LevelSummary() (string, int)
func (*HistoryArchiveState) Range ¶
func (h *HistoryArchiveState) Range() Range
type HttpArchiveBackend ¶
type HttpArchiveBackend struct {
// contains filtered or unexported fields
}
func (*HttpArchiveBackend) CanListFiles ¶
func (b *HttpArchiveBackend) CanListFiles() bool
func (*HttpArchiveBackend) Exists ¶
func (b *HttpArchiveBackend) Exists(pth string) bool
func (*HttpArchiveBackend) GetFile ¶
func (b *HttpArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
func (*HttpArchiveBackend) ListFiles ¶
func (b *HttpArchiveBackend) ListFiles(pth string) (chan string, chan error)
func (*HttpArchiveBackend) PutFile ¶
func (b *HttpArchiveBackend) PutFile(pth string, in io.ReadCloser) error
type MockArchiveBackend ¶
type MockArchiveBackend struct {
// contains filtered or unexported fields
}
func (*MockArchiveBackend) CanListFiles ¶
func (b *MockArchiveBackend) CanListFiles() bool
func (*MockArchiveBackend) Exists ¶
func (b *MockArchiveBackend) Exists(pth string) bool
func (*MockArchiveBackend) GetFile ¶
func (b *MockArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
func (*MockArchiveBackend) ListFiles ¶
func (b *MockArchiveBackend) ListFiles(pth string) (chan string, chan error)
func (*MockArchiveBackend) PutFile ¶
func (b *MockArchiveBackend) PutFile(pth string, in io.ReadCloser) error
type S3ArchiveBackend ¶
type S3ArchiveBackend struct {
// contains filtered or unexported fields
}
func (*S3ArchiveBackend) CanListFiles ¶
func (b *S3ArchiveBackend) CanListFiles() bool
func (*S3ArchiveBackend) Exists ¶
func (b *S3ArchiveBackend) Exists(pth string) bool
func (*S3ArchiveBackend) GetFile ¶
func (b *S3ArchiveBackend) GetFile(pth string) (io.ReadCloser, error)
func (*S3ArchiveBackend) ListFiles ¶
func (b *S3ArchiveBackend) ListFiles(pth string) (chan string, chan error)
func (*S3ArchiveBackend) PutFile ¶
func (b *S3ArchiveBackend) PutFile(pth string, in io.ReadCloser) error
type XdrStream ¶
type XdrStream struct {
// contains filtered or unexported fields
}
func NewXdrGzStream ¶
func NewXdrGzStream(in io.ReadCloser) (*XdrStream, error)
func NewXdrStream ¶
func NewXdrStream(in io.ReadCloser) *XdrStream
Click to show internal directories.
Click to hide internal directories.