Documentation ¶
Index ¶
- Variables
- func Auth(secret string) gin.HandlerFunc
- func ExtractSSORequest(r *http.Request) (*models.SSORequest, error)
- func GenerateToken(id string) (string, int64)
- func GetTeamFromContext(c *gin.Context) (*models.Team, error)
- func GetUserFromContext(c *gin.Context) (*models.User, error)
- func JoinRoom(user *models.User, roomSlug string) (*models.RoomMembership, error)
- func LeaveRoom(user *models.User, roomSlug string) (string, error)
- func MessagesBridgeCreate(c *gin.Context)
- func MessagesCreate(c *gin.Context)
- func MessagesIndex(c *gin.Context)
- func RoomMembershipsCreate(c *gin.Context)
- func RoomMembershipsDelete(c *gin.Context)
- func RoomsCreate(c *gin.Context)
- func RoomsDelete(c *gin.Context)
- func RoomsIndex(c *gin.Context)
- func RoomsShow(c *gin.Context)
- func RoomsTeamIndex(c *gin.Context)
- func RoomsUnread(c *gin.Context)
- func RoomsUpdate(c *gin.Context)
- func SendMessage(user *models.User, roomSlug, body, bridge string) (*models.MessageWithUser, error)
- func SessionsLoginSSO(c *gin.Context)
- func SessionsNew(c *gin.Context)
- func SetupSocketIOServer()
- func SignUpload(c *gin.Context)
- func SocketHandler(c *gin.Context)
- func SocketIOCors(c *gin.Context)
- func TeamAuth(secret string) gin.HandlerFunc
- func TeamsCreate(c *gin.Context)
- func TeamsLogin(c *gin.Context)
- func TeamsShow(c *gin.Context)
- func TeamsUpdate(c *gin.Context)
- func UsersFindOne(c *gin.Context)
- func UsersIndex(c *gin.Context)
- func UsersSearch(c *gin.Context)
- type BridgeMessageJSON
- type Form
- type LoginJSON
- type MessageJSON
- type RoomJSON
- type TeamJSON
- type UploadJSON
Constants ¶
This section is empty.
Variables ¶
var SocketioServer *socketio.Server
Functions ¶
func Auth ¶
func Auth(secret string) gin.HandlerFunc
func ExtractSSORequest ¶
func ExtractSSORequest(r *http.Request) (*models.SSORequest, error)
func GenerateToken ¶
func GetTeamFromContext ¶
GetTeamFromContext fetches the user that was set in the *gin.Context during authorization
func GetUserFromContext ¶
GetUserFromContext fetches the user that was set in the *gin.Context during authorization
func MessagesBridgeCreate ¶
func MessagesCreate ¶
func MessagesIndex ¶
func RoomMembershipsCreate ¶
func RoomMembershipsDelete ¶
func RoomsCreate ¶
func RoomsDelete ¶
func RoomsIndex ¶
func RoomsTeamIndex ¶
RoomsTeamIndex simply fetches all of the rooms that have been created for the given team.
func RoomsUnread ¶
func RoomsUpdate ¶
func SendMessage ¶
func SessionsLoginSSO ¶
func SessionsNew ¶
func SetupSocketIOServer ¶
func SetupSocketIOServer()
func SignUpload ¶
func SocketHandler ¶
func SocketIOCors ¶
Browsers complain when the allowed origin is *, and there are cookies being set, which socket.io requires.
func TeamAuth ¶
func TeamAuth(secret string) gin.HandlerFunc
TeamAuth authenticates the team, either by using the JWT as a token (e.g., when interacting with the Landline API on landline.io) or by checking the shared secret passed in a Basic Authentication header.
func TeamsCreate ¶
func TeamsLogin ¶
func TeamsUpdate ¶
func UsersFindOne ¶
func UsersIndex ¶
func UsersSearch ¶
UsersSearch looks for usernames that resemble the partialUsername in the query parameter "u"
Types ¶
type BridgeMessageJSON ¶
type MessageJSON ¶
type MessageJSON struct {
Body string `json:"body" binding:"required"`
}
type TeamJSON ¶
type TeamJSON struct { Email string `json:"email" binding:"required"` EncryptedPassword string `json:"password" binding:"required"` SSOSecret string `json:"secret" binding:"required"` SSOUrl string `json:"url" binding:"required"` Slug string `json:"name" binding:"required"` WebhookURL *string `json:"webhook_url"` }