router

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2026 License: MIT Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CORSMiddleware added in v0.0.6

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

type Router

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

func NewRouter

func NewRouter() *Router

func (*Router) Broadcast added in v0.0.8

func (r *Router) Broadcast(path string, messageType int, data []byte, sender *websocket.Conn)

func (*Router) CORSMiddleware added in v0.0.6

func (r *Router) CORSMiddleware(cors CORSMiddleware)

func (*Router) CheckCors added in v0.0.12

func (r *Router) CheckCors()

func (*Router) DefaultCORS added in v0.0.6

func (r *Router) DefaultCORS()

func (*Router) Delete added in v0.0.15

func (r *Router) Delete(path string, handler models.Handler)

func (*Router) Get

func (r *Router) Get(path string, handler models.Handler)

func (*Router) Group

func (r *Router) Group(path string) *models.Group

func (*Router) NewBroker added in v0.0.17

func (r *Router) NewBroker(path string, address string, brokerPort, wsPort int) (b *models.Broker, err error)

func (*Router) NewWebSocket added in v0.0.16

func (r *Router) NewWebSocket(path string) (client *models.WSClient)

func (*Router) Post

func (r *Router) Post(path string, handler models.Handler)

func (*Router) Put added in v0.0.15

func (r *Router) Put(path string, handler models.Handler)

func (*Router) ServeFile

func (r *Router) ServeFile(path, file string)

func (*Router) ServeFileSystem

func (r *Router) ServeFileSystem(path, directory string)

serves file system specified in directory

directory = hst to start with . if in current directory
path = server url, if all underlying file and folder should be browsable path/* * hast to be added

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Router) Update added in v0.0.15

func (r *Router) Update(path string, handler models.Handler)

Jump to

Keyboard shortcuts

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