Documentation ¶
Index ¶
- func ApplyMigration(t *testing.T, ...)
- func ApplyMigrationWithDb(t testing.TB, ...)
- func DumpDB(tx kvdb.RTx, rootKey []byte) error
- func Hex(value string) string
- func MakeDB(t testing.TB) (kvdb.Backend, error)
- func RestoreDB(tx kvdb.RwTx, rootKey []byte, data map[string]interface{}) error
- func VerifyDB(tx kvdb.RTx, rootKey []byte, data map[string]interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMigration ¶
func ApplyMigration(t *testing.T, beforeMigration, afterMigration, migrationFunc func(tx kvdb.RwTx) error, shouldFail bool)
ApplyMigration is a helper test function that encapsulates the general steps which are needed to properly check the result of applying migration function.
func ApplyMigrationWithDb ¶
func ApplyMigrationWithDb(t testing.TB, beforeMigration, afterMigration, migrationFunc func(db kvdb.Backend) error)
ApplyMigrationWithDb is a helper test function that encapsulates the general steps which are needed to properly check the result of applying migration function. This function differs from ApplyMigration as it requires the supplied migration functions to take a db instance and construct their own database transactions.
func DumpDB ¶
DumpDB dumps go code describing the contents of the database to stdout. This function is only intended for use during development.
Example output:
map[string]interface{}{ hex("1234"): map[string]interface{}{ "human-readable": hex("102030"), hex("1111"): hex("5783492373"), }, }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.