websocket

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: AGPL-3.0 Imports: 10 Imported by: 0

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