wsprotobuf

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

README

wsprotobuf

wsprotobuf provides helpers for reading and writing protobuf messages.

Install

go get github.com/weiwenchen2022/wsprotobuf

Reference

GoDoc: https://pkg.go.dev/github.com/weiwenchen2022/wsprotobuf

Documentation

Overview

Package wsprotobuf provides helpers for reading and writing protobuf messages.

Example (Greet)

This example demonstrates a greet server.

package main

import ()

func main() {
	// https://github.com/weiwenchen2022/wsprotobuf/tree/main/examples/helloworld
}
Output:

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Read

func Read(ctx context.Context, c *websocket.Conn, v any) (err error)

Read reads a protobuf message from c into v. It will reuse buffers in between calls to avoid allocations.

func Write

func Write(ctx context.Context, c *websocket.Conn, v any) error

Write writes the protobuf message v to c. It will reuse buffers in between calls to avoid allocations.

Types

This section is empty.

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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