diff --git a/stream/mts/meta.go b/stream/mts/meta.go index c12998bd..465a537e 100644 --- a/stream/mts/meta.go +++ b/stream/mts/meta.go @@ -107,6 +107,8 @@ func (m *Meta) Delete(key string) error { return errKeyAbsent } +// Encode takes the meta data map and encods into a byte slice with header +// describing the version, length of data and data in TSV format. func (m *Meta) Encode() []byte { m.enc = m.enc[:headSize] diff --git a/stream/mts/meta_test.go b/stream/mts/meta_test.go index 010c9b82..daff9038 100644 --- a/stream/mts/meta_test.go +++ b/stream/mts/meta_test.go @@ -126,6 +126,7 @@ func TestDeleteAbsentKey(t *testing.T) { } } +// TestEncode checks that we're getting the correct byte slice from Meta.Encode(). func TestEncode(t *testing.T) { meta := NewMeta() meta.Add(tstKey1, tstData1)