clong

command module
v0.0.0-...-32bdb9f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

README

Clong

Go Report Card Build Status

A multiplayer game where players have to throw balls at targets from their smartphones.

  1. Open /screen on any big screen. This is where the game runs. The game should begin to spawn targets.
  2. Open / on any touch device and swipe forward to launch balls at the targets. Many players can play at the same time.
  3. Open /scoreboard to get a list of high scores (which updates live).

Resetting Scores

  1. Run the following command to reset the scoreboard (replacing PASSWORD with your actual admin password):
curl -X DELETE localhost:8080/api/scores -u 'admin:PASSWORD'

Build and Run Locally

  1. Run make
  2. Execute the created binary and visit http://localhost:8080

Run Tests

  1. Run make test

Build Container Image

The image is also available on Docker Hub.

  1. Run make build-docker

Run on Kubernetes

  1. Create a namespace and target it.
  2. Define a USERNAME and a PASSWORD for logging in.
  3. Define a DB_USERNAME and a DB_PASSWORD for clong to access the DB with.
  4. Create a secret called clong-credentials as follows:
kubectl create secret generic clong-credentials --from-literal=adminPassword="${PASSWORD}" --from-literal=dbUsername="${DB_USERNAME}" --from-literal=dbPassword="${DB_PASSWORD}"
  1. Insert your host instead of xxx in deployments/k8s/ing-clong.yml
  2. Apply the deployment as follows:
kubectl apply -f deployments/k8s

Run on Fly

  1. Run fly launch --config deployments/fly/fly.toml

Run on Cloud Foundry

  1. Create an SQL database service
  2. Modify deployments/cf/* to your liking
  3. Run make deploy-cf

Documentation

Overview

Command clong is a simple game that allows controller- and screen devices to connect to each other. The goal of the game is to hit targets on the screen by flicking balls at them from the controller.

Directories

Path Synopsis
internal
clong/mysql
Package mysql allows to interact with a MySQL database.
Package mysql allows to interact with a MySQL database.
clong/pg
Package pg allows to interact with a PostgreSQL database.
Package pg allows to interact with a PostgreSQL database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL