backend

package
Version: v0.0.0-...-06de07e Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2019 License: MIT Imports: 8 Imported by: 3

Documentation

Overview

Package backend provides the server backend with various socket implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackendSocket

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

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

	WriteChan() chan string
	ReadChan() chan string
}

type Server

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

func NewServer

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

func (*Server) OnNewSocketConnection

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

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

ServeHTTP implements the HTTP Handler interface of the http package.

Directories

Path Synopsis
Emit a close function only once, also if called multiple times.
Emit a close function only once, also if called multiple times.
Package global provides global types and constants for the backend packages.
Package global provides global types and constants for the backend packages.
sockets
ajaxsocket
Package ajaxsocket provides the ajax socket implementation.
Package ajaxsocket provides the ajax socket implementation.

Jump to

Keyboard shortcuts

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