wsutil

package module
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2020 License: MIT Imports: 7 Imported by: 0

README

wsutil

a handy helper for using gorilla/websocket

Documentation

Index

Constants

View Source
const (
	ConnTypeClient = iota
	ConnTypeServer
)

ConnType :

Variables

View Source
var (
	Debug = false
)

Debug :

Functions

This section is empty.

Types

type Conn

type Conn struct {
	ID         string
	Read       chan map[string]interface{}
	Write      chan map[string]interface{}
	WriteWait  time.Duration
	PongWait   time.Duration
	PingPeriod time.Duration
	// contains filtered or unexported fields
}

Conn :

func Dial added in v0.0.2

func Dial(addr string, header http.Header) (*Conn, error)

Dial :

func Upgrade added in v0.0.2

func Upgrade(w http.ResponseWriter, r *http.Request, upgrader *websocket.Upgrader) (*Conn, error)

Upgrade : pass in nil for upgrader to use the default one

func (*Conn) Close

func (c *Conn) Close()

Close :

func (*Conn) Start

func (c *Conn) Start()

Start :

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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