A metadata management
$ go get github.com/tint/metadata
Note: Always vendor your dependencies or fix on a specific version tag.
import (
"github.com/tint/metadata"
"context"
)
md := metadata.New(map[string]{
"Foo": "bar",
"bar": "baz",
})
md.Get("foo") // bar
md.Get("Foo") // bar
md.Set("baz", "baaa")
md.Delete("foo", "bar")
md.Copy() // new metadata
ctx := context.Background()
// md = metadata.FromContext(ctx)
metadata.NewContext(ctx, md)
metadata.Get(ctx, "foo")
metadata.Set("baz", "zab")
metadata.Delete("baz", "zab")
See the LICENSE file for details.