Documentation ¶
Index ¶
- Variables
- func RegisterEchoServiceHTTPServer(s *http.Server, srv EchoServiceHTTPServer)
- func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)
- func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer)
- type Corpus
- type DynamicMessage
- func (*DynamicMessage) Descriptor() ([]byte, []int)deprecated
- func (x *DynamicMessage) GetStructField() *structpb.Struct
- func (x *DynamicMessage) GetValueField() *structpb.Value
- func (*DynamicMessage) ProtoMessage()
- func (x *DynamicMessage) ProtoReflect() protoreflect.Message
- func (x *DynamicMessage) Reset()
- func (x *DynamicMessage) String() string
- type DynamicMessageUpdate
- func (*DynamicMessageUpdate) Descriptor() ([]byte, []int)deprecated
- func (x *DynamicMessageUpdate) GetBody() *DynamicMessage
- func (x *DynamicMessageUpdate) GetUpdateMask() *fieldmaskpb.FieldMask
- func (*DynamicMessageUpdate) ProtoMessage()
- func (x *DynamicMessageUpdate) ProtoReflect() protoreflect.Message
- func (x *DynamicMessageUpdate) Reset()
- func (x *DynamicMessageUpdate) String() string
- type EchoServiceClient
- type EchoServiceHTTPClient
- type EchoServiceHTTPClientImpl
- func (c *EchoServiceHTTPClientImpl) Echo(ctx context.Context, in *SimpleMessage, opts ...http.CallOption) (*SimpleMessage, error)
- func (c *EchoServiceHTTPClientImpl) EchoBody(ctx context.Context, in *SimpleMessage, opts ...http.CallOption) (*SimpleMessage, error)
- func (c *EchoServiceHTTPClientImpl) EchoDelete(ctx context.Context, in *SimpleMessage, opts ...http.CallOption) (*SimpleMessage, error)
- func (c *EchoServiceHTTPClientImpl) EchoPatch(ctx context.Context, in *DynamicMessageUpdate, opts ...http.CallOption) (*DynamicMessageUpdate, error)
- func (c *EchoServiceHTTPClientImpl) EchoResponseBody(ctx context.Context, in *DynamicMessageUpdate, opts ...http.CallOption) (*DynamicMessageUpdate, error)
- type EchoServiceHTTPServer
- type EchoServiceServer
- type Embedded
- func (*Embedded) Descriptor() ([]byte, []int)deprecated
- func (m *Embedded) GetMark() isEmbedded_Mark
- func (x *Embedded) GetNote() string
- func (x *Embedded) GetProgress() int64
- func (*Embedded) ProtoMessage()
- func (x *Embedded) ProtoReflect() protoreflect.Message
- func (x *Embedded) Reset()
- func (x *Embedded) String() string
- type Embedded_Note
- type Embedded_Progress
- type SimpleMessage
- func (*SimpleMessage) Descriptor() ([]byte, []int)deprecated
- func (m *SimpleMessage) GetCode() isSimpleMessage_Code
- func (x *SimpleMessage) GetCorpus() Corpus
- func (x *SimpleMessage) GetEn() int64
- func (m *SimpleMessage) GetExt() isSimpleMessage_Ext
- func (x *SimpleMessage) GetId() string
- func (x *SimpleMessage) GetLang() string
- func (x *SimpleMessage) GetLineNum() int64
- func (x *SimpleMessage) GetNo() *Embedded
- func (x *SimpleMessage) GetNum() int64
- func (x *SimpleMessage) GetStatus() *Embedded
- func (*SimpleMessage) ProtoMessage()
- func (x *SimpleMessage) ProtoReflect() protoreflect.Message
- func (x *SimpleMessage) Reset()
- func (x *SimpleMessage) String() string
- type SimpleMessage_En
- type SimpleMessage_Lang
- type SimpleMessage_LineNum
- type SimpleMessage_No
- type StreamServiceClient
- type StreamServiceServer
- type StreamService_DownloadClient
- type StreamService_DownloadServer
- type UnimplementedEchoServiceServer
- func (UnimplementedEchoServiceServer) Echo(context.Context, *SimpleMessage) (*SimpleMessage, error)
- func (UnimplementedEchoServiceServer) EchoBody(context.Context, *SimpleMessage) (*SimpleMessage, error)
- func (UnimplementedEchoServiceServer) EchoDelete(context.Context, *SimpleMessage) (*SimpleMessage, error)
- func (UnimplementedEchoServiceServer) EchoPatch(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error)
- func (UnimplementedEchoServiceServer) EchoResponseBody(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error)
- type UnimplementedStreamServiceServer
- type UnsafeEchoServiceServer
- type UnsafeStreamServiceServer
Constants ¶
This section is empty.
Variables ¶
var ( Corpus_name = map[int32]string{ 0: "UNIVERSAL", 1: "WEB", 2: "IMAGES", 3: "LOCAL", 4: "NEWS", 5: "PRODUCTS", 6: "VIDEO", } Corpus_value = map[string]int32{ "UNIVERSAL": 0, "WEB": 1, "IMAGES": 2, "LOCAL": 3, "NEWS": 4, "PRODUCTS": 5, "VIDEO": 6, } )
Enum value maps for Corpus.
var EchoService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "testproto.EchoService", HandlerType: (*EchoServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Echo", Handler: _EchoService_Echo_Handler, }, { MethodName: "EchoBody", Handler: _EchoService_EchoBody_Handler, }, { MethodName: "EchoResponseBody", Handler: _EchoService_EchoResponseBody_Handler, }, { MethodName: "EchoDelete", Handler: _EchoService_EchoDelete_Handler, }, { MethodName: "EchoPatch", Handler: _EchoService_EchoPatch_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "echo_service.proto", }
EchoService_ServiceDesc is the grpc.ServiceDesc for EchoService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_echo_service_proto protoreflect.FileDescriptor
var File_stream_proto protoreflect.FileDescriptor
var StreamService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "testproto.StreamService", HandlerType: (*StreamServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "Download", Handler: _StreamService_Download_Handler, ServerStreams: true, }, }, Metadata: "stream.proto", }
StreamService_ServiceDesc is the grpc.ServiceDesc for StreamService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterEchoServiceHTTPServer ¶
func RegisterEchoServiceHTTPServer(s *http.Server, srv EchoServiceHTTPServer)
func RegisterEchoServiceServer ¶
func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)
func RegisterStreamServiceServer ¶
func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer)
Types ¶
type Corpus ¶
type Corpus int32
func (Corpus) Descriptor ¶
func (Corpus) Descriptor() protoreflect.EnumDescriptor
func (Corpus) EnumDescriptor
deprecated
func (Corpus) Number ¶
func (x Corpus) Number() protoreflect.EnumNumber
func (Corpus) Type ¶
func (Corpus) Type() protoreflect.EnumType
type DynamicMessage ¶
type DynamicMessage struct { StructField *structpb.Struct `protobuf:"bytes,1,opt,name=struct_field,json=structField,proto3" json:"struct_field,omitempty"` ValueField *structpb.Value `protobuf:"bytes,2,opt,name=value_field,json=valueField,proto3" json:"value_field,omitempty"` // contains filtered or unexported fields }
DynamicMessage represents a message which can have its structure built dynamically using Struct and Values.
func (*DynamicMessage) Descriptor
deprecated
func (*DynamicMessage) Descriptor() ([]byte, []int)
Deprecated: Use DynamicMessage.ProtoReflect.Descriptor instead.
func (*DynamicMessage) GetStructField ¶
func (x *DynamicMessage) GetStructField() *structpb.Struct
func (*DynamicMessage) GetValueField ¶
func (x *DynamicMessage) GetValueField() *structpb.Value
func (*DynamicMessage) ProtoMessage ¶
func (*DynamicMessage) ProtoMessage()
func (*DynamicMessage) ProtoReflect ¶
func (x *DynamicMessage) ProtoReflect() protoreflect.Message
func (*DynamicMessage) Reset ¶
func (x *DynamicMessage) Reset()
func (*DynamicMessage) String ¶
func (x *DynamicMessage) String() string
type DynamicMessageUpdate ¶
type DynamicMessageUpdate struct { Body *DynamicMessage `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"` UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"` // contains filtered or unexported fields }
func (*DynamicMessageUpdate) Descriptor
deprecated
func (*DynamicMessageUpdate) Descriptor() ([]byte, []int)
Deprecated: Use DynamicMessageUpdate.ProtoReflect.Descriptor instead.
func (*DynamicMessageUpdate) GetBody ¶
func (x *DynamicMessageUpdate) GetBody() *DynamicMessage
func (*DynamicMessageUpdate) GetUpdateMask ¶
func (x *DynamicMessageUpdate) GetUpdateMask() *fieldmaskpb.FieldMask
func (*DynamicMessageUpdate) ProtoMessage ¶
func (*DynamicMessageUpdate) ProtoMessage()
func (*DynamicMessageUpdate) ProtoReflect ¶
func (x *DynamicMessageUpdate) ProtoReflect() protoreflect.Message
func (*DynamicMessageUpdate) Reset ¶
func (x *DynamicMessageUpdate) Reset()
func (*DynamicMessageUpdate) String ¶
func (x *DynamicMessageUpdate) String() string
type EchoServiceClient ¶
type EchoServiceClient interface { // Echo method receives a simple message and returns it. // // The message posted as the id parameter will also be // returned. Echo(ctx context.Context, in *SimpleMessage, opts ...grpc.CallOption) (*SimpleMessage, error) // EchoBody method receives a simple message and returns it. EchoBody(ctx context.Context, in *SimpleMessage, opts ...grpc.CallOption) (*SimpleMessage, error) // EchoResponseBody method receives a simple message and returns it. EchoResponseBody(ctx context.Context, in *DynamicMessageUpdate, opts ...grpc.CallOption) (*DynamicMessageUpdate, error) // EchoDelete method receives a simple message and returns it. EchoDelete(ctx context.Context, in *SimpleMessage, opts ...grpc.CallOption) (*SimpleMessage, error) // EchoPatch method receives a NonStandardUpdateRequest and returns it. EchoPatch(ctx context.Context, in *DynamicMessageUpdate, opts ...grpc.CallOption) (*DynamicMessageUpdate, error) }
EchoServiceClient is the client API for EchoService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewEchoServiceClient ¶
func NewEchoServiceClient(cc grpc.ClientConnInterface) EchoServiceClient
type EchoServiceHTTPClient ¶
type EchoServiceHTTPClient interface { Echo(ctx context.Context, req *SimpleMessage, opts ...http.CallOption) (rsp *SimpleMessage, err error) EchoBody(ctx context.Context, req *SimpleMessage, opts ...http.CallOption) (rsp *SimpleMessage, err error) EchoDelete(ctx context.Context, req *SimpleMessage, opts ...http.CallOption) (rsp *SimpleMessage, err error) EchoPatch(ctx context.Context, req *DynamicMessageUpdate, opts ...http.CallOption) (rsp *DynamicMessageUpdate, err error) EchoResponseBody(ctx context.Context, req *DynamicMessageUpdate, opts ...http.CallOption) (rsp *DynamicMessageUpdate, err error) }
func NewEchoServiceHTTPClient ¶
func NewEchoServiceHTTPClient(client *http.Client) EchoServiceHTTPClient
type EchoServiceHTTPClientImpl ¶
type EchoServiceHTTPClientImpl struct {
// contains filtered or unexported fields
}
func (*EchoServiceHTTPClientImpl) Echo ¶
func (c *EchoServiceHTTPClientImpl) Echo(ctx context.Context, in *SimpleMessage, opts ...http.CallOption) (*SimpleMessage, error)
func (*EchoServiceHTTPClientImpl) EchoBody ¶
func (c *EchoServiceHTTPClientImpl) EchoBody(ctx context.Context, in *SimpleMessage, opts ...http.CallOption) (*SimpleMessage, error)
func (*EchoServiceHTTPClientImpl) EchoDelete ¶
func (c *EchoServiceHTTPClientImpl) EchoDelete(ctx context.Context, in *SimpleMessage, opts ...http.CallOption) (*SimpleMessage, error)
func (*EchoServiceHTTPClientImpl) EchoPatch ¶
func (c *EchoServiceHTTPClientImpl) EchoPatch(ctx context.Context, in *DynamicMessageUpdate, opts ...http.CallOption) (*DynamicMessageUpdate, error)
func (*EchoServiceHTTPClientImpl) EchoResponseBody ¶
func (c *EchoServiceHTTPClientImpl) EchoResponseBody(ctx context.Context, in *DynamicMessageUpdate, opts ...http.CallOption) (*DynamicMessageUpdate, error)
type EchoServiceHTTPServer ¶
type EchoServiceHTTPServer interface { Echo(context.Context, *SimpleMessage) (*SimpleMessage, error) EchoBody(context.Context, *SimpleMessage) (*SimpleMessage, error) EchoDelete(context.Context, *SimpleMessage) (*SimpleMessage, error) EchoPatch(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error) EchoResponseBody(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error) }
type EchoServiceServer ¶
type EchoServiceServer interface { // Echo method receives a simple message and returns it. // // The message posted as the id parameter will also be // returned. Echo(context.Context, *SimpleMessage) (*SimpleMessage, error) // EchoBody method receives a simple message and returns it. EchoBody(context.Context, *SimpleMessage) (*SimpleMessage, error) // EchoResponseBody method receives a simple message and returns it. EchoResponseBody(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error) // EchoDelete method receives a simple message and returns it. EchoDelete(context.Context, *SimpleMessage) (*SimpleMessage, error) // EchoPatch method receives a NonStandardUpdateRequest and returns it. EchoPatch(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error) // contains filtered or unexported methods }
EchoServiceServer is the server API for EchoService service. All implementations must embed UnimplementedEchoServiceServer for forward compatibility
type Embedded ¶
type Embedded struct { // Types that are assignable to Mark: // *Embedded_Progress // *Embedded_Note Mark isEmbedded_Mark `protobuf_oneof:"mark"` // contains filtered or unexported fields }
Embedded represents a message embedded in SimpleMessage.
func (*Embedded) Descriptor
deprecated
func (*Embedded) GetProgress ¶
func (*Embedded) ProtoMessage ¶
func (*Embedded) ProtoMessage()
func (*Embedded) ProtoReflect ¶
func (x *Embedded) ProtoReflect() protoreflect.Message
type Embedded_Note ¶
type Embedded_Note struct {
Note string `protobuf:"bytes,2,opt,name=note,proto3,oneof"`
}
type Embedded_Progress ¶
type Embedded_Progress struct {
Progress int64 `protobuf:"varint,1,opt,name=progress,proto3,oneof"`
}
type SimpleMessage ¶
type SimpleMessage struct { // Id represents the message identifier. Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Num int64 `protobuf:"varint,2,opt,name=num,proto3" json:"num,omitempty"` // Types that are assignable to Code: // *SimpleMessage_LineNum // *SimpleMessage_Lang Code isSimpleMessage_Code `protobuf_oneof:"code"` Status *Embedded `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` // Types that are assignable to Ext: // *SimpleMessage_En // *SimpleMessage_No Ext isSimpleMessage_Ext `protobuf_oneof:"ext"` Corpus Corpus `protobuf:"varint,8,opt,name=corpus,proto3,enum=testproto.Corpus" json:"corpus,omitempty"` // contains filtered or unexported fields }
SimpleMessage represents a simple message sent to the Echo service.
func (*SimpleMessage) Descriptor
deprecated
func (*SimpleMessage) Descriptor() ([]byte, []int)
Deprecated: Use SimpleMessage.ProtoReflect.Descriptor instead.
func (*SimpleMessage) GetCode ¶
func (m *SimpleMessage) GetCode() isSimpleMessage_Code
func (*SimpleMessage) GetCorpus ¶
func (x *SimpleMessage) GetCorpus() Corpus
func (*SimpleMessage) GetEn ¶
func (x *SimpleMessage) GetEn() int64
func (*SimpleMessage) GetExt ¶
func (m *SimpleMessage) GetExt() isSimpleMessage_Ext
func (*SimpleMessage) GetId ¶
func (x *SimpleMessage) GetId() string
func (*SimpleMessage) GetLang ¶
func (x *SimpleMessage) GetLang() string
func (*SimpleMessage) GetLineNum ¶
func (x *SimpleMessage) GetLineNum() int64
func (*SimpleMessage) GetNo ¶
func (x *SimpleMessage) GetNo() *Embedded
func (*SimpleMessage) GetNum ¶
func (x *SimpleMessage) GetNum() int64
func (*SimpleMessage) GetStatus ¶
func (x *SimpleMessage) GetStatus() *Embedded
func (*SimpleMessage) ProtoMessage ¶
func (*SimpleMessage) ProtoMessage()
func (*SimpleMessage) ProtoReflect ¶
func (x *SimpleMessage) ProtoReflect() protoreflect.Message
func (*SimpleMessage) Reset ¶
func (x *SimpleMessage) Reset()
func (*SimpleMessage) String ¶
func (x *SimpleMessage) String() string
type SimpleMessage_En ¶
type SimpleMessage_En struct {
En int64 `protobuf:"varint,6,opt,name=en,proto3,oneof"`
}
type SimpleMessage_Lang ¶
type SimpleMessage_Lang struct {
Lang string `protobuf:"bytes,4,opt,name=lang,proto3,oneof"`
}
type SimpleMessage_LineNum ¶
type SimpleMessage_LineNum struct {
LineNum int64 `protobuf:"varint,3,opt,name=line_num,json=lineNum,proto3,oneof"`
}
type SimpleMessage_No ¶
type SimpleMessage_No struct {
No *Embedded `protobuf:"bytes,7,opt,name=no,proto3,oneof"`
}
type StreamServiceClient ¶
type StreamServiceClient interface {
Download(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (StreamService_DownloadClient, error)
}
StreamServiceClient is the client API for StreamService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewStreamServiceClient ¶
func NewStreamServiceClient(cc grpc.ClientConnInterface) StreamServiceClient
type StreamServiceServer ¶
type StreamServiceServer interface { Download(*emptypb.Empty, StreamService_DownloadServer) error // contains filtered or unexported methods }
StreamServiceServer is the server API for StreamService service. All implementations must embed UnimplementedStreamServiceServer for forward compatibility
type StreamService_DownloadClient ¶
type StreamService_DownloadClient interface { Recv() (*httpbody.HttpBody, error) grpc.ClientStream }
type StreamService_DownloadServer ¶
type StreamService_DownloadServer interface { Send(*httpbody.HttpBody) error grpc.ServerStream }
type UnimplementedEchoServiceServer ¶
type UnimplementedEchoServiceServer struct { }
UnimplementedEchoServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedEchoServiceServer) Echo ¶
func (UnimplementedEchoServiceServer) Echo(context.Context, *SimpleMessage) (*SimpleMessage, error)
func (UnimplementedEchoServiceServer) EchoBody ¶
func (UnimplementedEchoServiceServer) EchoBody(context.Context, *SimpleMessage) (*SimpleMessage, error)
func (UnimplementedEchoServiceServer) EchoDelete ¶
func (UnimplementedEchoServiceServer) EchoDelete(context.Context, *SimpleMessage) (*SimpleMessage, error)
func (UnimplementedEchoServiceServer) EchoPatch ¶
func (UnimplementedEchoServiceServer) EchoPatch(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error)
func (UnimplementedEchoServiceServer) EchoResponseBody ¶
func (UnimplementedEchoServiceServer) EchoResponseBody(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error)
type UnimplementedStreamServiceServer ¶
type UnimplementedStreamServiceServer struct { }
UnimplementedStreamServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedStreamServiceServer) Download ¶
func (UnimplementedStreamServiceServer) Download(*emptypb.Empty, StreamService_DownloadServer) error
type UnsafeEchoServiceServer ¶
type UnsafeEchoServiceServer interface {
// contains filtered or unexported methods
}
UnsafeEchoServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to EchoServiceServer will result in compilation errors.
type UnsafeStreamServiceServer ¶
type UnsafeStreamServiceServer interface {
// contains filtered or unexported methods
}
UnsafeStreamServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to StreamServiceServer will result in compilation errors.