httputil

package
v0.0.0-...-249e25c Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultUpgrader = websocket.Upgrader{
	CheckOrigin: func(r *http.Request) bool {
		return true
	},
}
View Source
var DefaultWSOptions = WSOptions{
	WriteTimeout: 5 * time.Second,
	ReadTimeout:  25 * time.Second,
	PingInterval: 20 * time.Second,
}
View Source
var ErrUnexpectedMessageType = errors.New("unexpected non-binary message type")

ErrUnexpectedMessageType ...

Functions

This section is empty.

Types

type MapServeMux

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

func NewMapServeMux

func NewMapServeMux() *MapServeMux

func (*MapServeMux) Handle

func (s *MapServeMux) Handle(path string, h http.Handler)

func (*MapServeMux) HandleFunc

func (s *MapServeMux) HandleFunc(path string, h http.HandlerFunc)

func (*MapServeMux) HandleWSFunc

func (s *MapServeMux) HandleWSFunc(path string, h WSHandlerFunc)

func (*MapServeMux) Handler

func (s *MapServeMux) Handler(r *http.Request) http.Handler

func (*MapServeMux) ServeHTTP

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

func (*MapServeMux) StopHandling

func (s *MapServeMux) StopHandling(path string)

type WSHandlerFunc

type WSHandlerFunc func(c *websocket.Conn)

func (WSHandlerFunc) ServeHTTP

func (h WSHandlerFunc) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WSOptions

type WSOptions struct {
	WriteTimeout time.Duration
	ReadTimeout  time.Duration
	PingInterval time.Duration
}

type WSReadWriter

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

WSReadWriter ...

func NewDefaultWSReadWriter

func NewDefaultWSReadWriter(c *websocket.Conn) *WSReadWriter

NewDefaultWSReadWriter ...

func NewWSReadWriter

func NewWSReadWriter(c *websocket.Conn, o WSOptions) *WSReadWriter

func (*WSReadWriter) Close

func (w *WSReadWriter) Close() error

Close ...

func (*WSReadWriter) MTU

func (w *WSReadWriter) MTU() int

MTU ...

func (*WSReadWriter) Read

func (w *WSReadWriter) Read(b []byte) (n int, err error)

Read ...

func (*WSReadWriter) Write

func (w *WSReadWriter) Write(b []byte) (int, error)

Write ...

Jump to

Keyboard shortcuts

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