handlers

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

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

Go to latest
Published: Jan 4, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package handlers provides HTTP handlers

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorCode

type ErrorCode string

ErrorCode represents different error codes returned by the API

const (
	ErrInternal     ErrorCode = "internal-error"
	ErrUnauthorized ErrorCode = "unauthorized"
)

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler provides an interface to handle different HTTP request

func New

func New(store *store.Store, config *config.Config, logger *log.Logger) *Handler

New returns a new handler with all required services injected

func (*Handler) AuthCode

func (h *Handler) AuthCode(c echo.Context) error

AuthCode validates the 2FA code

func (*Handler) AuthLogin

func (h *Handler) AuthLogin(c echo.Context) error

AuthLogin logs a user in

func (*Handler) AuthRefresh

func (h *Handler) AuthRefresh(c echo.Context) error

AuthRefresh refreshes the JWT token

func (*Handler) AuthRegister

func (h *Handler) AuthRegister(c echo.Context) error

AuthRegister registers a new user

func (*Handler) AuthRegisterCode

func (h *Handler) AuthRegisterCode(c echo.Context) error

AuthRegisterCode enables 2FA for a user

func (*Handler) CreateDirect

func (h *Handler) CreateDirect(c echo.Context) error

CreateDirect creates a direct room

func (*Handler) CreateInvite

func (h *Handler) CreateInvite(c echo.Context) error

CreateInvite creates an invite link and returns it

func (*Handler) CreateRoom

func (h *Handler) CreateRoom(c echo.Context) error

CreateRoom handles incoming requests to create a room

func (*Handler) CreateServer

func (h *Handler) CreateServer(c echo.Context) error

CreateServer handles incoming requests

func (*Handler) DeleteDirect

func (h *Handler) DeleteDirect(c echo.Context) error

DeleteDirect deletes a direct room identified by it's name

func (*Handler) DeleteInvite

func (h *Handler) DeleteInvite(c echo.Context) error

DeleteInvite deletes an invite link indentified by it's name

func (*Handler) DeleteRoom

func (h *Handler) DeleteRoom(c echo.Context) error

DeleteRoom handles incoming requests to delete one room

func (*Handler) DeleteServer

func (h *Handler) DeleteServer(c echo.Context) error

DeleteServer deletes a server identified by it's hash

func (*Handler) ForwardSDP

func (h *Handler) ForwardSDP(c echo.Context) error

func (*Handler) GetAvatar

func (h *Handler) GetAvatar(c echo.Context) error

func (*Handler) GetDirect

func (h *Handler) GetDirect(c echo.Context) error

GetDirect returns a direct room identified by it's name

func (*Handler) GetImage

func (h *Handler) GetImage(c echo.Context) error

GetImage handles image requests

func (*Handler) GetInvite

func (h *Handler) GetInvite(c echo.Context) error

GetInvite handles the invite when a user enters an invite link

func (*Handler) GetKey

func (h *Handler) GetKey(c echo.Context) error

GetKey returns the public key of a given user

func (*Handler) GetMessagingChannel

func (h *Handler) GetMessagingChannel(c echo.Context) error

GetMessagingChannel opens a websocket used for messaging

func (*Handler) GetMessagingToken

func (h *Handler) GetMessagingToken(c echo.Context) error

GetMessagingToken returns an auth token to subscribe to the messaging websocket

func (*Handler) GetProfile

func (h *Handler) GetProfile(c echo.Context) error

GetProfile returns the public profile information of a given user

func (*Handler) GetRoom

func (h *Handler) GetRoom(c echo.Context) error

GetRoom handles incoming requests to get one room

func (*Handler) GetRooms

func (h *Handler) GetRooms(c echo.Context) error

GetRooms handles incoming requests to get multiple rooms

func (*Handler) GetServer

func (h *Handler) GetServer(c echo.Context) error

GetServer returns a server identified by it's hash

func (*Handler) GetServers

func (h *Handler) GetServers(c echo.Context) error

GetServers returns all servers

func (*Handler) GetUserServers

func (h *Handler) GetUserServers(c echo.Context) error

GetUserServers returns all servers the user is a member of

func (*Handler) GetVideo

func (h *Handler) GetVideo(c echo.Context) error

GetVideo handles video requests

func (*Handler) JoinCall

func (h *Handler) JoinCall(c echo.Context) error

func (*Handler) NewCall

func (h *Handler) NewCall(c echo.Context) error

NewCall initiates a new call

func (*Handler) Ping

func (h *Handler) Ping(c echo.Context) error

func (*Handler) PutUserServer

func (h *Handler) PutUserServer(c echo.Context) error

PutUserServer adds one new server to the users list of servers he is a member of

func (*Handler) RunHubs

func (h *Handler) RunHubs()

RunHubs runs the different broadcasting hubs

func (*Handler) UpdateAvatar

func (h *Handler) UpdateAvatar(c echo.Context) error

func (*Handler) UpdateDirect

func (h *Handler) UpdateDirect(c echo.Context) error

UpdateDirect updates a direct room

func (*Handler) UpdateRoom

func (h *Handler) UpdateRoom(c echo.Context) error

UpdateRoom handles incoming requests to update one room

func (*Handler) UpdateServer

func (h *Handler) UpdateServer(c echo.Context) error

UpdateServer updates a server

type Map

type Map map[string]interface{}

Map is a wrapper for an map[string]interface{}, which gets used in JSON responses

Jump to

Keyboard shortcuts

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