Documentation ¶
Overview ¶
Package websockets manages active websocket connections and messages received from and sent to them
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePost ¶
CreatePost creates a new post and writes it to the database.
func CreateThread ¶
func CreateThread(req ThreadCreationRequest) ( post db.Post, err error, )
CreateThread creates a new thread and writes it to the database.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client stores and manages a websocket-connected remote client and its interaction with the server and database
func (*Client) Close ¶
Close closes a websocket connection with the provided status code and optional reason
func (*Client) IP ¶
IP returns the IP of the client connection. Thread-safe, as the IP is never written to after assignment.
type FilesRequest ¶
type FilesRequest struct {
Tokens []string
}
type PostCreationRequest ¶
type PostCreationRequest struct { FilesRequest FilesRequest Board string Ip string UniqueID string Body string Token string Sign string ShowBadge bool ShowName bool Session *auth.Session }
PostCreationRequest contains common fields for both thread and post creation.
type ThreadCreationRequest ¶
type ThreadCreationRequest struct { PostCreationRequest Subject string }
ThreadCreationRequest contains data for creating a new thread.