Skip to content

tint/metadata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metadata

A metadata management

Usage

$ 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")

License

See the LICENSE file for details.

About

A metadata management

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages