https://github.com/ipfans/metadata
Metadata works with context.Context
https://github.com/ipfans/metadata
Last synced: over 1 year ago
JSON representation
Metadata works with context.Context
- Host: GitHub
- URL: https://github.com/ipfans/metadata
- Owner: ipfans
- License: mit
- Created: 2019-10-06T07:48:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-06T14:22:34.000Z (almost 7 years ago)
- Last Synced: 2025-01-31T10:11:24.601Z (over 1 year ago)
- Language: Go
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# metadata
[](https://godoc.org/github.com/ipfans/metadata)
[](https://github.com/ipfans/metadata/releases)
[](https://goreportcard.com/report/github.com/ipfans/metadata)
`metadata` provides interfaces to contracts with metadata informations with `context.Context`.
## why?
`context.Context.Value()` stores data in linked list. To proformace reasons, we provide `MetaData`
struct to store more informations to context.
## HOWTO
```go
// Store to context
ctx = metadata.NewContext(ctx, md)
// Extract from context
md, ok := metadata.FromContext(ctx)
```