Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIClient ¶
type APIClient interface { GetFranchises(context.Context, *client.GetFranchisesRequest) (*client.GetFranchisesResponse, error) CreateFranchise(context.Context, *client.CreateFranchiseRequest) (*client.CreateFranchiseResponse, error) GetGames(context.Context, *client.GetGamesRequest) (*client.GetGamesResponse, error) CreateGame(context.Context, *client.CreateGameRequest) (*client.CreateGameResponse, error) UpdateGameProgress(context.Context, *client.UpdateGameProgressRequest) error DeleteUserGame(context.Context, *client.DeleteUserGameRequest) error LoginUser(context.Context, *client.LoginUserRequest) (*client.UserLoginResponse, error) CreateUser(context.Context, *client.CreateUserRequest) (*client.CreateUserResponse, error) GetUser(context.Context, *client.GetUserRequest) (*client.GetUserResponse, error) LogoutUser(context.Context, *client.LogoutUserRequest) error GetStatuses(ctx context.Context, request *client.GetStatusesRequest) (*client.GetStatusesResponse, error) }
APIClient is the interface that interacts with the API
type Renderer ¶
type Renderer interface {
Render(w http.ResponseWriter, r *http.Request, d TemplateData, p string) error
}
Renderer is the interface that will be used to interact with the part of the program that is responsible for rendering the web pages
type Server ¶
type Server struct { Log *logrus.Logger Session *sessions.Session Client APIClient Renderer Renderer }
Server is the struct that holds all the dependencies needed to run the application
type TemplateData ¶
type TemplateData struct { Game *client.Game User *client.User Games []TemplateGame Statuses []client.Status Franchises []*client.Franchise SelectedFranchiseID string Error string Flash string }
TemplateData is the struct that holds all the data that can be passed to the template renderer to render
type TemplateGame ¶
type TemplateGame struct { ID string Name string FranchiseID string FranchiseName string Status client.Status Progress *client.GameProgress }
TemplateGame is the struct that holds all the game info that is passed to the template renderer to render
Click to show internal directories.
Click to hide internal directories.