Documentation ¶
Index ¶
- Constants
- func UserInterfaceEquals(group1 []db.User, group2 []db.User) bool
- type Action
- type Auth
- type ClientData
- type FullData
- type ServerActionsController
- type ServerStateController
- func (serverState ServerStateController) AddAvatarToUser(c *gin.Context)
- func (serverState ServerStateController) ChangePassword(c *gin.Context)
- func (serverState ServerStateController) CreateChatroom(c *gin.Context)
- func (serverState ServerStateController) CreateUser(c *gin.Context)
- func (serverState ServerStateController) GetAvatar(c *gin.Context)
- func (serverState ServerStateController) GetUsernameAndPasswordFromBase64(input string) (Auth, error)
- func (serverState *ServerStateController) UpdateHandler(wsConn *websocket.Conn, state *State)
- func (serverState ServerStateController) ValidateUser(c *gin.Context) bool
- func (serverState ServerStateController) VerifyUser(c *gin.Context)
- func (serverState ServerStateController) WebSocket(c *gin.Context)
- type State
- type UpdateAvatars
Constants ¶
View Source
const (
IMAGE_FOLDER_PATH = "./src/res/images/"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientData ¶
type ClientData struct { Message string `json:"message"` Chatroom string `json:"chatroom"` Username string `json:"username"` Password string `json:"password"` Users []string `json:"users"` Action string `json:"action"` LastMessageId int64 `json:"lastMessageId"` Properties map[string]interface{} `json:"properties"` }
type ServerActionsController ¶
func CreateServerActionsController ¶
func CreateServerActionsController() *ServerActionsController
func (*ServerActionsController) AddDeleteAction ¶
func (sac *ServerActionsController) AddDeleteAction(messageId int64)
func (ServerActionsController) GetNewestAction ¶
func (sac ServerActionsController) GetNewestAction() (Action, error)
type ServerStateController ¶
type ServerStateController struct {
// contains filtered or unexported fields
}
ServerStateController controls the database for each route
func CreateServerStateController ¶
func CreateServerStateController() ServerStateController
CreateServerStateController will create a database connection and return a ServerStateController
func (ServerStateController) AddAvatarToUser ¶
func (serverState ServerStateController) AddAvatarToUser(c *gin.Context)
Adds an avatar image to the image folder and updates the location in the database
func (ServerStateController) ChangePassword ¶
func (serverState ServerStateController) ChangePassword(c *gin.Context)
func (ServerStateController) CreateChatroom ¶
func (serverState ServerStateController) CreateChatroom(c *gin.Context)
func (ServerStateController) CreateUser ¶
func (serverState ServerStateController) CreateUser(c *gin.Context)
func (ServerStateController) GetAvatar ¶
func (serverState ServerStateController) GetAvatar(c *gin.Context)
func (ServerStateController) GetUsernameAndPasswordFromBase64 ¶
func (serverState ServerStateController) GetUsernameAndPasswordFromBase64(input string) (Auth, error)
Used to get the username and password from basic auth
func (*ServerStateController) UpdateHandler ¶
func (serverState *ServerStateController) UpdateHandler(wsConn *websocket.Conn, state *State)
func (ServerStateController) ValidateUser ¶
func (serverState ServerStateController) ValidateUser(c *gin.Context) bool
validates the context headers basic auth against the usernames and passwords in the database
func (ServerStateController) VerifyUser ¶
func (serverState ServerStateController) VerifyUser(c *gin.Context)
func (ServerStateController) WebSocket ¶
func (serverState ServerStateController) WebSocket(c *gin.Context)
type UpdateAvatars ¶
type UpdateAvatars struct {
UpdateAvatars string `json:"updateAvatars"`
}
Click to show internal directories.
Click to hide internal directories.