An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# mtoi

[![Build Status](https://travis-ci.org/WindomZ/mtoi.svg?branch=master)](https://travis-ci.org/WindomZ/mtoi)
[![Coverage Status](https://coveralls.io/repos/github/WindomZ/mtoi/badge.svg?branch=master)](https://coveralls.io/github/WindomZ/mtoi?branch=master)
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FWindomZ%2Fmtoi.svg?type=shield)](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)

[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2FWindomZ%2Fmtoi.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2FWindomZ%2Fmtoi?ref=badge_large)