209 lines
6.5 KiB
Go
209 lines
6.5 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// source: speak.proto
|
|
|
|
package speak
|
|
|
|
import (
|
|
context "context"
|
|
fmt "fmt"
|
|
math "math"
|
|
|
|
proto "github.com/golang/protobuf/proto"
|
|
grpc "google.golang.org/grpc"
|
|
codes "google.golang.org/grpc/codes"
|
|
status "google.golang.org/grpc/status"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the proto package it is being compiled against.
|
|
// A compilation error at this line likely means your copy of the
|
|
// proto package needs to be updated.
|
|
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
|
|
// Request 请求结构
|
|
type Request struct {
|
|
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Request) Reset() { *m = Request{} }
|
|
func (m *Request) String() string { return proto.CompactTextString(m) }
|
|
func (*Request) ProtoMessage() {}
|
|
func (*Request) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_3c7d3e2f29338937, []int{0}
|
|
}
|
|
|
|
func (m *Request) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Request.Unmarshal(m, b)
|
|
}
|
|
func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Request.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Request) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Request.Merge(m, src)
|
|
}
|
|
func (m *Request) XXX_Size() int {
|
|
return xxx_messageInfo_Request.Size(m)
|
|
}
|
|
func (m *Request) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Request.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Request proto.InternalMessageInfo
|
|
|
|
func (m *Request) GetName() string {
|
|
if m != nil {
|
|
return m.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
// Response 响应结构
|
|
type Response struct {
|
|
Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
|
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
|
XXX_unrecognized []byte `json:"-"`
|
|
XXX_sizecache int32 `json:"-"`
|
|
}
|
|
|
|
func (m *Response) Reset() { *m = Response{} }
|
|
func (m *Response) String() string { return proto.CompactTextString(m) }
|
|
func (*Response) ProtoMessage() {}
|
|
func (*Response) Descriptor() ([]byte, []int) {
|
|
return fileDescriptor_3c7d3e2f29338937, []int{1}
|
|
}
|
|
|
|
func (m *Response) XXX_Unmarshal(b []byte) error {
|
|
return xxx_messageInfo_Response.Unmarshal(m, b)
|
|
}
|
|
func (m *Response) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
return xxx_messageInfo_Response.Marshal(b, m, deterministic)
|
|
}
|
|
func (m *Response) XXX_Merge(src proto.Message) {
|
|
xxx_messageInfo_Response.Merge(m, src)
|
|
}
|
|
func (m *Response) XXX_Size() int {
|
|
return xxx_messageInfo_Response.Size(m)
|
|
}
|
|
func (m *Response) XXX_DiscardUnknown() {
|
|
xxx_messageInfo_Response.DiscardUnknown(m)
|
|
}
|
|
|
|
var xxx_messageInfo_Response proto.InternalMessageInfo
|
|
|
|
func (m *Response) GetMessage() string {
|
|
if m != nil {
|
|
return m.Message
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*Request)(nil), "speak.Request")
|
|
proto.RegisterType((*Response)(nil), "speak.Response")
|
|
}
|
|
|
|
func init() { proto.RegisterFile("speak.proto", fileDescriptor_3c7d3e2f29338937) }
|
|
|
|
var fileDescriptor_3c7d3e2f29338937 = []byte{
|
|
// 132 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x2e, 0x2e, 0x48, 0x4d,
|
|
0xcc, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x05, 0x73, 0x94, 0x64, 0xb9, 0xd8, 0x83,
|
|
0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x84, 0x84, 0xb8, 0x58, 0xf2, 0x12, 0x73, 0x53, 0x25, 0x18,
|
|
0x15, 0x18, 0x35, 0x38, 0x83, 0xc0, 0x6c, 0x25, 0x15, 0x2e, 0x8e, 0xa0, 0xd4, 0xe2, 0x82, 0xfc,
|
|
0xbc, 0xe2, 0x54, 0x21, 0x09, 0x2e, 0xf6, 0xdc, 0xd4, 0xe2, 0xe2, 0xc4, 0x74, 0x98, 0x12, 0x18,
|
|
0xd7, 0xc8, 0x9c, 0x8b, 0x35, 0x18, 0x64, 0x9a, 0x90, 0x1e, 0x17, 0x27, 0x98, 0xe1, 0x92, 0x58,
|
|
0x92, 0x28, 0xc4, 0xa7, 0x07, 0xb1, 0x0f, 0x6a, 0xbe, 0x14, 0x3f, 0x9c, 0x0f, 0x31, 0x50, 0x89,
|
|
0x21, 0x89, 0x0d, 0xec, 0x16, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x04, 0x6f, 0x05,
|
|
0x9a, 0x00, 0x00, 0x00,
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// SpeakClient is the client API for Speak service.
|
|
//
|
|
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
|
|
type SpeakClient interface {
|
|
// 定义方法
|
|
SpeakData(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
|
|
}
|
|
|
|
type speakClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewSpeakClient(cc *grpc.ClientConn) SpeakClient {
|
|
return &speakClient{cc}
|
|
}
|
|
|
|
func (c *speakClient) SpeakData(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) {
|
|
out := new(Response)
|
|
err := c.cc.Invoke(ctx, "/speak.Speak/SpeakData", in, out, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// SpeakServer is the server API for Speak service.
|
|
type SpeakServer interface {
|
|
// 定义方法
|
|
SpeakData(context.Context, *Request) (*Response, error)
|
|
}
|
|
|
|
// UnimplementedSpeakServer can be embedded to have forward compatible implementations.
|
|
type UnimplementedSpeakServer struct {
|
|
}
|
|
|
|
func (*UnimplementedSpeakServer) SpeakData(ctx context.Context, req *Request) (*Response, error) {
|
|
return nil, status.Errorf(codes.Unimplemented, "method SpeakData not implemented")
|
|
}
|
|
|
|
func RegisterSpeakServer(s *grpc.Server, srv SpeakServer) {
|
|
s.RegisterService(&_Speak_serviceDesc, srv)
|
|
}
|
|
|
|
func _Speak_SpeakData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(Request)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(SpeakServer).SpeakData(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/speak.Speak/SpeakData",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(SpeakServer).SpeakData(ctx, req.(*Request))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _Speak_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "speak.Speak",
|
|
HandlerType: (*SpeakServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "SpeakData",
|
|
Handler: _Speak_SpeakData_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "speak.proto",
|
|
}
|