Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ProtoData ¶
type ProtoData struct {
Package string
ProtoPackage string // Package with '/' replaced by '.' for proto syntax
GoPackage string
Services []ProtoService
Messages []ProtoMessage
Enums []ProtoEnum
}
ProtoData holds all information needed to render a .proto file.
func BuildProtoData ¶
func BuildProtoData(merged *javagen.MergedSpec, goModule string) *ProtoData
BuildProtoData converts a MergedSpec into proto data structures.
type ProtoEnum ¶
type ProtoEnum struct {
Name string
Values []ProtoEnumValue
}
ProtoEnum describes a protobuf enum type.
type ProtoEnumValue ¶
ProtoEnumValue describes a single value in a protobuf enum.
type ProtoField ¶
type ProtoField struct {
Type string
Name string
Number int
Repeated bool
Optional bool
Comment string
}
ProtoField describes a single field in a protobuf message.
type ProtoMessage ¶
type ProtoMessage struct {
Name string
Fields []ProtoField
}
ProtoMessage describes a protobuf message type.
type ProtoRPC ¶
type ProtoRPC struct {
Name string
OriginalName string // Name before collision renaming (empty if unchanged).
InputType string
OutputType string
ClientStreaming bool
ServerStreaming bool
Comment string
}
ProtoRPC describes a single RPC method in a gRPC service.
type ProtoService ¶
ProtoService describes a gRPC service generated from a Java class.
type StreamingPattern ¶
type StreamingPattern int
StreamingPattern classifies how a callback should be exposed as gRPC streaming.
const ( // ServerStreaming means the server sends a stream of events to the client. ServerStreaming StreamingPattern = iota + 1 // BidiStreaming means both client and server send streams. BidiStreaming )
func DetectStreamingPattern ¶
func DetectStreamingPattern(cb *javagen.MergedCallback) StreamingPattern
DetectStreamingPattern determines whether a callback should be exposed as server-streaming or bidirectional-streaming in the gRPC API.
Known bidi interfaces (e.g. BluetoothGattCallback) are always BidiStreaming. Any callback with 2+ methods containing "read"/"write" (case-insensitive) is also BidiStreaming. Everything else is ServerStreaming.