Documentation ¶
Index ¶
- Constants
- Variables
- func ParseProtoFile(path string) (p *proto.Proto, err error)
- type Parser
- func (t *Parser) LoadProtoFile(path string) (err error)
- func (t *Parser) Messages() map[string]*proto.Message
- func (t *Parser) Options(opts ...ParserOptions) ParserOptions
- func (t *Parser) Parse(pkgPath, typeExpr string) (message *proto.Message, err error)
- func (t *Parser) RenderProto(protoPkg string) (buf *bytes.Buffer)
- func (t *Parser) Reset()
- func (t *Parser) SetMessages(messages map[string]*proto.Message)
- type ParserOptions
Constants ¶
View Source
const ProtoSyntax = "proto3"
ProtoSyntax defines proto synatax
Variables ¶
View Source
var DefaultParserOptions = ParserOptions{ ParserOptions: tspec.ParserOptions{ IgnoreJSONTag: false, RefPrefix: tspecRefPrefix, }, }
DefaultParserOptions defines default tproto parser options
Functions ¶
Types ¶
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser defines tproto parser
func (*Parser) LoadProtoFile ¶
LoadProtoFile loads messages from proto file
func (*Parser) Options ¶
func (t *Parser) Options(opts ...ParserOptions) ParserOptions
Options gets or sets parser options
func (*Parser) RenderProto ¶
RenderProto renders proto messages
type ParserOptions ¶
type ParserOptions struct {
tspec.ParserOptions
}
ParserOptions defines tproto parser options
Click to show internal directories.
Click to hide internal directories.