v0.7.1 Latest Latest

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

Go to latest
Published: Jul 25, 2018 License: MIT Imports: 1 Imported by: 37


GopherJS Bindings for Googles ProtobufJS


This package is based on the node package google-protobuf. It has been "compiled" with webpack.


The API is still experimental, and is not currently intended for general use outside of via the GopherJS protoc compiler plugin. See the protoc-gen-gopherjs README for more information on generating the interface.




View Source
const JspbPackageIsVersion2 = true

JspbPackageIsVersion2 is referenced from generated protocol buffer files to assert that that code is compatible with this version of the package.


This section is empty.


This section is empty.


type Reader

type Reader interface {
	Next() bool
	Err() error

	GetFieldNumber() int

	// Scalars
	ReadInt32() int32
	ReadInt64() int64
	ReadUint32() uint32
	ReadUint64() uint64
	ReadSint32() int32
	ReadSint64() int64
	ReadFixed32() uint32
	ReadFixed64() uint64
	ReadSfixed32() int32
	ReadSfixed64() int64
	ReadFloat32() float32
	ReadFloat64() float64
	ReadEnum() int
	ReadBool() bool
	ReadString() string
	ReadBytes() []byte

	// Scalar Slices
	ReadInt32Slice() []int32
	ReadInt64Slice() []int64
	ReadUint32Slice() []uint32
	ReadUint64Slice() []uint64
	ReadSint32Slice() []int32
	ReadSint64Slice() []int64
	ReadFixed32Slice() []uint32
	ReadFixed64Slice() []uint64
	ReadSfixed32Slice() []int32
	ReadSfixed64Slice() []int64
	ReadFloat32Slice() []float32
	ReadFloat64Slice() []float64
	ReadEnumSlice() []int
	ReadBoolSlice() []bool

	// Specials

Reader encapsulates the jspb.BinaryReader.

func NewReader

func NewReader(data []byte) Reader

NewReader returns a new Reader ready for writing

type Writer

type Writer interface {
	GetResult() []byte

	// Scalars
	WriteInt32(int, int32)
	WriteInt64(int, int64)
	WriteUint32(int, uint32)
	WriteUint64(int, uint64)
	WriteSint32(int, int32)
	WriteSint64(int, int64)
	WriteFixed32(int, uint32)
	WriteFixed64(int, uint64)
	WriteSfixed32(int, int32)
	WriteSfixed64(int, int64)
	WriteFloat32(int, float32)
	WriteFloat64(int, float64)
	WriteEnum(int, int)
	WriteBool(int, bool)
	WriteString(int, string)
	WriteBytes(int, []byte)

	// Scalar Slices
	WriteInt32Slice(int, []int32)
	WriteInt64Slice(int, []int64)
	WriteUint32Slice(int, []uint32)
	WriteUint64Slice(int, []uint64)
	WriteSint32Slice(int, []int32)
	WriteSint64Slice(int, []int64)
	WriteFixed32Slice(int, []uint32)
	WriteFixed64Slice(int, []uint64)
	WriteSfixed32Slice(int, []int32)
	WriteSfixed64Slice(int, []int64)
	WriteFloat32Slice(int, []float32)
	WriteFloat64Slice(int, []float64)
	WriteBoolSlice(int, []bool)
	WriteEnumSlice(int, []int)

	// Specials
	WriteMessage(int, func())

Writer encapsulates the jspb.BinaryWriter.

func NewWriter

func NewWriter() Writer

NewWriter returns a new Writer ready for writing.

Jump to

Keyboard shortcuts

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