handlers

package
v0.0.0-...-068a4f3 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPairID

func GetPairID(selfID session.SessionID) session.SessionID

func GetPartnerID

func GetPartnerID(selfID session.SessionID) session.SessionID

func NewCORSHandler

func NewCORSHandler(handler http.Handler) http.Handler

NewCORSHandler init CORS handler

Types

type CORS

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

CORS middleware handler that responds with the following headers to all requests

func (*CORS) ServeHTTP

func (c *CORS) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP to serve the http

type Context

type Context struct {
	SocketStore    *socket.Store
	SessionStore   *session.Store
	FeedbackConfig *FeedbackConfig
}

func NewContext

func NewContext(socketStore *socket.Store, sessionStore *session.Store, feedbackconfig *FeedbackConfig) *Context

func (*Context) FeedbackHandler

func (ctx *Context) FeedbackHandler(w http.ResponseWriter, r *http.Request)

func (*Context) InserConnection

func (ctx *Context) InserConnection(id session.SessionID, conn *websocket.Conn)

func (*Context) RemoveConnection

func (ctx *Context) RemoveConnection(sessionID session.SessionID, conn *websocket.Conn)

func (*Context) SessionHandler

func (ctx *Context) SessionHandler(w http.ResponseWriter, r *http.Request)

func (*Context) SessionSpecificHandler

func (ctx *Context) SessionSpecificHandler(w http.ResponseWriter, r *http.Request)

func (*Context) StatusConnHandler

func (ctx *Context) StatusConnHandler(w http.ResponseWriter, r *http.Request)

func (*Context) WebSocketConnHandler

func (ctx *Context) WebSocketConnHandler(w http.ResponseWriter, r *http.Request)

type FeedbackConfig

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

func InitFeedbackConfig

func InitFeedbackConfig(smtpServerHost string, smtpServerPort string, feedbackAccount string, feedbackAccountPswd string, recipients []string) *FeedbackConfig

type Session

type Session struct {
	SelfID      string `json:"selfID,omitempty"`
	PairExisted bool   `json:"pairExisted,omitempty"`
}

type Status

type Status struct {
	ConnNum int `json:"connNum"`
}

Jump to

Keyboard shortcuts

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