snakebot

package module
v1.0.0-rc.5 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 1 Imported by: 0

README

Snake-Bot

Start Snake-Server
docker run --rm -d -it -p 8080:8080 ivan1993spb/snake-server:latest --enable-web
# Create a game
curl -X POST -d limit=15 -d width=100 -d height=60 -d enable_walls=true localhost:8080/api/games
Start Snake-Bot
# Generate secret
openssl rand -base64 -out secret.base64 32
snake-bot -jwt-secret secret.base64 -address :9090
Generate JWT
# Expire in 1 day
exp=`date -d "+1 days" +%s`

Generate JWT here: https://jwt.io/#debugger-io

https://www.unixtimestamp.com/

token=...
header="Authorization: Bearer ${token}"
Make API calls
curl -X GET -H "$header" localhost:9090/api/bots
curl -X POST -H "$header" -d game=1 -d bots=1 localhost:9090/api/bots
curl -X GET -H "$header" localhost:9090/api/bots
How it works

wiki: Dijkstra's algorithm

Documentation

Index

Constants

This section is empty.

Variables

View Source
var OpenAPISpec string

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
internal
app
bot
connect/connectfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
core/corefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
http/handlers/handlersfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
utils/utilsfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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