Documentation ¶
Index ¶
- Constants
- Variables
- func AddKeyValue(message string, key string, value string) string
- func AnalyzeValueType(value string) int
- func BackendWSdataSession(conn *websocket.Conn, backendChannel chan string)
- func CloseLogFile()
- func CompressMessage(message []byte) []byte
- func DecompressMessage(message []byte) []byte
- func ExtractFromToken(token string, claim string) string
- func FileExists(filename string) bool
- 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, logFile bool, logLevel string)
- func MapRequest(request string, rMap *map[string]interface{}) int
- func NextQuoteMark(message []byte, offset int) int
- func PathToUrl(path string) string
- func ReadTransportSecConfig()
- func RegisterAsTransportMgr(regData *RegData, protocol string)
- func RemoveInternalData(response string) (string, int)
- func SetErrorResponse(reqMap map[string]interface{}, errRespMap map[string]interface{}, ...)
- func TrimLogFile(logFile *os.File)
- func UnpackFilter(filter interface{}, fList *[]FilterObject)
- func UrlToPath(url string) string
- func VerifyTokenSignature(token string, key string) bool
- type ClientHandler
- type ClientServer
- type CodeList
- type FilterObject
- type HttpChannel
- type HttpServer
- type HttpWSsession
- type PathList
- type RegData
- type SecConfig
- type TransportHubFrontendWSSession
- type WsChannel
- type WsServer
- type WsWSsession
Constants ¶
View Source
const CODELISTINDEXPATH = 4 // must be set to the list index of the "path" element
View Source
const CODELISTINDEXREQID = 1 // must be set to the list index of the "requestId" element
View Source
const CODELISTINDEXSUBID = 5 // must be set to the list index of the "subscriptionId" element
View Source
const CODELISTINDEXTS = 3 // must be set to the list index of the "ts" element
View Source
const CODELISTINDEXVALUE = 2 // must be set to the list index of the "value" element
View Source
const CODELISTKEYS = 10 // must be set to the number of keys in the list
View Source
const CODELISTKEYVALUES = 15 // must be set to the number of keys plus values in the list (excl value types)
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(), http.NewServeMux(), }
View Source
var TransportErrorMessage string
View Source
var Upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
}
Functions ¶
func AnalyzeValueType ¶
func BackendWSdataSession ¶
func CloseLogFile ¶
func CloseLogFile()
func CompressMessage ¶
func DecompressMessage ¶
func ExtractFromToken ¶
func FileExists ¶
func FinalizeMessage ¶
func FrontendWSdataSession ¶
func GenerateHmac ¶
func GetModelIP ¶
func GetRfcTime ¶
func GetRfcTime() string
func GetServerIP ¶
func GetServerIP() string
func InitDataSession ¶
func MapRequest ¶
func NextQuoteMark ¶
func ReadTransportSecConfig ¶
func ReadTransportSecConfig()
func RegisterAsTransportMgr ¶
* * registerAsTransportMgr: * Registers with servercore as WebSocket protocol manager, and stores response in regData *
func RemoveInternalData ¶
func SetErrorResponse ¶
func TrimLogFile ¶
* * The log file is trimmed to 20% of its size when exceeding 10MB. *
func UnpackFilter ¶
func UnpackFilter(filter interface{}, fList *[]FilterObject)
func VerifyTokenSignature ¶
Types ¶
type ClientHandler ¶
type ClientHandler interface {
// contains filtered or unexported methods
}
********************************************************************* Client response handlers *********************
type ClientServer ¶
type FilterObject ¶
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 SecConfig ¶
type SecConfig struct { TransportSec string `json:"transportSec"` // "yes" or "no" SecPort string `json:"secPort"` // port number CaSecPath string `json:"caSecPath"` // relative path from the directory containing the transportSec.json file ServerSecPath string `json:"serverSecPath"` // relative path from the directory containing the transportSec.json file ServerCertOpt string `json:"serverCertOpt"` // one of "NoClientCert"/"ClientCertNoVerification"/"ClientCertVerification" ClientSecPath string `json:"clientSecPath"` // relative path from the directory containing the transportSec.json file }
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.