Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var HubConstruct = hub{ // contains filtered or unexported fields }
View Source
var Upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
}
Functions ¶
Types ¶
type CookieDetail ¶
type CookieDetail struct { Email string Collection string CookieName string Path string Data CookieData }
func (*CookieDetail) CheckCookie ¶
func (b *CookieDetail) CheckCookie(r *http.Request) error
func (CookieDetail) GenerateCookie ¶
func (b CookieDetail) GenerateCookie(w http.ResponseWriter) (string, error)
GenerateCookie generates a token and sends to frontend. Generated tokens are to be stored by frontend and verified for every request.
type Message ¶
type Message struct { RoomID string `bson:"roomID" json:"roomID,omitempty"` Message string `bson:"message" json:"message,omitempty"` UserID string `bson:"userID" json:"userID,omitempty"` Name string `bson:"name" json:"name,omitempty"` Time string `bson:"time" json:"time,omitempty"` Type string `bson:"type" json:"type,omitempty"` Size string `bson:"size,omitempty" json:"size,omitempty"` Hash string `bson:"hash,omitempty" json:"hash,omitempty"` Index int `bson:"index" json:"index,omitempty"` MessageType string `bson:"-" json:"msgType,omitempty"` }
Message struct defines user message contents, size and hash is defined if user is sending files. Index is used to track message count as to Rooms messages, this should help with partitioning if we are to retrieve message of a particular count.
type User ¶
type User struct { Email string `bson:"_id" json:"userID"` Name string `bson:"name" json:"name"` DOB string `bson:"age" json:"age"` Class string `bson:"class" json:"class"` // ID should either be users matric or leading email stripping @.... Password []byte `bson:"password" json:"-"` PasswordInString string `bson:"-" json:"password"` RoomsJoined []roomsJoined `bson:"roomsJoined" json:"roomsJoined"` JoinRequest []joinRequest `bson:"joinRequest" json:"joinRequest"` UUID string `bson:"loginUUID" json:"uuid"` }
func (User) CreateUserLogin ¶
Click to show internal directories.
Click to hide internal directories.