Versions in this module Expand all Collapse all v0 v0.1.10 Oct 5, 2021 v0.1.9 Oct 5, 2021 Changes in this version + func Broadcast(event events.OutboundEvent) error + func DisconnectUser(userID string) + func GetChatHistory() []events.UserMessageEvent + func GetChatModerationHistory() []events.UserMessageEvent + func HandleClientConnection(w http.ResponseWriter, r *http.Request) + func SaveUserMessage(event events.UserMessageEvent) + func SendAllWelcomeMessage() + func SendSystemAction(text string, ephemeral bool) error + func SendSystemMessage(text string, ephemeral bool) error + func SendSystemMessageToClient(clientID uint, text string) + func SetMessageVisibilityForUserID(userID string, visible bool) error + func SetMessagesVisibility(messageIDs []string, visibility bool) error + func Start(getStatusFunc func() models.Status) error + type Client struct + ConnectedAt time.Time + Geo *geoip.GeoDetails + MessageCount int + User *user.User + UserAgent string + func FindClientByID(clientID uint) (*Client, bool) + func GetClients() []*Client + func GetClientsForUser(userID string) ([]*Client, error) + type Server struct + func NewChat() *Server + func (s *Server) Addclient(conn *websocket.Conn, user *user.User, accessToken string, userAgent string, ...) *Client + func (s *Server) Broadcast(payload events.EventPayload) error + func (s *Server) ClientClosed(c *Client) + func (s *Server) DisconnectUser(userID string) + func (s *Server) HandleClientConnection(w http.ResponseWriter, r *http.Request) + func (s *Server) Run() + func (s *Server) Send(payload events.EventPayload, client *Client)