wsserver

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB db.DB
}

Config ...

type Conn

type Conn struct {
	ID             string
	Channel        string
	Wsconn         *websocket.Conn
	Netconn        net.Conn
	BandwidthQuota uint64
	// contains filtered or unexported fields
}

Conn ...

func (*Conn) BandwidthQuotaUsed

func (conn *Conn) BandwidthQuotaUsed() uint64

BandwidthQuotaUsed ...

func (*Conn) ResetBandwidthQuota

func (conn *Conn) ResetBandwidthQuota()

ResetBandwidthQuota ...

func (*Conn) TollBandwidth

func (conn *Conn) TollBandwidth(n uint64)

TollBandwidth ...

func (*Conn) Write

func (conn *Conn) Write(msg []byte) error

Write ...

type ServerMessage

type ServerMessage struct {
	Root *ServerMessageData `json:"__server_message__"`
}

ServerMessage ...

type ServerMessageConnections

type ServerMessageConnections struct {
	ConnectionID string   `json:"connectionId"`
	Connections  []string `json:"connections"`
}

ServerMessageConnections ...

type ServerMessageData

type ServerMessageData struct {
	Data *ServerMessageConnections `json:"data"`
}

ServerMessageData ...

type WS

type WS struct {
	Socks map[string][]*Conn
	// contains filtered or unexported fields
}

WS ...

func NewWS

func NewWS(config *Config) *WS

NewWS ...

func (*WS) Handler

func (w *WS) Handler(wr http.ResponseWriter, r *http.Request)

Handler ...

Jump to

Keyboard shortcuts

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