datastore

package
v0.0.0-...-cd77bea Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTicTacToeBoard

func CreateTicTacToeBoard(state State) *tictactoe.TicTacToe

func NewState

func NewState(db *sqlx.DB, state State) (string, error)

Types

type State

type State struct {
	StateID      string    `db:"state_id"`
	State        string    `db:"state"`
	TurnID       string    `db:"turn"`
	Mode         string    `db:"mode"`
	FirstUserID  string    `db:"first_user_id"`
	SecondUserID string    `db:"second_user_id"`
	ParentID     string    `db:"parent_state_id"`
	Created      time.Time `db:"created_at"`
}

func CreateStateFromBoard

func CreateStateFromBoard(game *tictactoe.TicTacToe, state State) *State

func GetState

func GetState(db *sqlx.DB, id string) (State, error)

func GetUserLastState

func GetUserLastState(db *sqlx.DB, id string) (State, error)

func (State) String

func (s State) String() string

Jump to

Keyboard shortcuts

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