testonly

package
v0.0.0-...-1a4bf1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

package testonly provides helpers which are intended for use in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemStorage

type MemStorage struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewMemStorage

func NewMemStorage() *MemStorage

func (*MemStorage) Fetcher

func (ms *MemStorage) Fetcher() client.Fetcher

func (*MemStorage) GetTile

func (ms *MemStorage) GetTile(_ context.Context, level, index, logSize uint64) (*api.Tile, error)

GetTile returns the tile at the given level & index.

func (*MemStorage) ScanSequenced

func (ms *MemStorage) ScanSequenced(_ context.Context, begin uint64, f func(seq uint64, entry []byte) error) (uint64, error)

ScanSequenced calls f for each contiguous sequenced log entry >= begin. It should stop scanning if the call to f returns an error.

func (*MemStorage) Sequence

func (ms *MemStorage) Sequence(_ context.Context, leafhash []byte, leaf []byte) (uint64, 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.

func (*MemStorage) StoreTile

func (ms *MemStorage) StoreTile(_ context.Context, level, index uint64, tile *api.Tile) error

StoreTile stores the tile at the given level & index.

func (*MemStorage) WriteCheckpoint

func (ms *MemStorage) WriteCheckpoint(_ context.Context, newCPRaw []byte) error

WriteCheckpoint stores a newly updated log checkpoint.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL