server

package
v0.0.0-...-0b3c072 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NoCacheMiddleware

func NoCacheMiddleware(next http.Handler) http.Handler

Types

type Config

type Config map[string]ServerConfig

type ConnectionHandler

type ConnectionHandler interface {
	Add(*websocket.Conn) error
}

type EndpointConfig

type EndpointConfig struct {
	PodData           string `toml:"pod_data" default:"/podDataStructure"`
	OrderData         string `toml:"order_data" default:"/orderStructures"`
	ProgramableBoards string `toml:"programable_boards" default:"/uploadableBoards"`
	Connections       string `toml:"connections" default:"/backend"`
	Files             string `toml:"files" default:"/"`
}

type EndpointData

type EndpointData struct {
	PodData           any
	OrderData         any
	ProgramableBoards any
}

type Handler

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

func New

func New(connections ConnectionHandler, data EndpointData, config Config) (*Handler, error)

func (*Handler) AddWebServer

func (handler *Handler) AddWebServer(name string, server *WebServer) error

func (*Handler) ListenAndServe

func (handler *Handler) ListenAndServe() <-chan error

func (*Handler) RemoveServer

func (handler *Handler) RemoveServer(name string)

type ServerConfig

type ServerConfig struct {
	Addr           string         `toml:"address" default:"localhost:4000"`
	MaxConnections *int32         `toml:"client_limit,omitempty"`
	Endpoints      EndpointConfig `toml:"endpoints"`
	StaticPath     string         `toml:"static" default:"./static"`
}

type WebServer

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

func NewWebServer

func NewWebServer(name string, connectionHandle ConnectionHandler, staticData EndpointData, config ServerConfig) (*WebServer, error)

func (*WebServer) ListenAndServe

func (server *WebServer) ListenAndServe() <-chan error

Jump to

Keyboard shortcuts

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