go-keno

command module
v0.0.0-...-4cc0970 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: MIT Imports: 2 Imported by: 0

README

go-keno

Keno impl in Go, for displaying on a TUI

Todo:

  • Finish rest routes
  • do the DB queries
  • ???
  • profit

Placing a Pick Request:

POST /api/v1/picks

{ "picks_per_game": 10, "picks": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "price_per_game": 1, "number_games": 5 }

Response:

{ "card_id": 12, "selection": "picks": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "start_game_num": 2, "last_game_num": 6 }

200 Ok 400 Invalid Picks

Checking your Card GET /api/v1/check/:card_id

Response:

{ "amount": 10 // How much you won }

200 Games have finished 400 Games haven't finished 404 Invalid Card ID

Other Notes Simulating the game can be just via stdout logs, unless you want to play with websockets and make a webapp graphic.

I'm going to be using gin (https://gin-gonic.com/) for the API handling. And using sqlite as a small DB, might use gorm https://gorm.io/ as an ORM or just do sql calls directly.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
db

Jump to

Keyboard shortcuts

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