parser

package
v0.0.29 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 12 Imported by: 1 module, 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

View Source
const (
	Request  = 0
	Response = 1
)

Variables

This section is empty.

Functions

func Errorf

func Errorf(format string, a ...interface{})

func HeadToLower

func HeadToLower(s string) string

func MustNil

func MustNil(err error)

func TrimOption

func TrimOption(str string) string

func Walk

func Walk(srcPath string) ([]string, error)

Types

type ErrorInfo

type ErrorInfo struct {
	TipName   string
	TipDesc   string
	ErrorCode string
	Enum      *proto.EnumField
	Name      string
	Integer   int
	FileName  string
	Module    string
}

type File

type File struct {
	Mbs      []*MessageBase
	Ext      map[string]*proto.Message
	Eis      map[string]*ErrorInfo
	FileName string
}

func (*File) Check

func (this_ *File) Check(commonErrors map[string]bool)

func (*File) VisitComment

func (this_ *File) VisitComment(e *proto.Comment)

func (*File) VisitEnum

func (this_ *File) VisitEnum(e *proto.Enum)

func (*File) VisitEnumField

func (this_ *File) VisitEnumField(i *proto.EnumField)

func (*File) VisitExtensions

func (this_ *File) VisitExtensions(e *proto.Extensions)

func (*File) VisitGroup

func (this_ *File) VisitGroup(g *proto.Group)

func (*File) VisitImport

func (this_ *File) VisitImport(i *proto.Import)

func (*File) VisitMapField

func (this_ *File) VisitMapField(f *proto.MapField)

func (*File) VisitMessage

func (this_ *File) VisitMessage(m *proto.Message)

func (*File) VisitNormalField

func (this_ *File) VisitNormalField(i *proto.NormalField)

func (*File) VisitOneof

func (this_ *File) VisitOneof(o *proto.Oneof)

func (*File) VisitOneofField

func (this_ *File) VisitOneofField(o *proto.OneOfField)

func (*File) VisitOption

func (this_ *File) VisitOption(m *proto.Option)

func (*File) VisitPackage

func (this_ *File) VisitPackage(pkg *proto.Package)

func (*File) VisitRPC

func (this_ *File) VisitRPC(rpc *proto.RPC)

func (*File) VisitReserved

func (this_ *File) VisitReserved(rs *proto.Reserved)

func (*File) VisitService

func (this_ *File) VisitService(v *proto.Service)

func (*File) VisitSyntax

func (this_ *File) VisitSyntax(s *proto.Syntax)

type MessageBase

type MessageBase struct {
	Id       string
	Type     Protocol
	Errors   []string
	Msg      *proto.Message
	Name     string
	Module   string
	FileName string
}

type Parser

type Parser struct {
	Files []*File
	// contains filtered or unexported fields
}

func NewParser

func NewParser(dir string) (*Parser, error)

func (*Parser) Check

func (this_ *Parser) Check()

func (*Parser) OutputErrorCodeExcel added in v0.0.18

func (this_ *Parser) OutputErrorCodeExcel(outPath string)

func (*Parser) OutputErrorCodeGoCode

func (this_ *Parser) OutputErrorCodeGoCode(pkgName, outPath string)

func (*Parser) OutputErrorCodeTxt

func (this_ *Parser) OutputErrorCodeTxt(outPath string)

func (*Parser) Parse

func (this_ *Parser) Parse() error

type Protocol

type Protocol int64

Jump to

Keyboard shortcuts

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