Documentation
¶
Overview ¶
Package log provides the underlying functionality for managing log data structures.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrDupeLeaf is returned by the Sequence method of storage implementations to // indicate that a leaf has already been sequenced. ErrDupeLeaf = errors.New("duplicate leaf") // ErrSeqAlreadyAssigned is returned by the Assign method of storage implementations // to indicate that the provided sequence number is already in use. ErrSeqAlreadyAssigned = errors.New("sequence number already assigned") )
Functions ¶
Types ¶
type Storage ¶
type Storage interface { // GetTile returns the tile at the given level & index. GetTile(ctx context.Context, level, index, logSize uint64) (*api.Tile, error) // StoreTile stores the tile at the given level & index. StoreTile(ctx context.Context, level, index uint64, tile *api.Tile) error // WriteCheckpoint stores a newly updated log checkpoint. WriteCheckpoint(ctx context.Context, newCPRaw []byte) error // Sequence assigns sequence numbers to the passed in entry. // Returns the assigned sequence number for the leafhash. // // If a duplicate leaf is sequenced the storage implementation may return // the sequence number associated with an earlier instance, along with a // ErrDupeLeaf error. Sequence(ctx context.Context, leafhash []byte, leaf []byte) (uint64, error) // ScanSequenced calls f for each contiguous sequenced log entry >= begin. // It should stop scanning if the call to f returns an error. ScanSequenced(ctx context.Context, begin uint64, f func(seq uint64, entry []byte) error) (uint64, error) }
Storage represents the set of functions needed by the log tooling.
Click to show internal directories.
Click to hide internal directories.