Documentation ¶
Overview ¶
Package gamegrp provides the handlers for game play.
Index ¶
- type Handlers
- func (h *Handlers) Configuration(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handlers) Connect(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handlers) CreateBet(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handlers) Events(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handlers) QueryBet(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handlers) QueryBetByID(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handlers) Test(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handlers) USD2Wei(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- func (h *Handlers) UpdateBet(ctx context.Context, w http.ResponseWriter, r *http.Request) error
- type NewBet
- type NewPlayer
- type Status
- type UpdateBet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handlers ¶
type Handlers struct { Bet bet.Core Converter *currency.Converter Book *book.Book Log *zap.SugaredLogger WS websocket.Upgrader Evts *events.Events Auth *auth.Auth BankTimeout time.Duration ConnectTimeout time.Duration // contains filtered or unexported fields }
Handlers manages the set of user endpoints.
func (*Handlers) Configuration ¶
Configuration returns the basic configuration the front end needs to use.
func (*Handlers) QueryBetByID ¶
QueryBetByID returns a bet by its ID.
type NewBet ¶
type NewBet struct { Description string `json:"description"` Terms string `json:"terms"` Amount int `json:"amount"` ModeratorAddress string `json:"moderatorAddress" validate:"required"` Players []NewPlayer `json:"players" validate:"required"` DateExpired uint `json:"dateExpired" validate:"required"` }
NewBet is what we require from clients when adding a Bet.
type NewPlayer ¶
NewPlayer represents the connection between a new Bet and an Account that is in a player role.
type UpdateBet ¶
type UpdateBet struct { Description *string `json:"description"` Terms *string `json:"terms"` Amount *int `json:"amount"` ModeratorAddress *string `json:"moderatorAddress" validate:"required"` DateExpired *uint `json:"dateExpired" validate:"required"` }
UpdateBet is what we require from clients when updating a Bet.
Click to show internal directories.
Click to hide internal directories.