protobuf

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrpcGatewayParser

type GrpcGatewayParser struct {
	// contains filtered or unexported fields
}

GrpcGatewayParser 使用grpc-gateway官方包的完整解析器

func NewGrpcGatewayParser

func NewGrpcGatewayParser(workDir string) *GrpcGatewayParser

NewGrpcGatewayParser 创建新的grpc-gateway解析器

func (*GrpcGatewayParser) GenerateCode

func (p *GrpcGatewayParser) GenerateCode(outputDir string, openapi bool) error

GenerateCode 生成代码

func (*GrpcGatewayParser) ParseDirectory

func (p *GrpcGatewayParser) ParseDirectory(dir string) ([]*ast.ProtobufFile, error)

ParseDirectory 解析目录中的所有protobuf文件

func (*GrpcGatewayParser) ParseFile

func (p *GrpcGatewayParser) ParseFile(filename string) (*ast.ProtobufFile, error)

ParseFile 解析单个protobuf文件

func (*GrpcGatewayParser) SetOffline

func (p *GrpcGatewayParser) SetOffline(v bool)

SetOffline 设置离线模式

type OfficialParser

type OfficialParser struct {
	// contains filtered or unexported fields
}

OfficialParser 使用grpc-gateway官方包的解析器

func NewOfficialParser

func NewOfficialParser(workDir string) *OfficialParser

NewOfficialParser 创建新的官方protobuf解析器

func (*OfficialParser) ParseDirectory

func (p *OfficialParser) ParseDirectory(dir string) ([]*ast.ProtobufFile, error)

ParseDirectory 解析目录中的所有protobuf文件

func (*OfficialParser) ParseFile

func (p *OfficialParser) ParseFile(filename string) (*ast.ProtobufFile, error)

ParseFile 解析单个protobuf文件

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

Parser 用于解析protobuf文件

func NewParser

func NewParser(workDir string) *Parser

NewParser 创建新的protobuf解析器

func (*Parser) ParseDirectory

func (p *Parser) ParseDirectory(dir string) ([]*ast.ProtobufFile, error)

ParseDirectory 解析目录中的所有protobuf文件

func (*Parser) ParseFile

func (p *Parser) ParseFile(filename string) (*ast.ProtobufFile, error)

ParseFile 解析单个protobuf文件

Jump to

Keyboard shortcuts

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