protobufjs

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2017 License: MIT Imports: 1 Imported by: 0

README

GopherJS Bindings for Googles ProtobufJS

GoDoc

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

Usage

This package is not intended for use without the GopherJS protoc compiler plugin. That package uses this package to interface with generated ProtobufJS files. See the README of protoc-gen-gopherjs for usage.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Deserialize

func Deserialize(m ProtoMessage, rawBytes []byte) (o *js.Object, err error)

Deserialize unmarshals the provided ProtoMessage bytes into a generic *js.Object of the provided type, returning an error if one was thrown.

func Serialize

func Serialize(m ProtoMessage) (resp []byte, err error)

Serialize marshals the provided ProtoMessage into a slice of bytes using the serializeBinary ProtobufJS function, returning an error if one was thrown.

Types

type ProtoMessage

type ProtoMessage interface {
	Call(string, ...interface{}) *js.Object
}

ProtoMessage is implemented by... all *js.Objects. But it'll do for an interface to Serialize and Deserialize

Jump to

Keyboard shortcuts

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