webclient

package
v0.0.0-...-fcffdc5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachResource

func AttachResource(mux *http.ServeMux, path string, resource resourcepack.Resource) error

func AttachResources

func AttachResources(mux *http.ServeMux, path string, resources []string) error

func CreateMux

func CreateMux(api ServerAPI) (*http.ServeMux, error)

func ExactMatchChecker

func ExactMatchChecker(path string, handler http.Handler) http.Handler

func LaunchHTTP

func LaunchHTTP(api ServerAPI) error

func StaticHandler

func StaticHandler(modTime time.Time, nameForType string, data []byte) http.Handler

Types

type Command

type Command struct {
	Verb string `json:"verb"`
}

type ErrorStop

type ErrorStop struct{}

func (ErrorStop) Error

func (e ErrorStop) Error() string

type ServerAPI

type ServerAPI interface {
	Connect() ServerSession
	ResourcePack() *resourcepack.ResourcePack
}

type ServerSession

type ServerSession interface {
	Close()
	OnMessage(Command)
	// send nil to the view send callback to close connection
	BeginSend(func(update *sprite.ViewUpdate) error)
}

type WebSocketClient

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

type WebSocketServer

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

func NewWebSocketServer

func NewWebSocketServer(api ServerAPI) *WebSocketServer

func (*WebSocketServer) ServeHTTP

func (wss *WebSocketServer) ServeHTTP(writer http.ResponseWriter, request *http.Request)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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