Documentation ¶
Index ¶
- Constants
- Variables
- func BackendWSdataSession(conn *websocket.Conn, backendChannel chan string)
- func CloseLogFile()
- func ExtractFromToken(token string, claim string) string
- func ExtractPayload(request string, rMap *map[string]interface{})
- func FinalizeMessage(responseMap map[string]interface{}) string
- func FrontendWSdataSession(conn *websocket.Conn, clientChannel chan string, backendChannel chan string)
- func GenerateHmac(input string, key string) string
- func GetModelIP(ipModel int) string
- func GetRfcTime() string
- func GetServerIP() string
- func InitDataSession(muxServer *http.ServeMux, regData RegData) (dataConn *websocket.Conn)
- func InitLog(filename string, logdir string)
- func PathToUrl(path string) string
- func RegisterAsTransportMgr(regData *RegData, protocol string)
- func SetErrorResponse(reqMap map[string]interface{}, errRespMap map[string]interface{}, ...)
- func TrimLogFile(logFile *os.File)
- func UrlToPath(url string) string
- func VerifyTokenSignature(token string, key string) bool
- type ClientHandler
- type ClientServer
- type HttpChannel
- type HttpServer
- type HttpWSsession
- type RegData
- type TransportHubFrontendWSSession
- type WsChannel
- type WsServer
- type WsWSsession
Constants ¶
View Source
const IpEnvVarName = "GEN2MODULEIP"
View Source
const IpModel = 0 // IpModel = [0,1,2] = [localhost,extIP,envVarIP]
Variables ¶
View Source
var ( // Trace *log.Logger Info *logrus.Logger Warning *logrus.Logger Error *logrus.Logger )
View Source
var AppClientChan = []chan string{ make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), make(chan string), }
the number of channel array elements sets the limit for max number of parallel WS app clients
View Source
var HostIP string
View Source
var Logfile *os.File
const LOG_FILE = "servercore-log.txt"
View Source
var MuxServer = []*http.ServeMux{ http.NewServeMux(), http.NewServeMux(), }
View Source
var TransportErrorMessage string
View Source
var Upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
}
Functions ¶
func BackendWSdataSession ¶
func CloseLogFile ¶
func CloseLogFile()
func ExtractFromToken ¶
func ExtractPayload ¶
func FinalizeMessage ¶
func FrontendWSdataSession ¶
func GenerateHmac ¶
func GetModelIP ¶
func GetRfcTime ¶
func GetRfcTime() string
func GetServerIP ¶
func GetServerIP() string
func InitDataSession ¶
func RegisterAsTransportMgr ¶
* * registerAsTransportMgr: * Registers with servercore as WebSocket protocol manager, and stores response in regData *
func SetErrorResponse ¶
func TrimLogFile ¶
* * The log file is trimmed to 20% of its size when exceeding 10MB. *
func VerifyTokenSignature ¶
Types ¶
type ClientHandler ¶
type ClientHandler interface {
// contains filtered or unexported methods
}
********************************************************************* Client response handlers *********************
type ClientServer ¶
type HttpChannel ¶
type HttpChannel struct { }
type HttpServer ¶
type HttpServer struct { }
func (HttpServer) InitClientServer ¶
func (server HttpServer) InitClientServer(muxServer *http.ServeMux)
type HttpWSsession ¶
type HttpWSsession struct { }
func (HttpWSsession) TransportHubFrontendWSsession ¶
func (httpCoreSocketSession HttpWSsession) TransportHubFrontendWSsession(dataConn *websocket.Conn, appClientChannel []chan string)
type TransportHubFrontendWSSession ¶
type TransportHubFrontendWSSession interface {
// contains filtered or unexported methods
}
**********Server Core Communications *******************************************************************************
type WsWSsession ¶
type WsWSsession struct {
ClientBackendChannel []chan string
}
func (WsWSsession) TransportHubFrontendWSsession ¶
func (wsCoreSocketSession WsWSsession) TransportHubFrontendWSsession(dataConn *websocket.Conn, appClientChannel []chan string)
Click to show internal directories.
Click to hide internal directories.