Documentation
¶
Overview ¶
Package parse parses Protocol Buffers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ProtoTypes = [...]string{ "double", "float", "int32", "int64", "uint32", "uint64", "sint32", "sint64", "fixed32", "fixed64", "sfixed32", "sfixed64", "bool", "string", "bytes", } ToCpp = map[ProtoType]string{ Double: "double", Float: "float", Int32: "int32", Int64: "int64", Uint32: "uint32", Uint64: "uint64", Sint32: "int32", Sint64: "int64", Fixed32: "uint32", Fixed64: "uint64", Sfixed32: "int32", Sfixed64: "int64", Bool: "bool", String: "string", Bytes: "string", } ToJava = map[ProtoType]string{ Double: "double", Float: "float", Int32: "int", Int64: "long", Uint32: "int", Uint64: "long", Sint32: "int", Sint64: "long", Fixed32: "int", Fixed64: "long", Sfixed32: "int32", Sfixed64: "int64", Bool: "boolean", String: "String", Bytes: "ByteString", } ToPython = map[ProtoType]string{ Double: "float", Float: "float", Int32: "int", Int64: "int/long", Uint32: "int/long", Uint64: "int/long", Sint32: "int", Sint64: "int/long", Fixed32: "int", Fixed64: "int/long", Sfixed32: "int", Sfixed64: "int/long", Bool: "boolean", String: "str/unicode", Bytes: "str", } ToGo = map[ProtoType]string{ Double: "float64", Float: "float32", Int32: "int32", Int64: "int64", Uint32: "uint32", Uint64: "uint64", Sint32: "int32", Sint64: "int64", Fixed32: "uint32", Fixed64: "uint64", Sfixed32: "int32", Sfixed64: "int64", Bool: "bool", String: "string", Bytes: "[]byte", } ToRuby = map[ProtoType]string{ Double: "Float", Float: "Float", Int32: "Fixnum or Bignum (as required)", Int64: "Bignum", Uint32: "Fixnum or Bignum (as required)", Uint64: "Bignum", Sint32: "Fixnum or Bignum (as required)", Sint64: "Bignum", Fixed32: "Fixnum or Bignum (as required)", Fixed64: "Bignum", Sfixed32: "Fixnum or Bignum (as required)", Sfixed64: "Bignum", Bool: "TrueClass/FalseClass", String: "String (UTF-8)", Bytes: "String (ASCII-8BIT)", } ToCsharp = map[ProtoType]string{ Double: "double", Float: "float", Int32: "int", Int64: "long", Uint32: "uint", Uint64: "ulong", Sint32: "int", Sint64: "long", Fixed32: "uint", Fixed64: "ulong", Sfixed32: "int", Sfixed64: "long", Bool: "bool", String: "string", Bytes: "ByteString", } )
https://developers.google.com/protocol-buffers/docs/proto3#scalar
Functions ¶
This section is empty.
Types ¶
type Proto ¶
type Proto struct { Services []ProtoService Messages []ProtoMessage }
Proto represents sets of 'ProtoMessage' and 'ProtoService'.
type ProtoField ¶
type ProtoField struct { Name string Description string Repeated bool ProtoType ProtoType UserDefinedProtoType string }
ProtoField represent member fields in ProtoMessage.
type ProtoMessage ¶
type ProtoMessage struct { FilePath string Name string Description string Fields []ProtoField }
ProtoMessage represents the 'message' type in Protocol Buffer. (https://developers.google.com/protocol-buffers/docs/proto3#simple)
type ProtoMethod ¶
ProtoMethod represents methods in ProtoService.
type ProtoService ¶
type ProtoService struct { FilePath string Name string Description string Methods []ProtoMethod }
ProtoService represents the 'service' type in Protocol Buffer. (https://developers.google.com/protocol-buffers/docs/proto3#services)
type ProtoType ¶
type ProtoType int
https://developers.google.com/protocol-buffers/docs/proto3#scalar
func ToProtoType ¶
ToProtoType parses string to return 'ProtoType'.
type ProtoTypeCpp ¶
type ProtoTypeCpp int
https://developers.google.com/protocol-buffers/docs/proto3#scalar
type ProtoTypeCsharp ¶
type ProtoTypeCsharp int
https://developers.google.com/protocol-buffers/docs/proto3#scalar
type ProtoTypeGo ¶
type ProtoTypeGo int
https://developers.google.com/protocol-buffers/docs/proto3#scalar
type ProtoTypeJava ¶
type ProtoTypeJava int
https://developers.google.com/protocol-buffers/docs/proto3#scalar
type ProtoTypePython ¶
type ProtoTypePython int
https://developers.google.com/protocol-buffers/docs/proto3#scalar
type ProtoTypeRuby ¶
type ProtoTypeRuby int
https://developers.google.com/protocol-buffers/docs/proto3#scalar