Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wyattjoh/heximage
An attempt at creating an implementation of the r/Place experiment in Go with help from Redis for 24 bit colour support
https://github.com/wyattjoh/heximage
go reddit redis
Last synced: 17 days ago
JSON representation
An attempt at creating an implementation of the r/Place experiment in Go with help from Redis for 24 bit colour support
- Host: GitHub
- URL: https://github.com/wyattjoh/heximage
- Owner: wyattjoh
- License: mit
- Created: 2017-04-17T21:02:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T23:24:13.000Z (almost 2 years ago)
- Last Synced: 2024-10-11T12:38:43.893Z (3 months ago)
- Topics: go, reddit, redis
- Language: Go
- Homepage:
- Size: 771 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
- awesome-golang-repositories - heximage
README
# heximage
[![Go Doc](https://godoc.org/github.com/wyattjoh/heximage/lib?status.svg)](http://godoc.org/github.com/wyattjoh/heximage/lib)
[![Go Report](https://goreportcard.com/badge/github.com/wyattjoh/heximage)](https://goreportcard.com/report/github.com/wyattjoh/heximage)This serves as a mimic of the api provided during the reddit.com/r/place
experiment. It exposes a few web api's, a websocket interface, as well as a cli
interface to editing, displaying, and fetching images stored in Redis and
modified using it's [BITFIELD](https://redis.io/commands/bitfield) command.## Endpoints
- `GET /api/place/live`: websocket api
- `POST /api/place/draw`: post json with content `{"X": "1", "Y": "1", "Colour": "FFFFFFFF"}` to set a pixel's colour
- `GET /api/place/board-bitmap`: get the bit repr of the image in raw bytes
- `GET /api/place/board?w=`: get the png repr of the image, optional `w` allows you to set any width for the image to be resized to## Running
You can run the application simply by running go get:
```bash
go get github.com/wyattjoh/heximage
```And running:
```bash
$ heximage server --help
NAME:
heximage server - serves the heximage serverUSAGE:
heximage server [command options] [arguments...]OPTIONS:
--listen-addr value address for the server to listen on (default: "127.0.0.1:8080")
--allowed-cors-origin value allow one or many origins to access the api
```For an example of the application in action, visit the `example` directory.
All other commands can be explored by looking through the usage information
available via `--help` on each command and subcommand.## License
MIT