{"modulePath":"github.com/acoderup/goctl","version":"v1.1.7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package parser\n\n## Variables\n\n```go\nvar ErrGoPackage = errors.New(`option go_package = \"\" field is not filled in`)\n```\n\n## Functions\n\n```go\nfunc CamelCase(s string) string\n```\nCamelCase copy from protobuf, for more information, please see github.com/golang/protobuf@v1.4.2/protoc-gen-go/generator/generator.go:2648\n\n```go\nfunc GetComment(comment *proto.Comment) string\n```\nGetComment returns content with prefix //\n\n```go\nfunc GoSanitized(s string) string\n```\nGoSanitized copy from protobuf, for more information, please see google.golang.org/protobuf@v1.25.0/internal/strs/strings.go:71\n\n## Types\n\n```go\ntype DefaultProtoParser struct{}\n```\nDefaultProtoParser types an empty struct\n\n```go\nfunc NewDefaultProtoParser() *DefaultProtoParser\n```\nNewDefaultProtoParser creates a new instance\n\n```go\nfunc (p *DefaultProtoParser) Parse(src string, multiple ...bool) (Proto, error)\n```\nParse provides to parse the proto file into a golang structure, which is convenient for subsequent rpc generation and use\n\n```go\ntype Import struct {\n\t*proto.Import\n}\n```\nImport embeds proto.Import\n\n```go\ntype Message struct {\n\t*proto.Message\n}\n```\nMessage embeds proto.Message\n\n```go\ntype Option struct {\n\t*proto.Option\n}\n```\nOption embeds proto.Option\n\n```go\ntype Package struct {\n\t*proto.Package\n}\n```\nPackage defines the protobuf package.\n\n```go\ntype Proto struct {\n\tSrc       string\n\tName      string\n\tPackage   Package\n\tPbPackage string\n\tGoPackage string\n\tImport    []Import\n\tMessage   []Message\n\tService   Services\n}\n```\nProto describes a proto file,\n\n```go\ntype RPC struct {\n\t*proto.RPC\n}\n```\nRPC embeds proto.RPC\n\n```go\ntype Service struct {\n\t*proto.Service\n\tRPC []*RPC\n}\n```\nService describes the rpc service, which is the relevant content after the translation of the proto file\n\n```go\ntype Services []Service\n```\nServices is a slice of Service.\n\n","path":"github.com/acoderup/goctl/rpc/parser","name":"parser","synopsis":"","isRedistributable":true}
