handlers

package
v0.0.0-...-442dd3c Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSession

func DeleteSession(w http.ResponseWriter, r *http.Request)

DeleteSession removes a completed session

func InitRoutes

func InitRoutes(db *sessions.Database) *chi.Mux

InitRoutes exports the router

func PlayAI

func PlayAI(w http.ResponseWriter, r *http.Request)

PlayAI handler for returning first move from AI

func PlayHuman

func PlayHuman(w http.ResponseWriter, r *http.Request)

PlayHuman handler for returning moves from human

func StartAI

func StartAI(w http.ResponseWriter, r *http.Request)

StartAI starts session for AI vs AI

func StartHuman

func StartHuman(w http.ResponseWriter, r *http.Request)

StartHuman starts session for human player vs AI

func StartHuman2

func StartHuman2(w http.ResponseWriter, r *http.Request)

StartHuman2 starts session for human player vs human player

func StartRevHuman

func StartRevHuman(w http.ResponseWriter, r *http.Request)

StartRevHuman starts session for AI vs human player

Types

type PlayResponse

type PlayResponse struct {
	Move       int       `json:"move"`
	Symbol     string    `json:"symbol`
	Board      [9]string `json:"board"`
	RecoMove   int       `json:"recoMove"`
	RecoSymbol string    `json:"recoSymbol`
}

PlayResponse object for sending move responses

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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