https://github.com/windomz/mtoi
:memo: Key-Value structures: KV, Slice, Cache
https://github.com/windomz/mtoi
cache golang-library key-value slice
Last synced: about 1 year ago
JSON representation
:memo: Key-Value structures: KV, Slice, Cache
- Host: GitHub
- URL: https://github.com/windomz/mtoi
- Owner: WindomZ
- License: mit
- Created: 2017-10-14T14:46:18.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-11T15:53:38.000Z (over 8 years ago)
- Last Synced: 2025-02-15T07:40:42.213Z (over 1 year ago)
- Topics: cache, golang-library, key-value, slice
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mtoi
[](https://travis-ci.org/WindomZ/mtoi)
[](https://coveralls.io/github/WindomZ/mtoi?branch=master)
[](https://app.fossa.io/projects/git%2Bgithub.com%2FWindomZ%2Fmtoi?ref=badge_shield)
> Key-Value structures: KV, Slice, Cache...
## Feature
- **Key-Value** base storage structure.
- **Non-blocking** to write.
- **sync.Map** if >= go1.9.
### KV([kv.go](./kv.go))
- Value is **single** instance.
```
Put(k string, v interface{})
Get(k string) (v interface{}, ok bool)
```
### Slice([slice.go](./slice.go))
- Value is go **slice** structure.
```
Put(k string, v interface{})
Get(k string) (v []interface{}, ok bool)
```
### Cache([cache.go](./cache.go))
- Value is **single** instance.
- Support **expire** time.
```
Put(k string, v interface{}, expire time.Duration)
Get(k string) (v interface{}, ok bool)
```
## Contributing
Welcome to pull requests, report bugs, suggest ideas and discuss
**mtoi** on [issues page](https://github.com/WindomZ/mtoi/issues).
If you like it then you can put a :star: on it.
## License
[MIT](https://github.com/WindomZ/mtoi/blob/master/LICENSE)
[](https://app.fossa.io/projects/git%2Bgithub.com%2FWindomZ%2Fmtoi?ref=badge_large)