Documentation ¶
Overview ¶
Package websockets implements functionality related to the API websockets.
Index ¶
- Constants
- func Identify(c *conn, message incomingMessage)
- func SetRestrictedVisibility(c *conn, message incomingMessage)
- func Start(r *redis.Client, _db *sqlx.DB) error
- func SubscribeMultiMatches(c *conn, message incomingMessage)
- func SubscribeScores(c *conn, message incomingMessage)
- func WebsocketV1Entry(ctx *fasthttp.RequestCtx)
- type Message
Constants ¶
View Source
const ( TypeConnected = "connected" TypeInvalidMessage = "invalid_message_type" TypeUnexpectedError = "unexpected_error" TypeNotFound = "not_found" TypeSubscribedToScores = "subscribed_to_scores" TypeNewScore = "new_score" TypeSubscribedToMultiMatches = "subscribed_mp_complete_match" TypeNewMatch = "new_completed_match" TypeIdentified = "identified" TypeRestrictedVisibilitySet = "restricted_visibility_set" TypePong = "pong" )
Server Message Types
View Source
const ( TypeSubscribeScores = "subscribe_scores" TypeSubscribeMultiMatches = "subscribe_mp_complete_match" TypeIdentify = "identify" TypeSetRestrictedVisibility = "set_restricted_visibility" TypePing = "ping" )
Client Message Types
Variables ¶
This section is empty.
Functions ¶
func Identify ¶
func Identify(c *conn, message incomingMessage)
Identify sets the identity of the user.
func SetRestrictedVisibility ¶
func SetRestrictedVisibility(c *conn, message incomingMessage)
SetRestrictedVisibility sets whether the information of restricted users can be seen.
func SubscribeMultiMatches ¶
func SubscribeMultiMatches(c *conn, message incomingMessage)
SubscribeMultiMatches subscribes to receiving information from completed games in multiplayer matches.
func SubscribeScores ¶
func SubscribeScores(c *conn, message incomingMessage)
SubscribeScores subscribes a connection to score updates.
func WebsocketV1Entry ¶
func WebsocketV1Entry(ctx *fasthttp.RequestCtx)
WebsocketV1Entry upgrades a connection to a websocket.
Types ¶
Click to show internal directories.
Click to hide internal directories.