meta: use specific metadata keys in tests, not main package

This commit is contained in:
Trek H 2021-02-22 16:45:11 +10:30
parent fdf17f3a97
commit 6d5cfb5337
3 changed files with 10 additions and 14 deletions

View File

@ -104,8 +104,8 @@ const (
// Used to consistently read and write MTS metadata entries.
const (
WriteRateKey = "writeRate"
TimestampKey = meta.TimestampKey
LocationKey = meta.LocationKey
TimestampKey = "ts"
LocationKey = "loc"
)
// Meta allows addition of metadata to encoded mts from outside of this pkg.

View File

@ -52,19 +52,13 @@ const (
dataLenIdx = 2
)
// Used to consistently read and write metadata entries.
const (
TimestampKey = "ts"
LocationKey = "loc"
)
var (
errKeyAbsent = errors.New("Key does not exist in map")
errInvalidMeta = errors.New("Invalid metadata given")
ErrUnexpectedMetaFormat = errors.New("Unexpected meta format")
)
// Metadata provides functionality for the storage and encoding of metadata
// Data provides functionality for the storage and encoding of metadata
// using a map.
type Data struct {
mu sync.RWMutex

View File

@ -32,11 +32,13 @@ import (
)
const (
tstKey1 = LocationKey
tstData1 = "a,b,c"
tstKey2 = TimestampKey
tstData2 = "12345678"
tstData3 = "d,e,f"
TimestampKey = "ts"
LocationKey = "loc"
tstKey1 = LocationKey
tstData1 = "a,b,c"
tstKey2 = TimestampKey
tstData2 = "12345678"
tstData3 = "d,e,f"
)
// TestAddAndGet ensures that we can add metadata and then successfully get it.