Documentation ¶
Index ¶
- type Connection
- func (db *Connection) GetAllUsers() (*UsersDB, error)
- func (db *Connection) GetUserFriends(userId string) (*UserFriendsDB, error)
- func (db *Connection) GetUserGameState(userId string) (*GameStateDB, error)
- func (db *Connection) InsertUser(userId, name string) error
- func (db *Connection) InsertUserGameState(gsu GameStateUpdate) error
- func (db *Connection) UpdateUserFriends(userId string, friends []string) error
- func (db *Connection) UpdateUserGameState(gsu GameStateUpdate) (int, error)
- type Friend
- type GameState
- type GameStateDB
- type GameStateUpdate
- type Spec
- type User
- type UserCreatePayload
- type UserFriends
- type UserFriendsDB
- type UserFriendsPayload
- type UserIDParam
- type Users
- type UsersDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
func (*Connection) GetAllUsers ¶
func (db *Connection) GetAllUsers() (*UsersDB, error)
func (*Connection) GetUserFriends ¶
func (db *Connection) GetUserFriends(userId string) (*UserFriendsDB, error)
func (*Connection) GetUserGameState ¶
func (db *Connection) GetUserGameState(userId string) (*GameStateDB, error)
func (*Connection) InsertUser ¶
func (db *Connection) InsertUser(userId, name string) error
func (*Connection) InsertUserGameState ¶
func (db *Connection) InsertUserGameState(gsu GameStateUpdate) error
func (*Connection) UpdateUserFriends ¶
func (db *Connection) UpdateUserFriends(userId string, friends []string) error
func (*Connection) UpdateUserGameState ¶
func (db *Connection) UpdateUserGameState(gsu GameStateUpdate) (int, error)
type GameStateDB ¶
type GameStateUpdate ¶
type Spec ¶
type Spec interface { //GetAllUsers() error InsertUser(userId, name string) error InsertUserGameState(gsu GameStateUpdate) error GetUserGameState(userId string) (*GameStateDB, error) UpdateUserGameState(gsu GameStateUpdate) (int, error) UpdateUserFriends(userId string, friends []string) error GetUserFriends(userId string) (*UserFriendsDB, error) GetAllUsers() (*UsersDB, error) }
func NewDatabaseConnection ¶
func NewDatabaseConnection() Spec
type UserCreatePayload ¶
type UserCreatePayload struct {
Name string `json:"name" binding:"required"`
}
type UserFriends ¶
type UserFriends struct {
Friends []Friend `json:"friends"`
}
type UserFriendsDB ¶
type UserFriendsDB struct {
Friends []Friend
}
type UserFriendsPayload ¶
type UserFriendsPayload struct {
Friends []string `json:"friends" binding:"required"`
}
type UserIDParam ¶
type UserIDParam struct {
UserID string `uri:"user_id" binding:"required,uuid"`
}
Click to show internal directories.
Click to hide internal directories.