Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pomerium/autocache
Distributed cache with gossip peer membership enrollment.
https://github.com/pomerium/autocache
cache go golang gossip groupcache memberlist pomerium
Last synced: 6 days ago
JSON representation
Distributed cache with gossip peer membership enrollment.
- Host: GitHub
- URL: https://github.com/pomerium/autocache
- Owner: pomerium
- License: apache-2.0
- Created: 2020-01-04T06:23:54.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-07-16T17:59:50.000Z (6 months ago)
- Last Synced: 2024-12-20T23:07:07.250Z (13 days ago)
- Topics: cache, go, golang, gossip, groupcache, memberlist, pomerium
- Language: Go
- Homepage: https://www.pomerium.io/
- Size: 183 KB
- Stars: 109
- Watchers: 8
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
[![Build Status](https://github.com/pomerium/autocache/workflows/build/badge.svg)](https://github.com/pomerium/autocache/actions?workflow=build)
[![codecov](https://img.shields.io/codecov/c/github/pomerium/autocache.svg?style=flat)](https://codecov.io/gh/pomerium/autocache)
[![Go Report Card](https://goreportcard.com/badge/github.com/pomerium/autocache)](https://goreportcard.com/report/github.com/pomerium/autocache)
[![GoDoc](https://godoc.org/github.com/pomerium/autocache?status.svg)](https://godoc.org/github.com/pomerium/autocache)
[![LICENSE](https://img.shields.io/github/license/pomerium/autocache.svg)](https://github.com/pomerium/autocache/blob/master/LICENSE)
[![discuss](https://img.shields.io/discourse/posts?server=https%3A%2F%2Fdiscuss.pomerium.com%2F&label=discuss)](https://discuss.pomerium.com/)# Autocache
[Groupcache](https://github.com/golang/groupcache) enhanced with [memberlist](https://github.com/hashicorp/memberlist) for distributed peer discovery.
## TL;DR
See `/_example/` for usage.
### Run
`docker-compose -f _example/docker-compose.yaml up --scale autocache=5`
### Client
```bash
for i in`seq 10`; do curl "http://autocache.localhost/get/?key=hunter2";echo; done```
```
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
$2a$14$1CCq.8WOxEmLY3jdkwZKIeR1bN/B0jnWwwSKc1VTf60A57VOXKblC
```### Server
```
autocache_2 | 2020/01/06 06:10:51 bcryptKey/key:"hunter2" time:969.8645ms
autocache_2 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[969.9474ms]
autocache_1 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[1.3559ms]
autocache_3 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[1.1236ms]
autocache_4 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[1.2935ms]
autocache_5 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[985.2µs]
autocache_6 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[1.2163ms]
autocache_2 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[23.3µs]
autocache_1 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[495.3µs]
autocache_3 | 2020/01/06 06:10:51 cacheHandler: group[bcrypt] key["hunter2"] time[497.3µs]
autocache_4 | 2020/01/06 06:10:52 cacheHandler: group[bcrypt] key["hunter2"] time[770.5µs]
```