Documentation
¶
Index ¶
- Constants
- func DirSize(path string) int64
- func GetFileSizes(dirName string) string
- func Subtract(list1, list2 []*a.Record) (result []*a.Record)
- type RecordMap
- type TestClient
- func (tc *TestClient) DropSIndex(namespace, set, name string) error
- func (tc *TestClient) DropUDF(name string) error
- func (tc *TestClient) ReadAllRecords(namespace, set string) (RecordMap, error)
- func (tc *TestClient) ReadAllSIndexes(namespace string) ([]*models.SIndex, error)
- func (tc *TestClient) ReadAllUDFs() ([]*models.UDF, error)
- func (tc *TestClient) Truncate(namespace, set string) error
- func (tc *TestClient) ValidateRecords(t assert.TestingT, expectedRecs []*a.Record, namespace, set string)
- func (tc *TestClient) ValidateSIndexes(t assert.TestingT, expected []*models.SIndex, namespace string)
- func (tc *TestClient) WriteRecords(recs []*a.Record) error
- func (tc *TestClient) WriteSIndexes(sindexes []*models.SIndex) error
- func (tc *TestClient) WriteUDFs(udfs []*models.UDF) error
Constants ¶
const UDF = `` /* 1771-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
func GetFileSizes ¶
GetFileSizes builds and returns an info string containing information about file sizes under the specified dirName.
Types ¶
type RecordMap ¶
RecordMap is a map of record digests to records. It is used to compare expected and actual records. The digest is a string representation of the record's key digest.
type TestClient ¶
type TestClient struct {
// contains filtered or unexported fields
}
TestClient is a wrapper around the Aerospike client that provides convenience methods for testing.
func NewTestClient ¶
func NewTestClient(asc *a.Client) *TestClient
NewTestClient creates a new TestClient.
func (*TestClient) DropSIndex ¶
func (tc *TestClient) DropSIndex(namespace, set, name string) error
DropSIndex deletes a secondary index from the database.
func (*TestClient) DropUDF ¶
func (tc *TestClient) DropUDF(name string) error
DropUDF deletes a UDF from the database.
func (*TestClient) ReadAllRecords ¶
func (tc *TestClient) ReadAllRecords(namespace, set string) (RecordMap, error)
ReadAllRecords reads all records from the given namespace and set.
func (*TestClient) ReadAllSIndexes ¶
func (tc *TestClient) ReadAllSIndexes(namespace string) ([]*models.SIndex, error)
ReadAllSIndexes reads all secondary indexes in the given namespace.
func (*TestClient) ReadAllUDFs ¶
func (tc *TestClient) ReadAllUDFs() ([]*models.UDF, error)
ReadAllUDFs reads all UDFs in the database.
func (*TestClient) Truncate ¶
func (tc *TestClient) Truncate(namespace, set string) error
Truncate deletes all records in the given namespace and set.
func (*TestClient) ValidateRecords ¶
func (tc *TestClient) ValidateRecords( t assert.TestingT, expectedRecs []*a.Record, namespace, set string)
ValidateRecords compares the expected records to the actual records in the database. It fails if the number of records in the namespace and set does not match the length of the expected records, or if any unexpected records are found in the database. It does this by reading all records in the database namespace and set, then comparing their digests and bins to the expected records' digests and bins. Currently, it does not compare the records' metadata, only their digests and bins.
func (*TestClient) ValidateSIndexes ¶
func (tc *TestClient) ValidateSIndexes(t assert.TestingT, expected []*models.SIndex, namespace string)
ValidateSIndexes compares the expected secondary indexes to the actual secondary indexes in the database.
func (*TestClient) WriteRecords ¶
func (tc *TestClient) WriteRecords(recs []*a.Record) error
WriteRecords writes the given records to the database.
func (*TestClient) WriteSIndexes ¶
func (tc *TestClient) WriteSIndexes(sindexes []*models.SIndex) error
WriteSIndexes writes a secondary index to the database.