github.com/yaoapp/kun@v0.9.0/grpc/proto/model.pb.go (about) 1 // Code generated by protoc-gen-go. DO NOT EDIT. 2 // versions: 3 // protoc-gen-go v1.26.0 4 // protoc v3.17.3 5 // source: model.proto 6 7 package proto 8 9 import ( 10 context "context" 11 grpc "google.golang.org/grpc" 12 codes "google.golang.org/grpc/codes" 13 status "google.golang.org/grpc/status" 14 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 15 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 16 reflect "reflect" 17 sync "sync" 18 ) 19 20 const ( 21 // Verify that this generated code is sufficiently up-to-date. 22 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 23 // Verify that runtime/protoimpl is sufficiently up-to-date. 24 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 25 ) 26 27 type Request struct { 28 state protoimpl.MessageState 29 sizeCache protoimpl.SizeCache 30 unknownFields protoimpl.UnknownFields 31 32 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 33 Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` 34 } 35 36 func (x *Request) Reset() { 37 *x = Request{} 38 if protoimpl.UnsafeEnabled { 39 mi := &file_model_proto_msgTypes[0] 40 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 41 ms.StoreMessageInfo(mi) 42 } 43 } 44 45 func (x *Request) String() string { 46 return protoimpl.X.MessageStringOf(x) 47 } 48 49 func (*Request) ProtoMessage() {} 50 51 func (x *Request) ProtoReflect() protoreflect.Message { 52 mi := &file_model_proto_msgTypes[0] 53 if protoimpl.UnsafeEnabled && x != nil { 54 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 55 if ms.LoadMessageInfo() == nil { 56 ms.StoreMessageInfo(mi) 57 } 58 return ms 59 } 60 return mi.MessageOf(x) 61 } 62 63 // Deprecated: Use Request.ProtoReflect.Descriptor instead. 64 func (*Request) Descriptor() ([]byte, []int) { 65 return file_model_proto_rawDescGZIP(), []int{0} 66 } 67 68 func (x *Request) GetName() string { 69 if x != nil { 70 return x.Name 71 } 72 return "" 73 } 74 75 func (x *Request) GetPayload() []byte { 76 if x != nil { 77 return x.Payload 78 } 79 return nil 80 } 81 82 type Response struct { 83 state protoimpl.MessageState 84 sizeCache protoimpl.SizeCache 85 unknownFields protoimpl.UnknownFields 86 87 Response []byte `protobuf:"bytes,1,opt,name=response,proto3" json:"response,omitempty"` 88 Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` 89 } 90 91 func (x *Response) Reset() { 92 *x = Response{} 93 if protoimpl.UnsafeEnabled { 94 mi := &file_model_proto_msgTypes[1] 95 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 96 ms.StoreMessageInfo(mi) 97 } 98 } 99 100 func (x *Response) String() string { 101 return protoimpl.X.MessageStringOf(x) 102 } 103 104 func (*Response) ProtoMessage() {} 105 106 func (x *Response) ProtoReflect() protoreflect.Message { 107 mi := &file_model_proto_msgTypes[1] 108 if protoimpl.UnsafeEnabled && x != nil { 109 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 110 if ms.LoadMessageInfo() == nil { 111 ms.StoreMessageInfo(mi) 112 } 113 return ms 114 } 115 return mi.MessageOf(x) 116 } 117 118 // Deprecated: Use Response.ProtoReflect.Descriptor instead. 119 func (*Response) Descriptor() ([]byte, []int) { 120 return file_model_proto_rawDescGZIP(), []int{1} 121 } 122 123 func (x *Response) GetResponse() []byte { 124 if x != nil { 125 return x.Response 126 } 127 return nil 128 } 129 130 func (x *Response) GetType() string { 131 if x != nil { 132 return x.Type 133 } 134 return "" 135 } 136 137 var File_model_proto protoreflect.FileDescriptor 138 139 var file_model_proto_rawDesc = []byte{ 140 0x0a, 0x0b, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05, 0x70, 141 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x37, 0x0a, 0x07, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 142 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 143 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x02, 144 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x3a, 0x0a, 145 0x08, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x73, 146 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x72, 0x65, 0x73, 147 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 148 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x32, 0x30, 0x0a, 0x05, 0x4d, 0x6f, 0x64, 149 0x65, 0x6c, 0x12, 0x27, 0x0a, 0x04, 0x45, 0x78, 0x65, 0x63, 0x12, 0x0e, 0x2e, 0x70, 0x72, 0x6f, 150 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x0f, 0x2e, 0x70, 0x72, 0x6f, 151 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x04, 0x5a, 0x02, 0x2e, 152 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 153 } 154 155 var ( 156 file_model_proto_rawDescOnce sync.Once 157 file_model_proto_rawDescData = file_model_proto_rawDesc 158 ) 159 160 func file_model_proto_rawDescGZIP() []byte { 161 file_model_proto_rawDescOnce.Do(func() { 162 file_model_proto_rawDescData = protoimpl.X.CompressGZIP(file_model_proto_rawDescData) 163 }) 164 return file_model_proto_rawDescData 165 } 166 167 var file_model_proto_msgTypes = make([]protoimpl.MessageInfo, 2) 168 var file_model_proto_goTypes = []interface{}{ 169 (*Request)(nil), // 0: proto.Request 170 (*Response)(nil), // 1: proto.Response 171 } 172 var file_model_proto_depIdxs = []int32{ 173 0, // 0: proto.Model.Exec:input_type -> proto.Request 174 1, // 1: proto.Model.Exec:output_type -> proto.Response 175 1, // [1:2] is the sub-list for method output_type 176 0, // [0:1] is the sub-list for method input_type 177 0, // [0:0] is the sub-list for extension type_name 178 0, // [0:0] is the sub-list for extension extendee 179 0, // [0:0] is the sub-list for field type_name 180 } 181 182 func init() { file_model_proto_init() } 183 func file_model_proto_init() { 184 if File_model_proto != nil { 185 return 186 } 187 if !protoimpl.UnsafeEnabled { 188 file_model_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 189 switch v := v.(*Request); i { 190 case 0: 191 return &v.state 192 case 1: 193 return &v.sizeCache 194 case 2: 195 return &v.unknownFields 196 default: 197 return nil 198 } 199 } 200 file_model_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 201 switch v := v.(*Response); i { 202 case 0: 203 return &v.state 204 case 1: 205 return &v.sizeCache 206 case 2: 207 return &v.unknownFields 208 default: 209 return nil 210 } 211 } 212 } 213 type x struct{} 214 out := protoimpl.TypeBuilder{ 215 File: protoimpl.DescBuilder{ 216 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 217 RawDescriptor: file_model_proto_rawDesc, 218 NumEnums: 0, 219 NumMessages: 2, 220 NumExtensions: 0, 221 NumServices: 1, 222 }, 223 GoTypes: file_model_proto_goTypes, 224 DependencyIndexes: file_model_proto_depIdxs, 225 MessageInfos: file_model_proto_msgTypes, 226 }.Build() 227 File_model_proto = out.File 228 file_model_proto_rawDesc = nil 229 file_model_proto_goTypes = nil 230 file_model_proto_depIdxs = nil 231 } 232 233 // Reference imports to suppress errors if they are not otherwise used. 234 var _ context.Context 235 var _ grpc.ClientConnInterface 236 237 // This is a compile-time assertion to ensure that this generated file 238 // is compatible with the grpc package it is being compiled against. 239 const _ = grpc.SupportPackageIsVersion6 240 241 // ModelClient is the client API for Model service. 242 // 243 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 244 type ModelClient interface { 245 Exec(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) 246 } 247 248 type modelClient struct { 249 cc grpc.ClientConnInterface 250 } 251 252 func NewModelClient(cc grpc.ClientConnInterface) ModelClient { 253 return &modelClient{cc} 254 } 255 256 func (c *modelClient) Exec(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) { 257 out := new(Response) 258 err := c.cc.Invoke(ctx, "/proto.Model/Exec", in, out, opts...) 259 if err != nil { 260 return nil, err 261 } 262 return out, nil 263 } 264 265 // ModelServer is the server API for Model service. 266 type ModelServer interface { 267 Exec(context.Context, *Request) (*Response, error) 268 } 269 270 // UnimplementedModelServer can be embedded to have forward compatible implementations. 271 type UnimplementedModelServer struct { 272 } 273 274 func (*UnimplementedModelServer) Exec(context.Context, *Request) (*Response, error) { 275 return nil, status.Errorf(codes.Unimplemented, "method Exec not implemented") 276 } 277 278 func RegisterModelServer(s *grpc.Server, srv ModelServer) { 279 s.RegisterService(&_Model_serviceDesc, srv) 280 } 281 282 func _Model_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 283 in := new(Request) 284 if err := dec(in); err != nil { 285 return nil, err 286 } 287 if interceptor == nil { 288 return srv.(ModelServer).Exec(ctx, in) 289 } 290 info := &grpc.UnaryServerInfo{ 291 Server: srv, 292 FullMethod: "/proto.Model/Exec", 293 } 294 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 295 return srv.(ModelServer).Exec(ctx, req.(*Request)) 296 } 297 return interceptor(ctx, in, info, handler) 298 } 299 300 var _Model_serviceDesc = grpc.ServiceDesc{ 301 ServiceName: "proto.Model", 302 HandlerType: (*ModelServer)(nil), 303 Methods: []grpc.MethodDesc{ 304 { 305 MethodName: "Exec", 306 Handler: _Model_Exec_Handler, 307 }, 308 }, 309 Streams: []grpc.StreamDesc{}, 310 Metadata: "model.proto", 311 }