https://github.com/ipfans/ctxext
stdlib context.Context extensions
https://github.com/ipfans/ctxext
context golang
Last synced: 10 months ago
JSON representation
stdlib context.Context extensions
- Host: GitHub
- URL: https://github.com/ipfans/ctxext
- Owner: ipfans
- License: mit
- Created: 2020-03-16T14:35:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-17T06:20:27.000Z (over 6 years ago)
- Last Synced: 2025-03-26T08:32:11.735Z (over 1 year ago)
- Topics: context, golang
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# ctxext
`ctxext` is extensions of stdlib `context.Context` with compatibility.
## Status
Pre-Alpha stage.
API may changes in the future version.
## HOWTO
`ctxext.Context` is compatibility with `context.Context` interface.
You can use this struct as `context.Context`. But It supplies more
powerful storage for contextual data.
```go
ctx := ctxext.New(nil)
ctx.Set("data", data)
val := ctx.Value("data")
```
## Install
```
go get -u -v github.com/ipfans/ctxext
```