proto

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package proto encodes a parser.Interface into marshaled protocol buffer. This can be used for transcoding or dynamic marshaling. Dynamic marshaling is when the protocol buffer has not been compiled into the source and only the descriptor struct is available.

TODO: more tests

TODO: support for packed, proto3, maps, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder interface {
	Encode([]byte, parser.Interface) ([]byte, error)
}

Encoder encodes a parser.Interface into a byte slice containing marshaled protocol buffer.

func NewEncoder

func NewEncoder(desc *descriptor.FileDescriptorSet, pkgName, msgName string) (Encoder, error)

NewEncoder returns an Encoder that can marshal a parser.Interface into the specified protocol buffer message.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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