Documentation
¶
Overview ¶
Package utils provides functionality which is used by several other packages or by tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NoCopy ¶
type NoCopy struct{}
NoCopy prevents copying structs by accident. Adding it to a struct will cause go vet to flag it as an error when you try to copy the struct. This is inspired by sync.noCopy which is used in several concurrency primitives but not publicly exposed.
type SegmentReaderFileLoop ¶
SegmentReaderFileLoop provides a stub for the segment file which returns the same data over and over again in an endless loop. It allows us to run large scale benchmarks without having to provide an actual big file on disk or memory.
func (*SegmentReaderFileLoop) Close ¶
func (s *SegmentReaderFileLoop) Close() error
func (*SegmentReaderFileLoop) Name ¶
func (s *SegmentReaderFileLoop) Name() string
type SegmentWriterFileDiscard ¶
type SegmentWriterFileDiscard struct{}
SegmentWriterFileDiscard provides a stub for a segment file which discards all data. It allows us to run large scale benchmarks without filling up the disk or memory.
func (*SegmentWriterFileDiscard) Close ¶
func (s *SegmentWriterFileDiscard) Close() error
func (*SegmentWriterFileDiscard) Name ¶
func (s *SegmentWriterFileDiscard) Name() string
func (*SegmentWriterFileDiscard) Sync ¶
func (s *SegmentWriterFileDiscard) Sync() error
func (*SegmentWriterFileDiscard) Truncate ¶
func (s *SegmentWriterFileDiscard) Truncate(offset int64) error
type SegmentWriterFileRecorder ¶
SegmentWriterFileRecorder provides a stub for a segment file which records what is written to it in memory. It allows us to use a SegmentWriter to prepare a buffer which can then be used by SegmentReaderFileLoop to serve read requests.
func (*SegmentWriterFileRecorder) Close ¶
func (s *SegmentWriterFileRecorder) Close() error
func (*SegmentWriterFileRecorder) Name ¶
func (s *SegmentWriterFileRecorder) Name() string
func (*SegmentWriterFileRecorder) Sync ¶
func (s *SegmentWriterFileRecorder) Sync() error
func (*SegmentWriterFileRecorder) Truncate ¶
func (s *SegmentWriterFileRecorder) Truncate(offset int64) error