websocket

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 10 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 ExitWithDoingNothing

type ExitWithDoingNothing struct {
}

主动离开

func (ExitWithDoingNothing) Error

func (e ExitWithDoingNothing) Error() string

type Handler

type Handler func(w ResponseWriter, r *apistructs.WebsocketRequest) error

type ResponseWriter

type ResponseWriter interface {
	io.Writer
}

type Websocket

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

func New

func New() *Websocket

func (*Websocket) AfterConnected

func (ws *Websocket) AfterConnected(handler func(w ResponseWriter))

func (*Websocket) BeforeClose

func (ws *Websocket) BeforeClose(handler func(w ResponseWriter, err error))

func (*Websocket) Close

func (ws *Websocket) Close() error

func (*Websocket) Register

func (ws *Websocket) Register(type_ string, handler Handler)

func (*Websocket) Run

func (ws *Websocket) Run()

func (*Websocket) Upgrade

func (ws *Websocket) Upgrade(w http.ResponseWriter, r *http.Request) error

func (*Websocket) Write

func (ws *Websocket) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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