Skip to content

GrpcParser

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/api-schema-parser/src/parsers/grpc.parser.ts

gRPC Parser Implementation

Supports:

  • Protocol Buffers syntax (proto2 and proto3)
  • Services and RPCs
  • Messages and nested types
  • Enums
  • Options and comments

Implements: IParser

Methods

MethodSignatureReturns
initializeinitialize(config: ParserConfig)Promise<void>
canParsecanParse(filePath: string)boolean
parseFileparseFile(filePath: string, content: string)Promise<ParseResult>
parseFilesparseFiles(files: ParseFileInput[])Promise<ParseResult[]>
destroydestroy()Promise<void>

Properties

PropertyType
nameany
versionany
supportedPatternsany

Where it refuses work

  • GrpcParser stops the work with an early return when !message.fields.
  • GrpcParser stops the work with an early return when typeName.includes('.').

When something fails

  • GrpcParser handles failure in 1 place: it turns it into a return value in all 1.

Referenced By

  • AppModule (MODULE_PROVIDES)
  • AppModule (MODULE_EXPORTS)

Was this page helpful?

Download as PDF