Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) CreateGame() (*domain.Game, error)
- func (c *Client) Emit(ev Event)
- func (c *Client) JoinGame(game *domain.Game)
- func (c *Client) MustCreateGame() *domain.Game
- func (c *Client) On(event string, f HandlerFunc)
- func (c *Client) Setup(toRecord map[string]struct{})
- type Event
- type Framework
- func (fw *Framework) AssertSession(t *testing.T)
- func (fw *Framework) MustNewClient(username string) *Client
- func (fw *Framework) NewClient(username string) (*Client, error)
- func (fw *Framework) RecordEvents(events ...string)
- func (fw *Framework) RegisterUser(username string) (string, error)
- func (fw *Framework) SetupDB() error
- func (fw *Framework) Step(name string, f func(), waitNResponses uint32)
- func (fw *Framework) TestMain(m *testing.M)
- func (fw *Framework) UseShortener(event string, sh session.Shortener)
- type H
- type HandlerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var AllEvents = map[string]struct{}{ event.ErrorEvent: {}, event.AuthEvent: {}, event.AuthedEvent: {}, event.JoinGameEvent: {}, event.GameEvent: {}, event.PlayerJoinedEvent: {}, event.PlayerLeftEvent: {}, event.SetRouteEvent: {}, event.SettedRouteEvent: {}, event.StartGameEvent: {}, event.LocationUpdateEvent: {}, event.LocationUpdatedEvent: {}, event.LeaveGameEvent: {}, event.BroadcastEvent: {}, event.BroadcastedEvent: {}, event.PollEvent: {}, event.PauseEvent: {}, event.UnpauseEvent: {}, event.TaskCompleteEvent: {}, event.TaskApproveEvent: {}, event.TaskRejectEvent: {}, event.ScoreUpdatedEvent: {}, event.PlayerCatchEvent: {}, event.PlayerCatchApproveEvent: {}, event.PlayerCatchRejectEvent: {}, event.PlayerRoleUpdatedEvent: {}, event.FinishGameEvent: {}, event.FinishGameApproveEvent: {}, event.FinishGameRejectEvent: {}, event.FinishedGameEvent: {}, }
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
User *domain.User
Log *slog.Logger
Token string
FW *Framework
Cli *socketio.Client
}
func (*Client) MustCreateGame ¶
func (*Client) On ¶
func (c *Client) On(event string, f HandlerFunc)
type Framework ¶
type Framework struct {
Cfg *config.Config
DB *pgxpool.Pool
Log *slog.Logger
HTTPCli *http.Client
APIHost string
SIOHost string
Session *session.Session
}
func (*Framework) AssertSession ¶
func (*Framework) MustNewClient ¶
func (*Framework) RecordEvents ¶
type HandlerFunc ¶
Click to show internal directories.
Click to hide internal directories.