Skip to content

My attempt at learning golang and remaking slanger at the same time

License

Notifications You must be signed in to change notification settings

AlbinoDrought/creamy-slanger

Repository files navigation

Creamy Slanger

I wanted to play with golang and thought remaking Slanger would be a fun start.

This is not currently production ready, but I'm working on it ™️

Building

go get
go build

Running

creamy-slanger does the following by default:

  • listen for both websocket and API calls on 0.0.0.0:8080
  • use the redis server at 0.0.0.0:6379, no password, database 0
  • set app key as foo
  • hide debug output

Options can be changed with ENV vars or a config file.

Configuring with ENV

Common:

CREAMY_SLANGER_APP_KEY=foo \
CREAMY_SLANGER_REDIS_ADDRESS=0.0.0.0:6379 \
./creamy-slanger

Exhaustive:

CREAMY_SLANGER_DEBUG=true \
CREAMY_SLANGER_APP_KEY=foo \
CREAMY_SLANGER_WEBSOCKET_HOST=0.0.0.0 \
CREAMY_SLANGER_WEBSOCKET_PORT=8080 \
CREAMY_SLANGER_WEBSOCKET_TIMEOUT=120 \
CREAMY_SLANGER_REDIS_ADDRESS=0.0.0.0:6379 \
CREAMY_SLANGER_REDIS_PASSWORD=foo \
CREAMY_SLANGER_REDIS_DATABASE=0 \
./creamy-slanger

Configuring with file

See config.sample.json:

{
  "debug": true,
  "app": {
    "key": "foo"
  },
  "websocket": {
    "host": "0.0.0.0",
    "port": "8080",
    "timeout": 120
  },
  "redis": {
    "address": "0.0.0.0:6379",
    "password": "",
    "database": 0
  }
}

About

My attempt at learning golang and remaking slanger at the same time

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published