parseprotobuf

package
v0.0.0-...-70bc594 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReader

func GetReader(filename string) (io.ReadCloser, error)

helper function to get a bufio.Reader

func PrintContents

func PrintContents(ps ProtoStruct, phArr []ProtoHint, tab string)

recursively prints protostruct

func PrintHint

func PrintHint(phArr []ProtoHint)

Prints the filtered contents of the protobuf file

func PrintJsonContent

func PrintJsonContent(ps ProtoStruct, phArr []ProtoHint) string

recursively constructs json from the protoStruct

func PrintJsonExample

func PrintJsonExample(phArr []ProtoHint) (string, error)

Prints (and returns) a json representation of the request protobuf object

func ResolveImportPath

func ResolveImportPath(importPath string, gopath string) string

Types

type NameType

type NameType struct {
	Name string
	Type string
	Req  string
}

func NewNameType

func NewNameType(name string, aType string) NameType

constructs a NameType struct

type ProtoEnum

type ProtoEnum struct {
	Values []string
}

type ProtoHint

type ProtoHint struct {
	Name     string
	Contents map[string]ProtoStruct
	Enums    map[string]ProtoEnum
	Root     bool
	Package  string
}

holds a protobuf file

func ParseProtobufRaw

func ParseProtobufRaw(r io.ReadCloser, packageName string, root bool, gopath string) []ProtoHint

Parses a protoc file

type ProtoStruct

type ProtoStruct struct {
	Values map[string]NameType
	Root   bool
}

holds ProtoStruct

Jump to

Keyboard shortcuts

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