Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSession ¶
func GetSession(w http.ResponseWriter, r *http.Request) *matchserver.Player
GetSession credit to https://www.sohamkamani.com/blog/2018/03/25/golang-session-authentication/
func Session ¶
func Session(w http.ResponseWriter, r *http.Request)
Session credit to https://www.sohamkamani.com/blog/2018/03/25/golang-session-authentication/
Types ¶
type CurrentMatch ¶
type CurrentMatch struct { BlackName string WhiteName string MaxTimeMs int64 BlackRemainingTimeMs int64 WhiteRemainingTimeMs int64 Board model.SerializableBoard Turn model.Color GameOver bool Result model.GameResult PreviousMove model.Move PreviousMover model.Piece BlackKing model.Piece WhiteKing model.Piece WhitePieces map[model.PieceType]uint8 BlackPieces map[model.PieceType]uint8 PositionHistory map[string]uint8 TurnsSinceCaptureOrPawnMove uint8 RequestedDraw bool RequestedDrawName string }
CurrentMatch serializable struct to bring client up to speed
type SessionResponse ¶
type SessionResponse struct { Credentials Credentials InMatch bool Match CurrentMatch }
SessionResponse serializable struct to send client's session
type TTLMap ¶
type TTLMap struct {
// contains filtered or unexported fields
}
TTLMap is a map with a TTL
func (*TTLMap) Get ¶
func (m *TTLMap) Get(k string) (v *matchserver.Player, err error)
Get gets value for key k
Click to show internal directories.
Click to hide internal directories.