Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoConnection = errors.New("websocket: no connection found for user")
Functions ¶
This section is empty.
Types ¶
type FriendStatus ¶
type FriendStatus struct { Type string `json:"type"` // Can ber either REQUEST, ACCEPTED, or REMOVED UserID string `json:"userID"` // The user ID of the friend Username string `json:"username"` // The username of the friend ProfilePictureURL string `json:"profilePictureURL"` // The profile picture URL of the friend }
type WebsocketClient ¶
type WebsocketMessage ¶
type WebsocketServer ¶
type WebsocketServer struct { Connections map[string]WebsocketClient AccessTokenSecret string DB *pgxpool.Pool }
func (*WebsocketServer) NewWebsocket ¶
func (ws *WebsocketServer) NewWebsocket() func(*fiber.Ctx) error
func (*WebsocketServer) UpdateFriendStatus ¶
func (ws *WebsocketServer) UpdateFriendStatus(recipientID string, status FriendStatus) error
func (*WebsocketServer) WebsocketUpgrade ¶
func (ws *WebsocketServer) WebsocketUpgrade(c *fiber.Ctx) error
Click to show internal directories.
Click to hide internal directories.