test

package
v0.0.0-...-4b1e2ef Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checksum

func Checksum(t *testing.T, e eventlog.Event) uint64

func EventLen

func EventLen(e eventlog.Event) int64

func LabelLen

func LabelLen(e eventlog.Event) uint16

func NewBuffer

func NewBuffer() []byte

func PayloadLen

func PayloadLen(e eventlog.Event) uint32

func ValidFileHeader

func ValidFileHeader(t *testing.T) (
	parts []interface{},
	creation time.Time,
	len int64,
)

func ValidLog

func ValidLog(t *testing.T) []eventlog.Event

Types

type ExpectedRead

type ExpectedRead struct {
	Offset int64
	Write  []byte
}

type FakeSrc

type FakeSrc []byte

func Compose

func Compose(
	t *testing.T,
	parts ...interface{},
) (f FakeSrc, headerLength int64)

func ComposeWithValidHeader

func ComposeWithValidHeader(
	t *testing.T,
	parts ...interface{},
) (f FakeSrc, creation time.Time, headerLength int64)

func (FakeSrc) Len

func (f FakeSrc) Len() (uint64, error)

func (FakeSrc) ReadAt

func (f FakeSrc) ReadAt(buf []byte, offset int64) (read int, err error)

type ReadRecorder

type ReadRecorder struct {
	// contains filtered or unexported fields
}

func NewReadRecorder

func NewReadRecorder(t *testing.T, e ...ExpectedRead) *ReadRecorder

func (*ReadRecorder) ReadAt

func (r *ReadRecorder) ReadAt(buffer []byte, offset int64) (int, error)

Jump to

Keyboard shortcuts

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