https://github.com/windomz/sharding
Simple sharding tables fo Go.
https://github.com/windomz/sharding
Last synced: 12 months ago
JSON representation
Simple sharding tables fo Go.
- Host: GitHub
- URL: https://github.com/windomz/sharding
- Owner: WindomZ
- Created: 2018-07-04T05:52:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-08-03T01:52:03.000Z (almost 8 years ago)
- Last Synced: 2025-02-15T07:40:41.893Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sharding
> Simple sharding tables fo Go.
[](https://travis-ci.org/WindomZ/sharding)
[](https://codecov.io/gh/WindomZ/sharding)
## Install
```bash
go get -u github.com/WindomZ/sharding
```
## Usage
Hash(crc32):
```go
shard := sharding.NewHashShard("_", 0, 64) // create hash formatter
fmt.Println(shard.Format("hello", "world")) // hello_3
```
Time:
```go
shard := sharding.NewTimeShard("_", "20060102") // create time formatter
fmt.Println(shard..Format("hello")) // hello_20180705
```
## Contributing
Welcome to pull requests, report bugs, suggest ideas and discuss,
i would love to hear what you think on [issues page](https://github.com/WindomZ/sharding/issues).
If you like it then you can put a :star: on it.
## License
[MIT](https://github.com/WindomZ/sharding/blob/master/LICENSE)