ws

package
v0.0.0-...-b8ee67f Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const HmacQuery = "hmac"
View Source
const PAIR_CODE_LEN = 4
View Source
const PaircodeQuery = "paircode"
View Source
const PubkeyQuery = "pubkey"
View Source
const SaltQuery = "salt"
View Source
const StatusTimeoutError = websocket.StatusCode(3000)

Variables

This section is empty.

Functions

func GetJsonMessageBytes

func GetJsonMessageBytes(messageRoute string, data interface{}) ([]byte, error)

func ParseTextMessage

func ParseTextMessage(message []byte) (string, []byte, error)

func ReadAndParseTextMessage

func ReadAndParseTextMessage(conn *websocket.Conn, route string, v interface{}) error

func Receive

func Receive(sharePairCode string, url string, w io.Writer) error

func Send

func Send(shareCode string, url string, r io.Reader, size int64) error

Types

type ClientInfo

type ClientInfo struct {
	PubKey []byte
	Salt   []byte
	Hmac   []byte
}

func NewClientInfoFromQueryString

func NewClientInfoFromQueryString(query url.Values) (*ClientInfo, error)

func (*ClientInfo) AddToQuery

func (info *ClientInfo) AddToQuery(query url.Values)

type ErrorMessage

type ErrorMessage struct {
	Error string
}

type WsReceiveHandler

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

func NewWsReceiveHandler

func NewWsReceiveHandler(sharePairCode string, addr string) (*WsReceiveHandler, error)

func (*WsReceiveHandler) Read

func (h *WsReceiveHandler) Read(p []byte) (int, error)

type WsSenderHandler

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

func NewWsSendHandler

func NewWsSendHandler(shareCode string, addr string) (*WsSenderHandler, error)

func (*WsSenderHandler) Write

func (s *WsSenderHandler) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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