Documentation ¶
Index ¶
- Constants
- Variables
- func HandleWs(w http.ResponseWriter, r *http.Request)
- func HandleWsInternal(w http.ResponseWriter, r *http.Request) error
- func MakeTCPListener(serviceName string) (net.Listener, error)
- func MakeUnixListener() (net.Listener, error)
- func ReadLoop(conn *websocket.Conn, outputCh chan any, closeCh chan any, ...)
- func RunWebServer(listener net.Listener)
- func RunWebSocketServer(listener net.Listener)
- func WriteJsonError(w http.ResponseWriter, errVal error)
- func WriteJsonSuccess(w http.ResponseWriter, data interface{})
- func WriteLoop(conn *websocket.Conn, outputCh chan any, closeCh chan any, routeId string)
- func WritePing(conn *websocket.Conn) error
- type ClientActiveState
- type WebFnOpts
- type WebFnType
Constants ¶
View Source
const ( CacheControlHeaderKey = "Cache-Control" CacheControlHeaderNoCache = "no-cache" ContentTypeHeaderKey = "Content-Type" ContentTypeJson = "application/json" ContentTypeBinary = "application/octet-stream" ContentLengthHeaderKey = "Content-Length" LastModifiedHeaderKey = "Last-Modified" WaveZoneFileInfoHeaderKey = "X-ZoneFileInfo" )
Header constants
View Source
const DefaultCommandTimeout = 2 * time.Second
View Source
const HttpMaxHeaderBytes = 60000
View Source
const HttpReadTimeout = 5 * time.Second
View Source
const HttpTimeoutDuration = 21 * time.Second
View Source
const HttpWriteTimeout = 21 * time.Second
View Source
const TransparentGif64 = "R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"
View Source
const WSStatePacketChSize = 20
View Source
const WSStateReconnectTime = 30 * time.Second
Variables ¶
View Source
var GlobalLock = &sync.Mutex{}
View Source
var RouteToConnMap = map[string]string{} // routeid => connid
Functions ¶
func HandleWsInternal ¶
func HandleWsInternal(w http.ResponseWriter, r *http.Request) error
func MakeUnixListener ¶
func RunWebSocketServer ¶
func WriteJsonError ¶
func WriteJsonError(w http.ResponseWriter, errVal error)
func WriteJsonSuccess ¶
func WriteJsonSuccess(w http.ResponseWriter, data interface{})
Types ¶
type ClientActiveState ¶
Click to show internal directories.
Click to hide internal directories.