parser

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMessageType

func NewMessageType(typeName string) (proto.Message, error)

NewMessageType loads protobuf message type `typeName` and allocates new instance of this type.

Types

type Parser

type Parser struct {
	In              io.Reader // Input for the parser
	Out             io.Writer // Output for the parser
	LengthDelimeted bool      // If true, each input message should start with message length
	// contains filtered or unexported fields
}

Parser reads protobuf data from In, parses it and writes to Out in JSON format

func NewParser

func NewParser(in io.Reader) Parser

func (Parser) Parse

func (p Parser) Parse(msgType string) error

Parse parses next element as protobuf message type `msgType`. Returns io.EOF when there are no more messages in In.

Jump to

Keyboard shortcuts

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