core

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrWebSocketClosed = errors.New("websocket closed")

Functions

func GenP256 added in v0.2.2

func GenP256(hosts []string) (key, cert []byte, err error)

Modified https://github.com/Shyp/generate-tls-cert

func GenRSA2048 added in v0.3.0

func GenRSA2048(hosts []string) (key, cert []byte, err error)

func NewHostHeader added in v0.11.1

func NewHostHeader(host string) (header map[string][]string)

Types

type Stats added in v0.12.1

type Stats struct {
	Downloaded    uint64
	DownloadSpeed uint64

	Uploaded    uint64
	UploadSpeed uint64
	// contains filtered or unexported fields
}

todo better stats

func NewStats added in v0.12.1

func NewStats() (stats *Stats)

func (*Stats) AddDownloaded added in v0.12.1

func (stats *Stats) AddDownloaded(downloaded uint64)

func (*Stats) AddUploaded added in v0.12.1

func (stats *Stats) AddUploaded(uploaded uint64)

type WebSocket added in v0.6.0

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

func NewWebSocket added in v0.10.1

func NewWebSocket(conn *websocket.Conn, stats *Stats) (ws *WebSocket)

func (*WebSocket) Close added in v0.8.0

func (ws *WebSocket) Close() (err error)

func (*WebSocket) Read added in v0.6.0

func (ws *WebSocket) Read(p []byte) (n int, err error)

func (*WebSocket) Write added in v0.6.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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