github.com/tickoalcantara12/micro/v3@v3.0.0-20221007104245-9d75b9bcbab9/proto/runtime/runtime.pb.micro.go (about) 1 // Code generated by protoc-gen-micro. DO NOT EDIT. 2 // source: proto/runtime/runtime.proto 3 4 package runtime 5 6 import ( 7 fmt "fmt" 8 proto "github.com/golang/protobuf/proto" 9 math "math" 10 ) 11 12 import ( 13 context "context" 14 api "github.com/tickoalcantara12/micro/v3/service/api" 15 client "github.com/tickoalcantara12/micro/v3/service/client" 16 server "github.com/tickoalcantara12/micro/v3/service/server" 17 ) 18 19 // Reference imports to suppress errors if they are not otherwise used. 20 var _ = proto.Marshal 21 var _ = fmt.Errorf 22 var _ = math.Inf 23 24 // This is a compile-time assertion to ensure that this generated file 25 // is compatible with the proto package it is being compiled against. 26 // A compilation error at this line likely means your copy of the 27 // proto package needs to be updated. 28 const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 29 30 // Reference imports to suppress errors if they are not otherwise used. 31 var _ api.Endpoint 32 var _ context.Context 33 var _ client.Option 34 var _ server.Option 35 36 // Api Endpoints for Runtime service 37 38 func NewRuntimeEndpoints() []*api.Endpoint { 39 return []*api.Endpoint{} 40 } 41 42 // Client API for Runtime service 43 44 type RuntimeService interface { 45 Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error) 46 Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) 47 Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) 48 Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error) 49 Logs(ctx context.Context, in *LogsRequest, opts ...client.CallOption) (Runtime_LogsService, error) 50 } 51 52 type runtimeService struct { 53 c client.Client 54 name string 55 } 56 57 func NewRuntimeService(name string, c client.Client) RuntimeService { 58 return &runtimeService{ 59 c: c, 60 name: name, 61 } 62 } 63 64 func (c *runtimeService) Create(ctx context.Context, in *CreateRequest, opts ...client.CallOption) (*CreateResponse, error) { 65 req := c.c.NewRequest(c.name, "Runtime.Create", in) 66 out := new(CreateResponse) 67 err := c.c.Call(ctx, req, out, opts...) 68 if err != nil { 69 return nil, err 70 } 71 return out, nil 72 } 73 74 func (c *runtimeService) Read(ctx context.Context, in *ReadRequest, opts ...client.CallOption) (*ReadResponse, error) { 75 req := c.c.NewRequest(c.name, "Runtime.Read", in) 76 out := new(ReadResponse) 77 err := c.c.Call(ctx, req, out, opts...) 78 if err != nil { 79 return nil, err 80 } 81 return out, nil 82 } 83 84 func (c *runtimeService) Delete(ctx context.Context, in *DeleteRequest, opts ...client.CallOption) (*DeleteResponse, error) { 85 req := c.c.NewRequest(c.name, "Runtime.Delete", in) 86 out := new(DeleteResponse) 87 err := c.c.Call(ctx, req, out, opts...) 88 if err != nil { 89 return nil, err 90 } 91 return out, nil 92 } 93 94 func (c *runtimeService) Update(ctx context.Context, in *UpdateRequest, opts ...client.CallOption) (*UpdateResponse, error) { 95 req := c.c.NewRequest(c.name, "Runtime.Update", in) 96 out := new(UpdateResponse) 97 err := c.c.Call(ctx, req, out, opts...) 98 if err != nil { 99 return nil, err 100 } 101 return out, nil 102 } 103 104 func (c *runtimeService) Logs(ctx context.Context, in *LogsRequest, opts ...client.CallOption) (Runtime_LogsService, error) { 105 req := c.c.NewRequest(c.name, "Runtime.Logs", &LogsRequest{}) 106 stream, err := c.c.Stream(ctx, req, opts...) 107 if err != nil { 108 return nil, err 109 } 110 if err := stream.Send(in); err != nil { 111 return nil, err 112 } 113 return &runtimeServiceLogs{stream}, nil 114 } 115 116 type Runtime_LogsService interface { 117 Context() context.Context 118 SendMsg(interface{}) error 119 RecvMsg(interface{}) error 120 Close() error 121 Recv() (*LogRecord, error) 122 } 123 124 type runtimeServiceLogs struct { 125 stream client.Stream 126 } 127 128 func (x *runtimeServiceLogs) Close() error { 129 return x.stream.Close() 130 } 131 132 func (x *runtimeServiceLogs) Context() context.Context { 133 return x.stream.Context() 134 } 135 136 func (x *runtimeServiceLogs) SendMsg(m interface{}) error { 137 return x.stream.Send(m) 138 } 139 140 func (x *runtimeServiceLogs) RecvMsg(m interface{}) error { 141 return x.stream.Recv(m) 142 } 143 144 func (x *runtimeServiceLogs) Recv() (*LogRecord, error) { 145 m := new(LogRecord) 146 err := x.stream.Recv(m) 147 if err != nil { 148 return nil, err 149 } 150 return m, nil 151 } 152 153 // Server API for Runtime service 154 155 type RuntimeHandler interface { 156 Create(context.Context, *CreateRequest, *CreateResponse) error 157 Read(context.Context, *ReadRequest, *ReadResponse) error 158 Delete(context.Context, *DeleteRequest, *DeleteResponse) error 159 Update(context.Context, *UpdateRequest, *UpdateResponse) error 160 Logs(context.Context, *LogsRequest, Runtime_LogsStream) error 161 } 162 163 func RegisterRuntimeHandler(s server.Server, hdlr RuntimeHandler, opts ...server.HandlerOption) error { 164 type runtime interface { 165 Create(ctx context.Context, in *CreateRequest, out *CreateResponse) error 166 Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error 167 Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error 168 Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error 169 Logs(ctx context.Context, stream server.Stream) error 170 } 171 type Runtime struct { 172 runtime 173 } 174 h := &runtimeHandler{hdlr} 175 return s.Handle(s.NewHandler(&Runtime{h}, opts...)) 176 } 177 178 type runtimeHandler struct { 179 RuntimeHandler 180 } 181 182 func (h *runtimeHandler) Create(ctx context.Context, in *CreateRequest, out *CreateResponse) error { 183 return h.RuntimeHandler.Create(ctx, in, out) 184 } 185 186 func (h *runtimeHandler) Read(ctx context.Context, in *ReadRequest, out *ReadResponse) error { 187 return h.RuntimeHandler.Read(ctx, in, out) 188 } 189 190 func (h *runtimeHandler) Delete(ctx context.Context, in *DeleteRequest, out *DeleteResponse) error { 191 return h.RuntimeHandler.Delete(ctx, in, out) 192 } 193 194 func (h *runtimeHandler) Update(ctx context.Context, in *UpdateRequest, out *UpdateResponse) error { 195 return h.RuntimeHandler.Update(ctx, in, out) 196 } 197 198 func (h *runtimeHandler) Logs(ctx context.Context, stream server.Stream) error { 199 m := new(LogsRequest) 200 if err := stream.Recv(m); err != nil { 201 return err 202 } 203 return h.RuntimeHandler.Logs(ctx, m, &runtimeLogsStream{stream}) 204 } 205 206 type Runtime_LogsStream interface { 207 Context() context.Context 208 SendMsg(interface{}) error 209 RecvMsg(interface{}) error 210 Close() error 211 Send(*LogRecord) error 212 } 213 214 type runtimeLogsStream struct { 215 stream server.Stream 216 } 217 218 func (x *runtimeLogsStream) Close() error { 219 return x.stream.Close() 220 } 221 222 func (x *runtimeLogsStream) Context() context.Context { 223 return x.stream.Context() 224 } 225 226 func (x *runtimeLogsStream) SendMsg(m interface{}) error { 227 return x.stream.Send(m) 228 } 229 230 func (x *runtimeLogsStream) RecvMsg(m interface{}) error { 231 return x.stream.Recv(m) 232 } 233 234 func (x *runtimeLogsStream) Send(m *LogRecord) error { 235 return x.stream.Send(m) 236 } 237 238 // Api Endpoints for Source service 239 240 func NewSourceEndpoints() []*api.Endpoint { 241 return []*api.Endpoint{} 242 } 243 244 // Client API for Source service 245 246 type SourceService interface { 247 Upload(ctx context.Context, opts ...client.CallOption) (Source_UploadService, error) 248 } 249 250 type sourceService struct { 251 c client.Client 252 name string 253 } 254 255 func NewSourceService(name string, c client.Client) SourceService { 256 return &sourceService{ 257 c: c, 258 name: name, 259 } 260 } 261 262 func (c *sourceService) Upload(ctx context.Context, opts ...client.CallOption) (Source_UploadService, error) { 263 req := c.c.NewRequest(c.name, "Source.Upload", &UploadRequest{}) 264 stream, err := c.c.Stream(ctx, req, opts...) 265 if err != nil { 266 return nil, err 267 } 268 return &sourceServiceUpload{stream}, nil 269 } 270 271 type Source_UploadService interface { 272 Context() context.Context 273 SendMsg(interface{}) error 274 RecvMsg(interface{}) error 275 CloseAndRecv() (*UploadResponse, error) 276 Send(*UploadRequest) error 277 } 278 279 type sourceServiceUpload struct { 280 stream client.Stream 281 } 282 283 func (x *sourceServiceUpload) CloseAndRecv() (*UploadResponse, error) { 284 if err := x.stream.Close(); err != nil { 285 return nil, err 286 } 287 r := new(UploadResponse) 288 err := x.RecvMsg(r) 289 return r, err 290 } 291 292 func (x *sourceServiceUpload) Context() context.Context { 293 return x.stream.Context() 294 } 295 296 func (x *sourceServiceUpload) SendMsg(m interface{}) error { 297 return x.stream.Send(m) 298 } 299 300 func (x *sourceServiceUpload) RecvMsg(m interface{}) error { 301 return x.stream.Recv(m) 302 } 303 304 func (x *sourceServiceUpload) Send(m *UploadRequest) error { 305 return x.stream.Send(m) 306 } 307 308 // Server API for Source service 309 310 type SourceHandler interface { 311 Upload(context.Context, Source_UploadStream) error 312 } 313 314 func RegisterSourceHandler(s server.Server, hdlr SourceHandler, opts ...server.HandlerOption) error { 315 type source interface { 316 Upload(ctx context.Context, stream server.Stream) error 317 } 318 type Source struct { 319 source 320 } 321 h := &sourceHandler{hdlr} 322 return s.Handle(s.NewHandler(&Source{h}, opts...)) 323 } 324 325 type sourceHandler struct { 326 SourceHandler 327 } 328 329 func (h *sourceHandler) Upload(ctx context.Context, stream server.Stream) error { 330 return h.SourceHandler.Upload(ctx, &sourceUploadStream{stream}) 331 } 332 333 type Source_UploadStream interface { 334 Context() context.Context 335 SendMsg(interface{}) error 336 RecvMsg(interface{}) error 337 SendAndClose(*UploadResponse) error 338 Recv() (*UploadRequest, error) 339 } 340 341 type sourceUploadStream struct { 342 stream server.Stream 343 } 344 345 func (x *sourceUploadStream) SendAndClose(in *UploadResponse) error { 346 if err := x.SendMsg(in); err != nil { 347 return err 348 } 349 return x.stream.Close() 350 } 351 352 func (x *sourceUploadStream) Context() context.Context { 353 return x.stream.Context() 354 } 355 356 func (x *sourceUploadStream) SendMsg(m interface{}) error { 357 return x.stream.Send(m) 358 } 359 360 func (x *sourceUploadStream) RecvMsg(m interface{}) error { 361 return x.stream.Recv(m) 362 } 363 364 func (x *sourceUploadStream) Recv() (*UploadRequest, error) { 365 m := new(UploadRequest) 366 if err := x.stream.Recv(m); err != nil { 367 return nil, err 368 } 369 return m, nil 370 } 371 372 // Api Endpoints for Build service 373 374 func NewBuildEndpoints() []*api.Endpoint { 375 return []*api.Endpoint{} 376 } 377 378 // Client API for Build service 379 380 type BuildService interface { 381 Read(ctx context.Context, in *Service, opts ...client.CallOption) (Build_ReadService, error) 382 } 383 384 type buildService struct { 385 c client.Client 386 name string 387 } 388 389 func NewBuildService(name string, c client.Client) BuildService { 390 return &buildService{ 391 c: c, 392 name: name, 393 } 394 } 395 396 func (c *buildService) Read(ctx context.Context, in *Service, opts ...client.CallOption) (Build_ReadService, error) { 397 req := c.c.NewRequest(c.name, "Build.Read", &Service{}) 398 stream, err := c.c.Stream(ctx, req, opts...) 399 if err != nil { 400 return nil, err 401 } 402 if err := stream.Send(in); err != nil { 403 return nil, err 404 } 405 return &buildServiceRead{stream}, nil 406 } 407 408 type Build_ReadService interface { 409 Context() context.Context 410 SendMsg(interface{}) error 411 RecvMsg(interface{}) error 412 Close() error 413 Recv() (*BuildReadResponse, error) 414 } 415 416 type buildServiceRead struct { 417 stream client.Stream 418 } 419 420 func (x *buildServiceRead) Close() error { 421 return x.stream.Close() 422 } 423 424 func (x *buildServiceRead) Context() context.Context { 425 return x.stream.Context() 426 } 427 428 func (x *buildServiceRead) SendMsg(m interface{}) error { 429 return x.stream.Send(m) 430 } 431 432 func (x *buildServiceRead) RecvMsg(m interface{}) error { 433 return x.stream.Recv(m) 434 } 435 436 func (x *buildServiceRead) Recv() (*BuildReadResponse, error) { 437 m := new(BuildReadResponse) 438 err := x.stream.Recv(m) 439 if err != nil { 440 return nil, err 441 } 442 return m, nil 443 } 444 445 // Server API for Build service 446 447 type BuildHandler interface { 448 Read(context.Context, *Service, Build_ReadStream) error 449 } 450 451 func RegisterBuildHandler(s server.Server, hdlr BuildHandler, opts ...server.HandlerOption) error { 452 type build interface { 453 Read(ctx context.Context, stream server.Stream) error 454 } 455 type Build struct { 456 build 457 } 458 h := &buildHandler{hdlr} 459 return s.Handle(s.NewHandler(&Build{h}, opts...)) 460 } 461 462 type buildHandler struct { 463 BuildHandler 464 } 465 466 func (h *buildHandler) Read(ctx context.Context, stream server.Stream) error { 467 m := new(Service) 468 if err := stream.Recv(m); err != nil { 469 return err 470 } 471 return h.BuildHandler.Read(ctx, m, &buildReadStream{stream}) 472 } 473 474 type Build_ReadStream interface { 475 Context() context.Context 476 SendMsg(interface{}) error 477 RecvMsg(interface{}) error 478 Close() error 479 Send(*BuildReadResponse) error 480 } 481 482 type buildReadStream struct { 483 stream server.Stream 484 } 485 486 func (x *buildReadStream) Close() error { 487 return x.stream.Close() 488 } 489 490 func (x *buildReadStream) Context() context.Context { 491 return x.stream.Context() 492 } 493 494 func (x *buildReadStream) SendMsg(m interface{}) error { 495 return x.stream.Send(m) 496 } 497 498 func (x *buildReadStream) RecvMsg(m interface{}) error { 499 return x.stream.Recv(m) 500 } 501 502 func (x *buildReadStream) Send(m *BuildReadResponse) error { 503 return x.stream.Send(m) 504 }