handlers

package
v0.0.0-...-e00079b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2015 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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 GenerateToken(id string) (string, int64)

func GetTeamFromContext

func GetTeamFromContext(c *gin.Context) (*models.Team, error)

GetTeamFromContext fetches the user that was set in the *gin.Context during authorization

func GetUserFromContext

func GetUserFromContext(c *gin.Context) (*models.User, error)

GetUserFromContext fetches the user that was set in the *gin.Context during authorization

func JoinRoom

func JoinRoom(user *models.User, roomSlug string) (*models.RoomMembership, error)

func LeaveRoom

func LeaveRoom(user *models.User, roomSlug string) (string, error)

Removes the user as a member from the room, and returns the room's id.

func MessagesBridgeCreate

func MessagesBridgeCreate(c *gin.Context)

func MessagesCreate

func MessagesCreate(c *gin.Context)

func MessagesIndex

func MessagesIndex(c *gin.Context)

func RoomMembershipsCreate

func RoomMembershipsCreate(c *gin.Context)

func RoomMembershipsDelete

func RoomMembershipsDelete(c *gin.Context)

func RoomsCreate

func RoomsCreate(c *gin.Context)

func RoomsDelete

func RoomsDelete(c *gin.Context)

func RoomsIndex

func RoomsIndex(c *gin.Context)

func RoomsShow

func RoomsShow(c *gin.Context)

func RoomsTeamIndex

func RoomsTeamIndex(c *gin.Context)

RoomsTeamIndex simply fetches all of the rooms that have been created for the given team.

func RoomsUnread

func RoomsUnread(c *gin.Context)

func RoomsUpdate

func RoomsUpdate(c *gin.Context)

func SendMessage

func SendMessage(user *models.User, roomSlug, body, bridge string) (*models.MessageWithUser, error)

func SessionsLoginSSO

func SessionsLoginSSO(c *gin.Context)

func SessionsNew

func SessionsNew(c *gin.Context)

func SetupSocketIOServer

func SetupSocketIOServer()

func SignUpload

func SignUpload(c *gin.Context)

func SocketHandler

func SocketHandler(c *gin.Context)

func SocketIOCors

func SocketIOCors(c *gin.Context)

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 TeamsCreate(c *gin.Context)

func TeamsLogin

func TeamsLogin(c *gin.Context)

func TeamsShow

func TeamsShow(c *gin.Context)

func TeamsUpdate

func TeamsUpdate(c *gin.Context)

func UsersFindOne

func UsersFindOne(c *gin.Context)

func UsersIndex

func UsersIndex(c *gin.Context)

func UsersSearch

func UsersSearch(c *gin.Context)

UsersSearch looks for usernames that resemble the partialUsername in the query parameter "u"

Types

type BridgeMessageJSON

type BridgeMessageJSON struct {
	Body   string `json:"body" binding:"required"`
	UserID string `json:"user_id" binding:"required"`
}

type Form

type Form struct {
	Key            string `json:"key"`
	ACL            string `json:"acl"`
	AWSAccessKeyId string `json:"AWSAccessKeyId"`
	CacheControl   string `json:"Cache-Control"`
	ContentType    string `json:"Content-Type"`
	Policy         string `json:"policy"`
	Signature      string `json:"signature"`
}

type LoginJSON

type LoginJSON struct {
	EncryptedPassword string `json:"password" binding:"required"`
	Slug              string `json:"name" binding:"required"`
}

type MessageJSON

type MessageJSON struct {
	Body string `json:"body" binding:"required"`
}

type RoomJSON

type RoomJSON struct {
	Slug  string `json:"slug" binding:"required"`
	Topic string `json:"topic" 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"`
}

type UploadJSON

type UploadJSON struct {
	Name        string `json:"name" binding:"required"`
	Size        int    `json:"size" binding:"required"`
	ContentType string `json:"content_type" binding:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL