https://github.com/benbjohnson/writing-a-distributed-systems-library
Companion code for the Gopher Academy blog post.
https://github.com/benbjohnson/writing-a-distributed-systems-library
Last synced: 2 months ago
JSON representation
Companion code for the Gopher Academy blog post.
- Host: GitHub
- URL: https://github.com/benbjohnson/writing-a-distributed-systems-library
- Owner: benbjohnson
- License: mit
- Created: 2014-01-03T16:41:35.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-03T17:26:24.000Z (about 12 years ago)
- Last Synced: 2025-04-02T21:05:50.270Z (9 months ago)
- Language: Go
- Size: 129 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Overview
Companion code for the Gopher Academy blog post:
http://www.gopheracademy.com/writing-a-distributed-system-library
## Running
To run the code, simply `go get` it:
```sh
$ go get github.com/benbjohnson/writing-a-distributed-systems-library
```
And then you can run the executable:
```
$ writing-a-distributed-systems-library
```
From another terminal window, you can add values to your system using something fancy like curl:
```
$ curl http://localhost:8000/add?value=5
5
$ curl http://localhost:8000/add?value=10
15
$ curl http://localhost:8000/add?value=-2
13
```
You can stop and restart the program (from the same directory) and your data will be persisted.
Cluster configuration is not included in this simple example.
For a more complete example, please check out the [raftd](https://github.com/goraft/raftd) reference implementation.