wsjson

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2019 License: MIT Imports: 5 Imported by: 329

Documentation

Overview

Package wsjson provides websocket helpers for JSON messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(ctx context.Context, c *websocket.Conn, v interface{}) error

Read reads a json message from c into v. If the message is larger than 128 bytes, it will use a buffer from a pool instead of performing an allocation.

func Write

func Write(ctx context.Context, c *websocket.Conn, v interface{}) error

Write writes the json message v to c. It uses json.Encoder which automatically reuses buffers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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