Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// XAuthToken is the name of the header used to pass the authorization token
XAuthToken = "x-auth-token"
)
Functions ¶
This section is empty.
Types ¶
type ChangeGameStatusRequest ¶
type ChangeGameStatusRequest struct { Status Status `json:"status,omitempty"` Progress *GameProgress `json:"progress,omitempty"` }
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error,omitempty"`
}
ErrorResponse is the generic error response returned from the API, when an error of any kind occurred.
type FranchisesResponse ¶
type FranchisesResponse struct {
Franchises []*Franchise `json:"franchises"`
}
type Game ¶
type Game struct { ID string `json:"id"` Name string `json:"name,omitempty"` Franchise string `json:"franchise,omitempty"` FranchiseID string `json:"franchiseId,omitempty"` Status Status `json:"status,omitempty"` Progress *GameProgress `json:"progress,omitempty"` UserID string `json:"-"` }
Game is the representation of a game in the database.
type GameProgress ¶
type GamesResponse ¶
type GamesResponse struct {
Games []*Game `json:"games"`
}
type Status ¶
type Status string
Status is the type that represents the status of a game
var ( // StatusTODO is the To Do status of a game StatusTODO Status = "To Do" // StatusInProgress is the In progress status of a game StatusInProgress Status = "In Progress" // StatusDone is the Done status of the game StatusDone Status = "Done" // AllStatuses is collection of all statuses AllStatuses = []Status{ StatusTODO, StatusInProgress, StatusDone, } )
type StatusesResponse ¶
type StatusesResponse struct {
Statuses []Status `json:"statuses,omitempty"`
}
StatusesResponse is the response that is returned from the Statuses API
type User ¶
type User struct { ID string `json:"id,omitempty"` Username string `json:"username,omitempty"` Email string `json:"email,omitempty"` Password string `json:"password,omitempty"` HashedPassword []byte `json:"-"` }
User is the representation of a user in the database.
type UserGameRequest ¶
type UserGameRequest struct { Game *Game `json:"game"` Progress *GameProgress `json:"progress,omitempty"` }
type UserGameResponse ¶
type UserGamesResponse ¶
type UserGamesResponse struct {
Games []*Game `json:"games"`
}
type UserLoginResponse ¶
type UserLoginResponse struct {
Token string `json:"token"`
}
UserLoginResponse is the response that is returned when a user is logged in.
type UserResponse ¶
type UserResponse struct {
User *User `json:"user"`
}
UserResponse is the response that is returned from the GET /users API
Click to show internal directories.
Click to hide internal directories.