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. // Used to consistently read and write MTS metadata entries.
const ( const (
WriteRateKey = "writeRate" WriteRateKey = "writeRate"
TimestampKey = meta.TimestampKey TimestampKey = "ts"
LocationKey = meta.LocationKey LocationKey = "loc"
) )
// Meta allows addition of metadata to encoded mts from outside of this pkg. // Meta allows addition of metadata to encoded mts from outside of this pkg.

View File

@ -52,19 +52,13 @@ const (
dataLenIdx = 2 dataLenIdx = 2
) )
// Used to consistently read and write metadata entries.
const (
TimestampKey = "ts"
LocationKey = "loc"
)
var ( var (
errKeyAbsent = errors.New("Key does not exist in map") errKeyAbsent = errors.New("Key does not exist in map")
errInvalidMeta = errors.New("Invalid metadata given") errInvalidMeta = errors.New("Invalid metadata given")
ErrUnexpectedMetaFormat = errors.New("Unexpected meta format") 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. // using a map.
type Data struct { type Data struct {
mu sync.RWMutex mu sync.RWMutex

View File

@ -32,6 +32,8 @@ import (
) )
const ( const (
TimestampKey = "ts"
LocationKey = "loc"
tstKey1 = LocationKey tstKey1 = LocationKey
tstData1 = "a,b,c" tstData1 = "a,b,c"
tstKey2 = TimestampKey tstKey2 = TimestampKey