Documentation ¶
Overview ¶
Package websockets manages active websocket connections and messages received from and sent to them
Index ¶
- func CreatePost(op uint64, board, ip string, needCaptcha bool, req ReplyCreationRequest) (post db.Post, msg []byte, err error)
- func CreateThread(req ThreadCreationRequest, ip string) (post db.Post, err error)
- func Handler(w http.ResponseWriter, r *http.Request)
- type Client
- type ImageRequest
- type ReplyCreationRequest
- type ThreadCreationRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePost ¶
func CreatePost( op uint64, board, ip string, needCaptcha bool, req ReplyCreationRequest, ) ( post db.Post, msg []byte, err error, )
CreatePost creates a new post and writes it to the database. open specifies, if the post should stay open after creation.
func CreateThread ¶
func CreateThread(req ThreadCreationRequest, ip string) ( post db.Post, err error, )
CreateThread creates a new tread and writes it to the database. open specifies, if the thread OP should stay open after creation.
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 ImageRequest ¶
ImageRequest contains data for allocating an image
type ReplyCreationRequest ¶
type ReplyCreationRequest struct {
Sage, Open bool
Image ImageRequest
auth.SessionCreds
auth.Captcha
Name, Password, Body string
}
ReplyCreationRequest contains common fields for both thread and reply creation
type ThreadCreationRequest ¶
type ThreadCreationRequest struct { NonLive bool ReplyCreationRequest Subject, Board string }
ThreadCreationRequest contains data for creating a new thread
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package feeds manages client synchronization to update feeds and provides a thread-safe interface for propagating messages to them and reassigning feeds to and from clients.
|
Package feeds manages client synchronization to update feeds and provides a thread-safe interface for propagating messages to them and reassigning feeds to and from clients. |