core

package
v0.0.0-...-03946c7 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func GenP256

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

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

func GenRSA2048

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

func NewHostHeader

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

Types

type Stats

type Stats struct {
	Downloaded    uint64
	DownloadSpeed uint64

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

todo better stats

func NewStats

func NewStats() (stats *Stats)

func (*Stats) AddDownloaded

func (stats *Stats) AddDownloaded(downloaded uint64)

func (*Stats) AddUploaded

func (stats *Stats) AddUploaded(uploaded uint64)

type WebSocket

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

func NewWebSocket

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

func (*WebSocket) Close

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

func (*WebSocket) Read

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

func (*WebSocket) Write

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