Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Codecs = []db.Codec{ codec.JSONCodec, codec.GobCodec, codec.BinaryCodec, }
Codecs we want to test.
View Source
var DbInitalizer = []func(db.Codec) db.DB{ func(codec db.Codec) db.DB { return memdb.New(codec) }, func(codec db.Codec) db.DB { return leveldb.New(".leveldb", codec) }, func(codec db.Codec) db.DB { return badgerdb.New(".badgerdb", codec) }, }
DbInitalizer returns a list of initialize functions of different DB implementations.
Functions ¶
func CheckErrors ¶
CheckErrors takes a list of errors and check if any of them is not nil. It returns the first non-nil error or nil if all of the errors are nil.
func RandomNonDupStrings ¶
RandomNonDupStrings returns a list of non-duplicate strings.
func RandomTestStructGroups ¶
func RandomTestStructGroups(group, entriesPerGroup int) [][]TestStruct
RandomTestStructGroups creates a group of random TestStructs.
Types ¶
type TestStruct ¶
TestStruct is a struct which includes some commonly used types.
func RandomTestStruct ¶
func RandomTestStruct() TestStruct
RandomTestStruct returns a random `TestStruct`
func (TestStruct) MarshalBinary ¶ added in v1.0.3
func (s TestStruct) MarshalBinary() ([]byte, error)
MarshalBinary implements the `BinaryMarshaler` interface.
func (*TestStruct) UnmarshalBinary ¶ added in v1.0.3
func (s *TestStruct) UnmarshalBinary(data []byte) error
UnmarshalBinary implements the `BinaryUnmarshaler` interface.
Click to show internal directories.
Click to hide internal directories.