glue: Index | Files | Directories

package backend

import ""

Package backend provides the server backend with various socket implementations.


Package Files

server.go socket.go

type BackendSocket Uses

type BackendSocket interface {
    Type() global.SocketType
    RemoteAddr() string
    UserAgent() string

    IsClosed() bool
    ClosedChan() <-chan struct{}

    WriteChan() chan string
    ReadChan() chan string

type Server Uses

type Server struct {
    // contains filtered or unexported fields

func NewServer Uses

func NewServer(httpURLStripLength int, enableCORS bool, checkOrigin func(r *http.Request) bool) *Server

func (*Server) OnNewSocketConnection Uses

func (s *Server) OnNewSocketConnection(f func(BackendSocket))

OnNewSocketConnection sets the event function which is triggered if a new socket connection was made.

func (*Server) ServeHTTP Uses

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the HTTP Handler interface of the http package.


closerEmit a close function only once, also if called multiple times.
globalPackage global provides global types and constants for the backend packages.
sockets/ajaxsocketPackage ajaxsocket provides the ajax socket implementation.

Package backend imports 8 packages (graph) and is imported by 3 packages. Updated 2017-11-25. Refresh now. Tools for package owners.