proto

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	// contains filtered or unexported fields
}

Decoder decodes protobuf messages to JSON.

func NewDecoder

func NewDecoder(protoTypeNames []string) (*Decoder, error)

NewDecoder creates a new Decoder instance for the argument proto type names.

func (*Decoder) ToJSON

func (d *Decoder) ToJSON(contents []byte) ([]byte, error)

ToJSON converts the argument bytes to JSON bytes. If the former is already valid JSON, it's returned unchanged. Otherwise, it tries to decode the input using the proto types registered in this Decoder instance.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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