protowire

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2021 License: MIT, BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Overview

Package protowire parses and formats the raw wire encoding. See https://developers.google.com/protocol-buffers/docs/encoding.

For marshaling and unmarshaling entire protobuf messages, use the "google.golang.org/protobuf/proto" package instead.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendFixed32

func AppendFixed32(b []byte, v uint32) []byte

AppendFixed32 appends v to b as a little-endian uint32.

func AppendFixed64

func AppendFixed64(b []byte, v uint64) []byte

AppendFixed64 appends v to b as a little-endian uint64.

func AppendVarint

func AppendVarint(b []byte, v uint64) []byte

AppendVarint appends v to b as a varint-encoded uint64.

func EncodeZigZag

func EncodeZigZag(x int64) uint64

EncodeZigZag encodes an int64 as a zig-zag-encoded uint64.

Input:  {…, -3, -2, -1,  0, +1, +2, +3, …}
Output: {…,  5,  3,  1,  0,  2,  4,  6, …}

Types

type Type

type Type int8

Type represents the wire type.

const (
	VarintType     Type = 0
	Fixed32Type    Type = 5
	Fixed64Type    Type = 1
	BytesType      Type = 2
	StartGroupType Type = 3
	EndGroupType   Type = 4
)

Jump to

Keyboard shortcuts

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