controllers

package
v0.0.0-...-0f5609b Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Login

func Login(username, password, userAgent string) (*models.Session, string, error)

func Register

func Register(username, email, password, serialCode string) (*models.User, error)

func ServeWebSocket

func ServeWebSocket(ctx *gin.Context, session *models.Session)

func ValidateSession

func ValidateSession(token string, userAgent string) bool

Types

type Message

type Message struct {
	Type    string
	Content interface{}
}

type UserInfo

type UserInfo struct {
	Username,
	Email,
	Role string
	Subscription int64
}

type WebSocket

type WebSocket struct {
	Conn    *websocket.Conn
	Session *models.Session
}

func (*WebSocket) Send

func (ws *WebSocket) Send(t string, c interface{}) error

Jump to

Keyboard shortcuts

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