parser

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCase added in v1.0.24

func CamelCase(s string) string

CamelCase copy from protobuf, for more information, please see github.com/golang/protobuf@v1.4.2/protoc-gen-go/generator/generator.go:2648

func GetComment added in v1.0.24

func GetComment(comment *proto.Comment) string

GetComment returns content with prefix //

func GoSanitized added in v1.0.24

func GoSanitized(s string) string

GoSanitized copy from protobuf, for more information, please see google.golang.org/protobuf@v1.25.0/internal/strs/strings.go:71

Types

type DefaultProtoParser added in v1.1.5

type DefaultProtoParser struct{}

DefaultProtoParser types a empty struct

func NewDefaultProtoParser added in v1.0.24

func NewDefaultProtoParser() *DefaultProtoParser

NewDefaultProtoParser creates a new instance

func (*DefaultProtoParser) Parse added in v1.1.5

func (p *DefaultProtoParser) Parse(src string) (Proto, error)

Parse provides to parse the proto file into a golang structure, which is convenient for subsequent rpc generation and use

type Import added in v1.0.21

type Import struct {
	*proto.Import
}

Import embeds proto.Import

type Message added in v1.0.21

type Message struct {
	*proto.Message
}

Message embeds proto.Message

type Option added in v1.0.24

type Option struct {
	*proto.Option
}

Option embeds proto.Option

type Package added in v1.0.24

type Package struct {
	*proto.Package
}

Package defines the protobuf package.

type Proto added in v1.0.21

type Proto struct {
	Src       string
	Name      string
	Package   Package
	PbPackage string
	GoPackage string
	Import    []Import
	Message   []Message
	Service   Service
}

Proto describes a proto file,

type RPC added in v1.0.24

type RPC struct {
	*proto.RPC
}

RPC embeds proto.RPC

type Service added in v1.0.24

type Service struct {
	*proto.Service
	RPC []*RPC
}

Service describes the rpc service, which is the relevant content after the translation of the proto file

Jump to

Keyboard shortcuts

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