websocket

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2022 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn

type Conn interface {
	Reader
	Writer
}

func Dial

func Dial(ctx context.Context, urlStr string) (conn Conn, err error)

func UpgradeHTTP

func UpgradeHTTP(w http.ResponseWriter, r *http.Request) (conn Conn, err error)

type Reader added in v0.1.1

type Reader interface {
	Close() error
	State() ws.State

	Read() ([]byte, error)
	ReadString() (string, error)
	ReadJSON(v any) error
}

type Writer added in v0.1.1

type Writer interface {
	Close() error
	State() ws.State

	Write(p []byte) error
	WriteString(p string) error
	WriteJSON(v any) error
}

Jump to

Keyboard shortcuts

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