parser

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCase

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

func GetComment(comment *proto.Comment) string

GetComment returns content with prefix //

func GoSanitized

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

type DefaultProtoParser struct{}

DefaultProtoParser types a empty struct

func NewDefaultProtoParser

func NewDefaultProtoParser() *DefaultProtoParser

NewDefaultProtoParser creates a new instance

func (*DefaultProtoParser) Parse

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

type Import struct {
	*proto.Import
}

Import embeds proto.Import

type Message

type Message struct {
	*proto.Message
}

Message embeds proto.Message

type Option

type Option struct {
	*proto.Option
}

Option embeds proto.Option

type Package

type Package struct {
	*proto.Package
}

Package defines the protobuf package.

type Proto

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

type RPC struct {
	*proto.RPC
}

RPC embeds proto.RPC

type Service

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