Documentation ¶
Overview ¶
Package mysql contains a MySQL-based storage implementation for Tessera.
Index ¶
- type Storage
- func (s *Storage) Add(ctx context.Context, entry *tessera.Entry) tessera.IndexFuture
- func (s *Storage) ReadCheckpoint(ctx context.Context) ([]byte, error)
- func (s *Storage) ReadEntryBundle(ctx context.Context, index, treeSize uint64) ([]byte, error)
- func (s *Storage) ReadTile(ctx context.Context, level, index, minTreeSize uint64) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a MySQL-based storage implementation for Tessera.
func New ¶
New creates a new instance of the MySQL-based Storage. Note that `tessera.WithCheckpointSigner()` is mandatory in the `opts` argument.
func (*Storage) ReadCheckpoint ¶
ReadCheckpoint returns the latest stored checkpoint. If the checkpoint is not found, it returns os.ErrNotExist.
func (*Storage) ReadEntryBundle ¶
ReadEntryBundle returns the log entries at the given index. If the entry bundle is not found, it returns os.ErrNotExist.
TODO: Handle the following scenarios: 1. Full tile request with full tile output: Return full tile. 2. Full tile request with partial tile output: Return error. 3. Partial tile request with full/larger partial tile output: Return trimmed partial tile with correct tile width. 4. Partial tile request with partial tile (same width) output: Return partial tile. 5. Partial tile request with smaller partial tile output: Return error.
func (*Storage) ReadTile ¶
ReadTile returns a full tile or a partial tile at the given level, index and treeSize. If the tile is not found, it returns os.ErrNotExist.
Note that if a partial tile is requested, but a larger tile is available, this will return the largest tile available. This could be trimmed to return only the number of entries specifically requested if this behaviour becomes problematic.