diff --git a/Makefile b/Makefile index 68fa105485..8f2ec095c3 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,7 @@ include make/golang.mk include make/image.mk include make/wasm.mk include make/ci.mk +include make/proto.mk # ============================================================================== # Targets: @@ -246,6 +247,27 @@ format: go.format clean: @$(MAKE) go.clean +# ============================================================================== +## proto.doc: Generate documentation according to the proto files. +# ============================================================================== +.PHONY: proto.doc +proto.doc: + @$(MAKE) proto.gen.doc + +# ============================================================================== +## proto.init: Install protoc-gen-go and protoc-gen-go-grpc +# ============================================================================== +.PHONY: proto.init +proto.init: + @$(MAKE) proto.gen.init + +# ============================================================================== +## proto.code: Generate pb.go code according to the proto files. +# ============================================================================== +.PHONY: proto.code +proto.code: + @$(MAKE) proto.gen.code + # ============================================================================== ## all: Run format codes, check codes, build Layotto codes for host platform with one command # ============================================================================== diff --git a/docker/proto/Dockerfile b/docker/proto/Dockerfile new file mode 100644 index 0000000000..354197f377 --- /dev/null +++ b/docker/proto/Dockerfile @@ -0,0 +1,38 @@ +# Copyright 2021 Layotto Authors +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM golang:1.16 + +# install unzip +RUN apt-get update +RUN apt-get install -y unzip + +WORKDIR /api + +# install protoc +RUN PB_REL="https://github.com/protocolbuffers/protobuf/releases" && \ + curl -LO $PB_REL/download/v3.17.3/protoc-3.17.3-linux-x86_64.zip + +RUN unzip protoc-3.17.3-linux-x86_64.zip -d /api/protoc + +ENV PATH="$PATH:/api/protoc/bin" +RUN protoc --version + +# install protoc-gen-go and protoc-gen-go-grpc +RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 +RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 + +WORKDIR /api/proto + +# generate code +CMD protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=require_unimplemented_servers=false,paths=source_relative *.proto \ No newline at end of file diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 9073c58b59..2bfe52b6b8 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -80,10 +80,10 @@ - [Document Contribution Guide](en/development/contributing-doc.md) - [Automate testing of Quickstart documentation with tools](en/development/test-quickstart.md) - [Component Development Guide](en/development/developing-component.md) - - You wanna modify proto files or API definition? + - Want to modify proto files or API definition? - [Development specification when adding API](en/development/developing-api.md) - [Comment specification of proto file](en/api_reference/comment_spec_of_proto.md) - - [How to generate API document based on the proto files](en/api_reference/how_to_generate_api_doc.md) + - [How to generate pb code and API reference](en/api_reference/how_to_generate_api_doc.md) - [Layotto Github Workflows Guide](en/development/github-workflows.md) - [Layotto Commands Guide](en/development/commands.md) - [Layotto contributor guide](en/development/CONTRIBUTING.md) diff --git a/docs/en/api_reference/how_to_generate_api_doc.md b/docs/en/api_reference/how_to_generate_api_doc.md index b74f837b3e..50856ecf1e 100644 --- a/docs/en/api_reference/how_to_generate_api_doc.md +++ b/docs/en/api_reference/how_to_generate_api_doc.md @@ -1,7 +1,38 @@ -# How to generate api documents +# How to generate `.pb.go` code and API reference +Note: the commands below should be executed under layotto directory +## How to compile the proto files into `.pb.go` code + +### **Make cmmand(recommended)** +```bash +make proto.code +``` +This command uses docker to run protoc and generate `.pb.go` code files. + +### **Install protoc** +1. Install protoc version: [v3.17.3](https://github.com/protocolbuffers/protobuf/releases/tag/v3.17.3) + +2. Install protoc-gen-go v1.28 and protoc-gen-go-grpc v1.2 + +3. Generate gRPC `.pb.go` code + +```bash +cd spec/proto/runtime/v1 +protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=require_unimplemented_servers=false,paths=source_relative *.proto +``` + +## How to generate API reference doc according to the proto files We can use [protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) and docker to generate api documents,the command is as follows: -(Run in layotto directory) + + +### **Make command(recommended)** +```bash +make proto.doc +``` +This command uses docker to run protoc-gen-doc and generate docs. + +### **Use docker to run protoc-gen-doc** +`make proto.doc` essentially run commands below: ``` docker run --rm \ @@ -17,4 +48,6 @@ docker run --rm \ -v $(pwd)/docs/en/api_reference:/out \ -v $(pwd)/spec/proto/runtime/v1:/protos \ pseudomuto/protoc-gen-doc --doc_opt=/protos/template.tmpl,appcallback_v1.md appcallback.proto -``` \ No newline at end of file +``` + + \ No newline at end of file diff --git a/docs/zh/_sidebar.md b/docs/zh/_sidebar.md index e8e4ee037f..a6c81aa066 100644 --- a/docs/zh/_sidebar.md +++ b/docs/zh/_sidebar.md @@ -99,7 +99,7 @@ - 想要修改proto文件或API定义? - [新增API时的开发规范](zh/development/developing-api.md) - [proto文件注释规范](zh/api_reference/comment_spec_of_proto.md) - - [如何基于proto文件生成接口文档](zh/api_reference/how_to_generate_api_doc.md) + - [如何基于proto文件生成代码、接口文档](zh/api_reference/how_to_generate_api_doc.md) - [Layotto 四大 Github Workflows 说明](zh/development/github-workflows.md) - [Layotto 命令行工具指南](zh/development/commands.md) - [发布手册](zh/development/release-guide.md) diff --git a/docs/zh/api_reference/how_to_generate_api_doc.md b/docs/zh/api_reference/how_to_generate_api_doc.md index cc883afc87..a2349eaed3 100644 --- a/docs/zh/api_reference/how_to_generate_api_doc.md +++ b/docs/zh/api_reference/how_to_generate_api_doc.md @@ -1,8 +1,44 @@ -# 如何基于proto文件生成接口文档 +# 如何基于proto文件生成代码、接口文档 +## 如何把 proto 文件编译成`.pb.go`代码 + +### **Make 命令生成(推荐)** +本地启动 docker 后,在项目根目录下运行: -我们可以用[protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) 和docker来生成接口文档,相关命令如下: -(需要在layotto项目下运行命令) +```bash +make proto.code +``` +该命令会用 docker 启动 protoc,生成`.pb.go`代码。 + +这种方式更方便,开发者不需要修改本地 protoc 版本,省去了很多烦恼。 + +### **手动安装工具** +1. Install protoc version: [v3.17.3](https://github.com/protocolbuffers/protobuf/releases/tag/v3.17.3) + +2. Install protoc-gen-go v1.28 and protoc-gen-go-grpc v1.2 + +3. Generate gRPC `.pb.go` code + +```bash +cd spec/proto/runtime/v1 +protoc -I. --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=require_unimplemented_servers=false,paths=source_relative *.proto +``` + +## 如何基于proto文件生成接口文档 + +我们可以用[protoc-gen-doc](https://github.com/pseudomuto/protoc-gen-doc) 和docker来生成接口文档,相关命令如下: + + +### **Make 命令生成(推荐)** +本地启动 docker 后,在项目根目录下运行: + +```bash +make proto.doc +``` +该命令会用 docker 启动 protoc-gen-doc,生成文档 + +### **用 docker 启动 protoc-gen-doc** +`make proto.doc` 等价于执行以下命令: ``` docker run --rm \ @@ -18,4 +54,5 @@ docker run --rm \ -v $(pwd)/docs/en/api_reference:/out \ -v $(pwd)/spec/proto/runtime/v1:/protos \ pseudomuto/protoc-gen-doc --doc_opt=/protos/template.tmpl,appcallback_v1.md appcallback.proto -``` \ No newline at end of file +``` + \ No newline at end of file diff --git a/make/proto.mk b/make/proto.mk new file mode 100644 index 0000000000..fd10bceedf --- /dev/null +++ b/make/proto.mk @@ -0,0 +1,35 @@ +# Copyright 2021 Layotto Authors +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +.PHONY: proto.gen.doc +proto.gen.doc: + $(DOCKER) run --rm \ + -v $(ROOT_DIR)/docs/en/api_reference:/out \ + -v $(ROOT_DIR)/spec/proto/runtime/v1:/protos \ + pseudomuto/protoc-gen-doc --doc_opt=/protos/template.tmpl,runtime_v1.md runtime.proto + $(DOCKER) run --rm \ + -v $(ROOT_DIR)/docs/en/api_reference:/out \ + -v $(ROOT_DIR)/spec/proto/runtime/v1:/protos \ + pseudomuto/protoc-gen-doc --doc_opt=/protos/template.tmpl,appcallback_v1.md appcallback.proto + +.PHONY: proto.gen.init +proto.gen.init: + go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28 + go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2 + +.PHONY: proto.gen.code +proto.gen.code: + $(DOCKER) build -t layotto/protoc $(ROOT_DIR)/docker/proto && \ + $(DOCKER) run --rm \ + -v $(ROOT_DIR)/spec/proto/runtime/v1:/api/proto \ + layotto/protoc diff --git a/spec/proto/runtime/v1/README.md b/spec/proto/runtime/v1/README.md index 3e6b81950b..11a4f06891 100644 --- a/spec/proto/runtime/v1/README.md +++ b/spec/proto/runtime/v1/README.md @@ -1,12 +1,3 @@ -## How to compile these proto files into golang code -```shell -cd ${your PROJECT path}/spec/proto/runtime/v1 -protoc -I. --go_out=plugins=grpc,paths=source_relative:. *.proto -``` - -my protoc version: -```shell -$ protoc --version -libprotoc 3.11.2 -``` +## How to compile these proto files into golang code and documentation +Please visit https://mosn.io/layotto/#/en/api_reference/how_to_generate_api_doc \ No newline at end of file diff --git a/spec/proto/runtime/v1/appcallback.pb.go b/spec/proto/runtime/v1/appcallback.pb.go index c41982798a..0575000e72 100644 --- a/spec/proto/runtime/v1/appcallback.pb.go +++ b/spec/proto/runtime/v1/appcallback.pb.go @@ -1,19 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.19.4 +// protoc-gen-go v1.28.0 +// protoc v3.17.3 // source: appcallback.proto package runtime import ( - context "context" reflect "reflect" sync "sync" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" emptypb "google.golang.org/protobuf/types/known/emptypb" @@ -573,123 +569,3 @@ func file_appcallback_proto_init() { file_appcallback_proto_goTypes = nil file_appcallback_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// 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.SupportPackageIsVersion6 - -// AppCallbackClient is the client API for AppCallback service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type AppCallbackClient interface { - // Lists all topics subscribed by this app. - ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) - // Subscribes events from Pubsub - OnTopicEvent(ctx context.Context, in *TopicEventRequest, opts ...grpc.CallOption) (*TopicEventResponse, error) -} - -type appCallbackClient struct { - cc grpc.ClientConnInterface -} - -func NewAppCallbackClient(cc grpc.ClientConnInterface) AppCallbackClient { - return &appCallbackClient{cc} -} - -func (c *appCallbackClient) ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) { - out := new(ListTopicSubscriptionsResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.AppCallback/ListTopicSubscriptions", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *appCallbackClient) OnTopicEvent(ctx context.Context, in *TopicEventRequest, opts ...grpc.CallOption) (*TopicEventResponse, error) { - out := new(TopicEventResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.AppCallback/OnTopicEvent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// AppCallbackServer is the server API for AppCallback service. -type AppCallbackServer interface { - // Lists all topics subscribed by this app. - ListTopicSubscriptions(context.Context, *emptypb.Empty) (*ListTopicSubscriptionsResponse, error) - // Subscribes events from Pubsub - OnTopicEvent(context.Context, *TopicEventRequest) (*TopicEventResponse, error) -} - -// UnimplementedAppCallbackServer can be embedded to have forward compatible implementations. -type UnimplementedAppCallbackServer struct { -} - -func (*UnimplementedAppCallbackServer) ListTopicSubscriptions(context.Context, *emptypb.Empty) (*ListTopicSubscriptionsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListTopicSubscriptions not implemented") -} -func (*UnimplementedAppCallbackServer) OnTopicEvent(context.Context, *TopicEventRequest) (*TopicEventResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method OnTopicEvent not implemented") -} - -func RegisterAppCallbackServer(s *grpc.Server, srv AppCallbackServer) { - s.RegisterService(&_AppCallback_serviceDesc, srv) -} - -func _AppCallback_ListTopicSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(emptypb.Empty) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppCallbackServer).ListTopicSubscriptions(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.AppCallback/ListTopicSubscriptions", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppCallbackServer).ListTopicSubscriptions(ctx, req.(*emptypb.Empty)) - } - return interceptor(ctx, in, info, handler) -} - -func _AppCallback_OnTopicEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TopicEventRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(AppCallbackServer).OnTopicEvent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.AppCallback/OnTopicEvent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AppCallbackServer).OnTopicEvent(ctx, req.(*TopicEventRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _AppCallback_serviceDesc = grpc.ServiceDesc{ - ServiceName: "spec.proto.runtime.v1.AppCallback", - HandlerType: (*AppCallbackServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ListTopicSubscriptions", - Handler: _AppCallback_ListTopicSubscriptions_Handler, - }, - { - MethodName: "OnTopicEvent", - Handler: _AppCallback_OnTopicEvent_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "appcallback.proto", -} diff --git a/spec/proto/runtime/v1/appcallback_grpc.pb.go b/spec/proto/runtime/v1/appcallback_grpc.pb.go new file mode 100644 index 0000000000..3b052baa9c --- /dev/null +++ b/spec/proto/runtime/v1/appcallback_grpc.pb.go @@ -0,0 +1,145 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: appcallback.proto + +package runtime + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// AppCallbackClient is the client API for AppCallback 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. +type AppCallbackClient interface { + // Lists all topics subscribed by this app. + ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) + // Subscribes events from Pubsub + OnTopicEvent(ctx context.Context, in *TopicEventRequest, opts ...grpc.CallOption) (*TopicEventResponse, error) +} + +type appCallbackClient struct { + cc grpc.ClientConnInterface +} + +func NewAppCallbackClient(cc grpc.ClientConnInterface) AppCallbackClient { + return &appCallbackClient{cc} +} + +func (c *appCallbackClient) ListTopicSubscriptions(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListTopicSubscriptionsResponse, error) { + out := new(ListTopicSubscriptionsResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.AppCallback/ListTopicSubscriptions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *appCallbackClient) OnTopicEvent(ctx context.Context, in *TopicEventRequest, opts ...grpc.CallOption) (*TopicEventResponse, error) { + out := new(TopicEventResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.AppCallback/OnTopicEvent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// AppCallbackServer is the server API for AppCallback service. +// All implementations should embed UnimplementedAppCallbackServer +// for forward compatibility +type AppCallbackServer interface { + // Lists all topics subscribed by this app. + ListTopicSubscriptions(context.Context, *emptypb.Empty) (*ListTopicSubscriptionsResponse, error) + // Subscribes events from Pubsub + OnTopicEvent(context.Context, *TopicEventRequest) (*TopicEventResponse, error) +} + +// UnimplementedAppCallbackServer should be embedded to have forward compatible implementations. +type UnimplementedAppCallbackServer struct { +} + +func (UnimplementedAppCallbackServer) ListTopicSubscriptions(context.Context, *emptypb.Empty) (*ListTopicSubscriptionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListTopicSubscriptions not implemented") +} +func (UnimplementedAppCallbackServer) OnTopicEvent(context.Context, *TopicEventRequest) (*TopicEventResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method OnTopicEvent not implemented") +} + +// UnsafeAppCallbackServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to AppCallbackServer will +// result in compilation errors. +type UnsafeAppCallbackServer interface { + mustEmbedUnimplementedAppCallbackServer() +} + +func RegisterAppCallbackServer(s grpc.ServiceRegistrar, srv AppCallbackServer) { + s.RegisterService(&AppCallback_ServiceDesc, srv) +} + +func _AppCallback_ListTopicSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(emptypb.Empty) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppCallbackServer).ListTopicSubscriptions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.AppCallback/ListTopicSubscriptions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppCallbackServer).ListTopicSubscriptions(ctx, req.(*emptypb.Empty)) + } + return interceptor(ctx, in, info, handler) +} + +func _AppCallback_OnTopicEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TopicEventRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AppCallbackServer).OnTopicEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.AppCallback/OnTopicEvent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AppCallbackServer).OnTopicEvent(ctx, req.(*TopicEventRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// AppCallback_ServiceDesc is the grpc.ServiceDesc for AppCallback service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var AppCallback_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spec.proto.runtime.v1.AppCallback", + HandlerType: (*AppCallbackServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListTopicSubscriptions", + Handler: _AppCallback_ListTopicSubscriptions_Handler, + }, + { + MethodName: "OnTopicEvent", + Handler: _AppCallback_OnTopicEvent_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "appcallback.proto", +} diff --git a/spec/proto/runtime/v1/runtime.pb.go b/spec/proto/runtime/v1/runtime.pb.go index 85cdab2b40..33cce02782 100644 --- a/spec/proto/runtime/v1/runtime.pb.go +++ b/spec/proto/runtime/v1/runtime.pb.go @@ -1,19 +1,15 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 -// protoc v3.19.4 +// protoc-gen-go v1.28.0 +// protoc v3.17.3 // source: runtime.proto package runtime import ( - context "context" reflect "reflect" sync "sync" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" anypb "google.golang.org/protobuf/types/known/anypb" @@ -5414,1055 +5410,3 @@ func file_runtime_proto_init() { file_runtime_proto_goTypes = nil file_runtime_proto_depIdxs = nil } - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConnInterface - -// 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.SupportPackageIsVersion6 - -// RuntimeClient is the client API for Runtime service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type RuntimeClient interface { - //SayHello used for test - SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) - // InvokeService do rpc calls - InvokeService(ctx context.Context, in *InvokeServiceRequest, opts ...grpc.CallOption) (*InvokeResponse, error) - // GetConfiguration gets configuration from configuration store. - GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error) - // SaveConfiguration saves configuration into configuration store. - SaveConfiguration(ctx context.Context, in *SaveConfigurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // DeleteConfiguration deletes configuration from configuration store. - DeleteConfiguration(ctx context.Context, in *DeleteConfigurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // SubscribeConfiguration gets configuration from configuration store and subscribe the updates. - SubscribeConfiguration(ctx context.Context, opts ...grpc.CallOption) (Runtime_SubscribeConfigurationClient, error) - // Distributed Lock API - // A non-blocking method trying to get a lock with ttl. - TryLock(ctx context.Context, in *TryLockRequest, opts ...grpc.CallOption) (*TryLockResponse, error) - Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) - // Sequencer API - // Get next unique id with some auto-increment guarantee - GetNextId(ctx context.Context, in *GetNextIdRequest, opts ...grpc.CallOption) (*GetNextIdResponse, error) - // Gets the state for a specific key. - GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*GetStateResponse, error) - // Gets a bulk of state items for a list of keys - GetBulkState(ctx context.Context, in *GetBulkStateRequest, opts ...grpc.CallOption) (*GetBulkStateResponse, error) - // Saves an array of state objects - SaveState(ctx context.Context, in *SaveStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Deletes the state for a specific key. - DeleteState(ctx context.Context, in *DeleteStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Deletes a bulk of state items for a list of keys - DeleteBulkState(ctx context.Context, in *DeleteBulkStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Executes transactions for a specified store - ExecuteStateTransaction(ctx context.Context, in *ExecuteStateTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Publishes events to the specific topic - PublishEvent(ctx context.Context, in *PublishEventRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Get file with stream - GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (Runtime_GetFileClient, error) - // Put file with stream - PutFile(ctx context.Context, opts ...grpc.CallOption) (Runtime_PutFileClient, error) - // List all files - ListFile(ctx context.Context, in *ListFileRequest, opts ...grpc.CallOption) (*ListFileResp, error) - // Delete specific file - DelFile(ctx context.Context, in *DelFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) - // Get file meta data, if file not exist,return code.NotFound error - GetFileMeta(ctx context.Context, in *GetFileMetaRequest, opts ...grpc.CallOption) (*GetFileMetaResponse, error) - // Invokes binding data to specific output bindings - InvokeBinding(ctx context.Context, in *InvokeBindingRequest, opts ...grpc.CallOption) (*InvokeBindingResponse, error) - // Gets secrets from secret stores. - GetSecret(ctx context.Context, in *GetSecretRequest, opts ...grpc.CallOption) (*GetSecretResponse, error) - // Gets a bulk of secrets - GetBulkSecret(ctx context.Context, in *GetBulkSecretRequest, opts ...grpc.CallOption) (*GetBulkSecretResponse, error) -} - -type runtimeClient struct { - cc grpc.ClientConnInterface -} - -func NewRuntimeClient(cc grpc.ClientConnInterface) RuntimeClient { - return &runtimeClient{cc} -} - -func (c *runtimeClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { - out := new(SayHelloResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/SayHello", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) InvokeService(ctx context.Context, in *InvokeServiceRequest, opts ...grpc.CallOption) (*InvokeResponse, error) { - out := new(InvokeResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/InvokeService", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error) { - out := new(GetConfigurationResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetConfiguration", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) SaveConfiguration(ctx context.Context, in *SaveConfigurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/SaveConfiguration", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) DeleteConfiguration(ctx context.Context, in *DeleteConfigurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/DeleteConfiguration", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) SubscribeConfiguration(ctx context.Context, opts ...grpc.CallOption) (Runtime_SubscribeConfigurationClient, error) { - stream, err := c.cc.NewStream(ctx, &_Runtime_serviceDesc.Streams[0], "/spec.proto.runtime.v1.Runtime/SubscribeConfiguration", opts...) - if err != nil { - return nil, err - } - x := &runtimeSubscribeConfigurationClient{stream} - return x, nil -} - -type Runtime_SubscribeConfigurationClient interface { - Send(*SubscribeConfigurationRequest) error - Recv() (*SubscribeConfigurationResponse, error) - grpc.ClientStream -} - -type runtimeSubscribeConfigurationClient struct { - grpc.ClientStream -} - -func (x *runtimeSubscribeConfigurationClient) Send(m *SubscribeConfigurationRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *runtimeSubscribeConfigurationClient) Recv() (*SubscribeConfigurationResponse, error) { - m := new(SubscribeConfigurationResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *runtimeClient) TryLock(ctx context.Context, in *TryLockRequest, opts ...grpc.CallOption) (*TryLockResponse, error) { - out := new(TryLockResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/TryLock", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) { - out := new(UnlockResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/Unlock", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) GetNextId(ctx context.Context, in *GetNextIdRequest, opts ...grpc.CallOption) (*GetNextIdResponse, error) { - out := new(GetNextIdResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetNextId", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*GetStateResponse, error) { - out := new(GetStateResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) GetBulkState(ctx context.Context, in *GetBulkStateRequest, opts ...grpc.CallOption) (*GetBulkStateResponse, error) { - out := new(GetBulkStateResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetBulkState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) SaveState(ctx context.Context, in *SaveStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/SaveState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) DeleteState(ctx context.Context, in *DeleteStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/DeleteState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) DeleteBulkState(ctx context.Context, in *DeleteBulkStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/DeleteBulkState", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) ExecuteStateTransaction(ctx context.Context, in *ExecuteStateTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/ExecuteStateTransaction", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) PublishEvent(ctx context.Context, in *PublishEventRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/PublishEvent", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (Runtime_GetFileClient, error) { - stream, err := c.cc.NewStream(ctx, &_Runtime_serviceDesc.Streams[1], "/spec.proto.runtime.v1.Runtime/GetFile", opts...) - if err != nil { - return nil, err - } - x := &runtimeGetFileClient{stream} - if err := x.ClientStream.SendMsg(in); err != nil { - return nil, err - } - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - return x, nil -} - -type Runtime_GetFileClient interface { - Recv() (*GetFileResponse, error) - grpc.ClientStream -} - -type runtimeGetFileClient struct { - grpc.ClientStream -} - -func (x *runtimeGetFileClient) Recv() (*GetFileResponse, error) { - m := new(GetFileResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *runtimeClient) PutFile(ctx context.Context, opts ...grpc.CallOption) (Runtime_PutFileClient, error) { - stream, err := c.cc.NewStream(ctx, &_Runtime_serviceDesc.Streams[2], "/spec.proto.runtime.v1.Runtime/PutFile", opts...) - if err != nil { - return nil, err - } - x := &runtimePutFileClient{stream} - return x, nil -} - -type Runtime_PutFileClient interface { - Send(*PutFileRequest) error - CloseAndRecv() (*emptypb.Empty, error) - grpc.ClientStream -} - -type runtimePutFileClient struct { - grpc.ClientStream -} - -func (x *runtimePutFileClient) Send(m *PutFileRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *runtimePutFileClient) CloseAndRecv() (*emptypb.Empty, error) { - if err := x.ClientStream.CloseSend(); err != nil { - return nil, err - } - m := new(emptypb.Empty) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func (c *runtimeClient) ListFile(ctx context.Context, in *ListFileRequest, opts ...grpc.CallOption) (*ListFileResp, error) { - out := new(ListFileResp) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/ListFile", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) DelFile(ctx context.Context, in *DelFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { - out := new(emptypb.Empty) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/DelFile", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) GetFileMeta(ctx context.Context, in *GetFileMetaRequest, opts ...grpc.CallOption) (*GetFileMetaResponse, error) { - out := new(GetFileMetaResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetFileMeta", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) InvokeBinding(ctx context.Context, in *InvokeBindingRequest, opts ...grpc.CallOption) (*InvokeBindingResponse, error) { - out := new(InvokeBindingResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/InvokeBinding", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) GetSecret(ctx context.Context, in *GetSecretRequest, opts ...grpc.CallOption) (*GetSecretResponse, error) { - out := new(GetSecretResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetSecret", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *runtimeClient) GetBulkSecret(ctx context.Context, in *GetBulkSecretRequest, opts ...grpc.CallOption) (*GetBulkSecretResponse, error) { - out := new(GetBulkSecretResponse) - err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetBulkSecret", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// RuntimeServer is the server API for Runtime service. -type RuntimeServer interface { - //SayHello used for test - SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) - // InvokeService do rpc calls - InvokeService(context.Context, *InvokeServiceRequest) (*InvokeResponse, error) - // GetConfiguration gets configuration from configuration store. - GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) - // SaveConfiguration saves configuration into configuration store. - SaveConfiguration(context.Context, *SaveConfigurationRequest) (*emptypb.Empty, error) - // DeleteConfiguration deletes configuration from configuration store. - DeleteConfiguration(context.Context, *DeleteConfigurationRequest) (*emptypb.Empty, error) - // SubscribeConfiguration gets configuration from configuration store and subscribe the updates. - SubscribeConfiguration(Runtime_SubscribeConfigurationServer) error - // Distributed Lock API - // A non-blocking method trying to get a lock with ttl. - TryLock(context.Context, *TryLockRequest) (*TryLockResponse, error) - Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) - // Sequencer API - // Get next unique id with some auto-increment guarantee - GetNextId(context.Context, *GetNextIdRequest) (*GetNextIdResponse, error) - // Gets the state for a specific key. - GetState(context.Context, *GetStateRequest) (*GetStateResponse, error) - // Gets a bulk of state items for a list of keys - GetBulkState(context.Context, *GetBulkStateRequest) (*GetBulkStateResponse, error) - // Saves an array of state objects - SaveState(context.Context, *SaveStateRequest) (*emptypb.Empty, error) - // Deletes the state for a specific key. - DeleteState(context.Context, *DeleteStateRequest) (*emptypb.Empty, error) - // Deletes a bulk of state items for a list of keys - DeleteBulkState(context.Context, *DeleteBulkStateRequest) (*emptypb.Empty, error) - // Executes transactions for a specified store - ExecuteStateTransaction(context.Context, *ExecuteStateTransactionRequest) (*emptypb.Empty, error) - // Publishes events to the specific topic - PublishEvent(context.Context, *PublishEventRequest) (*emptypb.Empty, error) - // Get file with stream - GetFile(*GetFileRequest, Runtime_GetFileServer) error - // Put file with stream - PutFile(Runtime_PutFileServer) error - // List all files - ListFile(context.Context, *ListFileRequest) (*ListFileResp, error) - // Delete specific file - DelFile(context.Context, *DelFileRequest) (*emptypb.Empty, error) - // Get file meta data, if file not exist,return code.NotFound error - GetFileMeta(context.Context, *GetFileMetaRequest) (*GetFileMetaResponse, error) - // Invokes binding data to specific output bindings - InvokeBinding(context.Context, *InvokeBindingRequest) (*InvokeBindingResponse, error) - // Gets secrets from secret stores. - GetSecret(context.Context, *GetSecretRequest) (*GetSecretResponse, error) - // Gets a bulk of secrets - GetBulkSecret(context.Context, *GetBulkSecretRequest) (*GetBulkSecretResponse, error) -} - -// UnimplementedRuntimeServer can be embedded to have forward compatible implementations. -type UnimplementedRuntimeServer struct { -} - -func (*UnimplementedRuntimeServer) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") -} -func (*UnimplementedRuntimeServer) InvokeService(context.Context, *InvokeServiceRequest) (*InvokeResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InvokeService not implemented") -} -func (*UnimplementedRuntimeServer) GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetConfiguration not implemented") -} -func (*UnimplementedRuntimeServer) SaveConfiguration(context.Context, *SaveConfigurationRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method SaveConfiguration not implemented") -} -func (*UnimplementedRuntimeServer) DeleteConfiguration(context.Context, *DeleteConfigurationRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteConfiguration not implemented") -} -func (*UnimplementedRuntimeServer) SubscribeConfiguration(Runtime_SubscribeConfigurationServer) error { - return status.Errorf(codes.Unimplemented, "method SubscribeConfiguration not implemented") -} -func (*UnimplementedRuntimeServer) TryLock(context.Context, *TryLockRequest) (*TryLockResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method TryLock not implemented") -} -func (*UnimplementedRuntimeServer) Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Unlock not implemented") -} -func (*UnimplementedRuntimeServer) GetNextId(context.Context, *GetNextIdRequest) (*GetNextIdResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetNextId not implemented") -} -func (*UnimplementedRuntimeServer) GetState(context.Context, *GetStateRequest) (*GetStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetState not implemented") -} -func (*UnimplementedRuntimeServer) GetBulkState(context.Context, *GetBulkStateRequest) (*GetBulkStateResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBulkState not implemented") -} -func (*UnimplementedRuntimeServer) SaveState(context.Context, *SaveStateRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method SaveState not implemented") -} -func (*UnimplementedRuntimeServer) DeleteState(context.Context, *DeleteStateRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteState not implemented") -} -func (*UnimplementedRuntimeServer) DeleteBulkState(context.Context, *DeleteBulkStateRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteBulkState not implemented") -} -func (*UnimplementedRuntimeServer) ExecuteStateTransaction(context.Context, *ExecuteStateTransactionRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method ExecuteStateTransaction not implemented") -} -func (*UnimplementedRuntimeServer) PublishEvent(context.Context, *PublishEventRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method PublishEvent not implemented") -} -func (*UnimplementedRuntimeServer) GetFile(*GetFileRequest, Runtime_GetFileServer) error { - return status.Errorf(codes.Unimplemented, "method GetFile not implemented") -} -func (*UnimplementedRuntimeServer) PutFile(Runtime_PutFileServer) error { - return status.Errorf(codes.Unimplemented, "method PutFile not implemented") -} -func (*UnimplementedRuntimeServer) ListFile(context.Context, *ListFileRequest) (*ListFileResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListFile not implemented") -} -func (*UnimplementedRuntimeServer) DelFile(context.Context, *DelFileRequest) (*emptypb.Empty, error) { - return nil, status.Errorf(codes.Unimplemented, "method DelFile not implemented") -} -func (*UnimplementedRuntimeServer) GetFileMeta(context.Context, *GetFileMetaRequest) (*GetFileMetaResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetFileMeta not implemented") -} -func (*UnimplementedRuntimeServer) InvokeBinding(context.Context, *InvokeBindingRequest) (*InvokeBindingResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InvokeBinding not implemented") -} -func (*UnimplementedRuntimeServer) GetSecret(context.Context, *GetSecretRequest) (*GetSecretResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSecret not implemented") -} -func (*UnimplementedRuntimeServer) GetBulkSecret(context.Context, *GetBulkSecretRequest) (*GetBulkSecretResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBulkSecret not implemented") -} - -func RegisterRuntimeServer(s *grpc.Server, srv RuntimeServer) { - s.RegisterService(&_Runtime_serviceDesc, srv) -} - -func _Runtime_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SayHelloRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).SayHello(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/SayHello", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).SayHello(ctx, req.(*SayHelloRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_InvokeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InvokeServiceRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).InvokeService(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/InvokeService", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).InvokeService(ctx, req.(*InvokeServiceRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_GetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetConfigurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).GetConfiguration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/GetConfiguration", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).GetConfiguration(ctx, req.(*GetConfigurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_SaveConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SaveConfigurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).SaveConfiguration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/SaveConfiguration", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).SaveConfiguration(ctx, req.(*SaveConfigurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_DeleteConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteConfigurationRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).DeleteConfiguration(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/DeleteConfiguration", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).DeleteConfiguration(ctx, req.(*DeleteConfigurationRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_SubscribeConfiguration_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(RuntimeServer).SubscribeConfiguration(&runtimeSubscribeConfigurationServer{stream}) -} - -type Runtime_SubscribeConfigurationServer interface { - Send(*SubscribeConfigurationResponse) error - Recv() (*SubscribeConfigurationRequest, error) - grpc.ServerStream -} - -type runtimeSubscribeConfigurationServer struct { - grpc.ServerStream -} - -func (x *runtimeSubscribeConfigurationServer) Send(m *SubscribeConfigurationResponse) error { - return x.ServerStream.SendMsg(m) -} - -func (x *runtimeSubscribeConfigurationServer) Recv() (*SubscribeConfigurationRequest, error) { - m := new(SubscribeConfigurationRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Runtime_TryLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(TryLockRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).TryLock(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/TryLock", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).TryLock(ctx, req.(*TryLockRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_Unlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UnlockRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).Unlock(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/Unlock", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).Unlock(ctx, req.(*UnlockRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_GetNextId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetNextIdRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).GetNextId(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/GetNextId", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).GetNextId(ctx, req.(*GetNextIdRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).GetState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/GetState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).GetState(ctx, req.(*GetStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_GetBulkState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBulkStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).GetBulkState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/GetBulkState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).GetBulkState(ctx, req.(*GetBulkStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_SaveState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(SaveStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).SaveState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/SaveState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).SaveState(ctx, req.(*SaveStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_DeleteState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).DeleteState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/DeleteState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).DeleteState(ctx, req.(*DeleteStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_DeleteBulkState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteBulkStateRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).DeleteBulkState(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/DeleteBulkState", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).DeleteBulkState(ctx, req.(*DeleteBulkStateRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_ExecuteStateTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ExecuteStateTransactionRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).ExecuteStateTransaction(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/ExecuteStateTransaction", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).ExecuteStateTransaction(ctx, req.(*ExecuteStateTransactionRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_PublishEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(PublishEventRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).PublishEvent(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/PublishEvent", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).PublishEvent(ctx, req.(*PublishEventRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_GetFile_Handler(srv interface{}, stream grpc.ServerStream) error { - m := new(GetFileRequest) - if err := stream.RecvMsg(m); err != nil { - return err - } - return srv.(RuntimeServer).GetFile(m, &runtimeGetFileServer{stream}) -} - -type Runtime_GetFileServer interface { - Send(*GetFileResponse) error - grpc.ServerStream -} - -type runtimeGetFileServer struct { - grpc.ServerStream -} - -func (x *runtimeGetFileServer) Send(m *GetFileResponse) error { - return x.ServerStream.SendMsg(m) -} - -func _Runtime_PutFile_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(RuntimeServer).PutFile(&runtimePutFileServer{stream}) -} - -type Runtime_PutFileServer interface { - SendAndClose(*emptypb.Empty) error - Recv() (*PutFileRequest, error) - grpc.ServerStream -} - -type runtimePutFileServer struct { - grpc.ServerStream -} - -func (x *runtimePutFileServer) SendAndClose(m *emptypb.Empty) error { - return x.ServerStream.SendMsg(m) -} - -func (x *runtimePutFileServer) Recv() (*PutFileRequest, error) { - m := new(PutFileRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} - -func _Runtime_ListFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListFileRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).ListFile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/ListFile", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).ListFile(ctx, req.(*ListFileRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_DelFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DelFileRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).DelFile(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/DelFile", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).DelFile(ctx, req.(*DelFileRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_GetFileMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetFileMetaRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).GetFileMeta(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/GetFileMeta", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).GetFileMeta(ctx, req.(*GetFileMetaRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_InvokeBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(InvokeBindingRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).InvokeBinding(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/InvokeBinding", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).InvokeBinding(ctx, req.(*InvokeBindingRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_GetSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetSecretRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).GetSecret(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/GetSecret", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).GetSecret(ctx, req.(*GetSecretRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _Runtime_GetBulkSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetBulkSecretRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(RuntimeServer).GetBulkSecret(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/spec.proto.runtime.v1.Runtime/GetBulkSecret", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(RuntimeServer).GetBulkSecret(ctx, req.(*GetBulkSecretRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Runtime_serviceDesc = grpc.ServiceDesc{ - ServiceName: "spec.proto.runtime.v1.Runtime", - HandlerType: (*RuntimeServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "SayHello", - Handler: _Runtime_SayHello_Handler, - }, - { - MethodName: "InvokeService", - Handler: _Runtime_InvokeService_Handler, - }, - { - MethodName: "GetConfiguration", - Handler: _Runtime_GetConfiguration_Handler, - }, - { - MethodName: "SaveConfiguration", - Handler: _Runtime_SaveConfiguration_Handler, - }, - { - MethodName: "DeleteConfiguration", - Handler: _Runtime_DeleteConfiguration_Handler, - }, - { - MethodName: "TryLock", - Handler: _Runtime_TryLock_Handler, - }, - { - MethodName: "Unlock", - Handler: _Runtime_Unlock_Handler, - }, - { - MethodName: "GetNextId", - Handler: _Runtime_GetNextId_Handler, - }, - { - MethodName: "GetState", - Handler: _Runtime_GetState_Handler, - }, - { - MethodName: "GetBulkState", - Handler: _Runtime_GetBulkState_Handler, - }, - { - MethodName: "SaveState", - Handler: _Runtime_SaveState_Handler, - }, - { - MethodName: "DeleteState", - Handler: _Runtime_DeleteState_Handler, - }, - { - MethodName: "DeleteBulkState", - Handler: _Runtime_DeleteBulkState_Handler, - }, - { - MethodName: "ExecuteStateTransaction", - Handler: _Runtime_ExecuteStateTransaction_Handler, - }, - { - MethodName: "PublishEvent", - Handler: _Runtime_PublishEvent_Handler, - }, - { - MethodName: "ListFile", - Handler: _Runtime_ListFile_Handler, - }, - { - MethodName: "DelFile", - Handler: _Runtime_DelFile_Handler, - }, - { - MethodName: "GetFileMeta", - Handler: _Runtime_GetFileMeta_Handler, - }, - { - MethodName: "InvokeBinding", - Handler: _Runtime_InvokeBinding_Handler, - }, - { - MethodName: "GetSecret", - Handler: _Runtime_GetSecret_Handler, - }, - { - MethodName: "GetBulkSecret", - Handler: _Runtime_GetBulkSecret_Handler, - }, - }, - Streams: []grpc.StreamDesc{ - { - StreamName: "SubscribeConfiguration", - Handler: _Runtime_SubscribeConfiguration_Handler, - ServerStreams: true, - ClientStreams: true, - }, - { - StreamName: "GetFile", - Handler: _Runtime_GetFile_Handler, - ServerStreams: true, - }, - { - StreamName: "PutFile", - Handler: _Runtime_PutFile_Handler, - ClientStreams: true, - }, - }, - Metadata: "runtime.proto", -} diff --git a/spec/proto/runtime/v1/runtime_grpc.pb.go b/spec/proto/runtime/v1/runtime_grpc.pb.go new file mode 100644 index 0000000000..b473524885 --- /dev/null +++ b/spec/proto/runtime/v1/runtime_grpc.pb.go @@ -0,0 +1,1077 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.17.3 +// source: runtime.proto + +package runtime + +import ( + context "context" + + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + emptypb "google.golang.org/protobuf/types/known/emptypb" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// RuntimeClient is the client API for Runtime 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. +type RuntimeClient interface { + //SayHello used for test + SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) + // InvokeService do rpc calls + InvokeService(ctx context.Context, in *InvokeServiceRequest, opts ...grpc.CallOption) (*InvokeResponse, error) + // GetConfiguration gets configuration from configuration store. + GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error) + // SaveConfiguration saves configuration into configuration store. + SaveConfiguration(ctx context.Context, in *SaveConfigurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // DeleteConfiguration deletes configuration from configuration store. + DeleteConfiguration(ctx context.Context, in *DeleteConfigurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // SubscribeConfiguration gets configuration from configuration store and subscribe the updates. + SubscribeConfiguration(ctx context.Context, opts ...grpc.CallOption) (Runtime_SubscribeConfigurationClient, error) + // Distributed Lock API + // A non-blocking method trying to get a lock with ttl. + TryLock(ctx context.Context, in *TryLockRequest, opts ...grpc.CallOption) (*TryLockResponse, error) + Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) + // Sequencer API + // Get next unique id with some auto-increment guarantee + GetNextId(ctx context.Context, in *GetNextIdRequest, opts ...grpc.CallOption) (*GetNextIdResponse, error) + // Gets the state for a specific key. + GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*GetStateResponse, error) + // Gets a bulk of state items for a list of keys + GetBulkState(ctx context.Context, in *GetBulkStateRequest, opts ...grpc.CallOption) (*GetBulkStateResponse, error) + // Saves an array of state objects + SaveState(ctx context.Context, in *SaveStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Deletes the state for a specific key. + DeleteState(ctx context.Context, in *DeleteStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Deletes a bulk of state items for a list of keys + DeleteBulkState(ctx context.Context, in *DeleteBulkStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Executes transactions for a specified store + ExecuteStateTransaction(ctx context.Context, in *ExecuteStateTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Publishes events to the specific topic + PublishEvent(ctx context.Context, in *PublishEventRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Get file with stream + GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (Runtime_GetFileClient, error) + // Put file with stream + PutFile(ctx context.Context, opts ...grpc.CallOption) (Runtime_PutFileClient, error) + // List all files + ListFile(ctx context.Context, in *ListFileRequest, opts ...grpc.CallOption) (*ListFileResp, error) + // Delete specific file + DelFile(ctx context.Context, in *DelFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) + // Get file meta data, if file not exist,return code.NotFound error + GetFileMeta(ctx context.Context, in *GetFileMetaRequest, opts ...grpc.CallOption) (*GetFileMetaResponse, error) + // Invokes binding data to specific output bindings + InvokeBinding(ctx context.Context, in *InvokeBindingRequest, opts ...grpc.CallOption) (*InvokeBindingResponse, error) + // Gets secrets from secret stores. + GetSecret(ctx context.Context, in *GetSecretRequest, opts ...grpc.CallOption) (*GetSecretResponse, error) + // Gets a bulk of secrets + GetBulkSecret(ctx context.Context, in *GetBulkSecretRequest, opts ...grpc.CallOption) (*GetBulkSecretResponse, error) +} + +type runtimeClient struct { + cc grpc.ClientConnInterface +} + +func NewRuntimeClient(cc grpc.ClientConnInterface) RuntimeClient { + return &runtimeClient{cc} +} + +func (c *runtimeClient) SayHello(ctx context.Context, in *SayHelloRequest, opts ...grpc.CallOption) (*SayHelloResponse, error) { + out := new(SayHelloResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/SayHello", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) InvokeService(ctx context.Context, in *InvokeServiceRequest, opts ...grpc.CallOption) (*InvokeResponse, error) { + out := new(InvokeResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/InvokeService", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) GetConfiguration(ctx context.Context, in *GetConfigurationRequest, opts ...grpc.CallOption) (*GetConfigurationResponse, error) { + out := new(GetConfigurationResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetConfiguration", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) SaveConfiguration(ctx context.Context, in *SaveConfigurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/SaveConfiguration", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) DeleteConfiguration(ctx context.Context, in *DeleteConfigurationRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/DeleteConfiguration", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) SubscribeConfiguration(ctx context.Context, opts ...grpc.CallOption) (Runtime_SubscribeConfigurationClient, error) { + stream, err := c.cc.NewStream(ctx, &Runtime_ServiceDesc.Streams[0], "/spec.proto.runtime.v1.Runtime/SubscribeConfiguration", opts...) + if err != nil { + return nil, err + } + x := &runtimeSubscribeConfigurationClient{stream} + return x, nil +} + +type Runtime_SubscribeConfigurationClient interface { + Send(*SubscribeConfigurationRequest) error + Recv() (*SubscribeConfigurationResponse, error) + grpc.ClientStream +} + +type runtimeSubscribeConfigurationClient struct { + grpc.ClientStream +} + +func (x *runtimeSubscribeConfigurationClient) Send(m *SubscribeConfigurationRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *runtimeSubscribeConfigurationClient) Recv() (*SubscribeConfigurationResponse, error) { + m := new(SubscribeConfigurationResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *runtimeClient) TryLock(ctx context.Context, in *TryLockRequest, opts ...grpc.CallOption) (*TryLockResponse, error) { + out := new(TryLockResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/TryLock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) { + out := new(UnlockResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/Unlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) GetNextId(ctx context.Context, in *GetNextIdRequest, opts ...grpc.CallOption) (*GetNextIdResponse, error) { + out := new(GetNextIdResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetNextId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) GetState(ctx context.Context, in *GetStateRequest, opts ...grpc.CallOption) (*GetStateResponse, error) { + out := new(GetStateResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) GetBulkState(ctx context.Context, in *GetBulkStateRequest, opts ...grpc.CallOption) (*GetBulkStateResponse, error) { + out := new(GetBulkStateResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetBulkState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) SaveState(ctx context.Context, in *SaveStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/SaveState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) DeleteState(ctx context.Context, in *DeleteStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/DeleteState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) DeleteBulkState(ctx context.Context, in *DeleteBulkStateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/DeleteBulkState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) ExecuteStateTransaction(ctx context.Context, in *ExecuteStateTransactionRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/ExecuteStateTransaction", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) PublishEvent(ctx context.Context, in *PublishEventRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/PublishEvent", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (Runtime_GetFileClient, error) { + stream, err := c.cc.NewStream(ctx, &Runtime_ServiceDesc.Streams[1], "/spec.proto.runtime.v1.Runtime/GetFile", opts...) + if err != nil { + return nil, err + } + x := &runtimeGetFileClient{stream} + if err := x.ClientStream.SendMsg(in); err != nil { + return nil, err + } + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + return x, nil +} + +type Runtime_GetFileClient interface { + Recv() (*GetFileResponse, error) + grpc.ClientStream +} + +type runtimeGetFileClient struct { + grpc.ClientStream +} + +func (x *runtimeGetFileClient) Recv() (*GetFileResponse, error) { + m := new(GetFileResponse) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *runtimeClient) PutFile(ctx context.Context, opts ...grpc.CallOption) (Runtime_PutFileClient, error) { + stream, err := c.cc.NewStream(ctx, &Runtime_ServiceDesc.Streams[2], "/spec.proto.runtime.v1.Runtime/PutFile", opts...) + if err != nil { + return nil, err + } + x := &runtimePutFileClient{stream} + return x, nil +} + +type Runtime_PutFileClient interface { + Send(*PutFileRequest) error + CloseAndRecv() (*emptypb.Empty, error) + grpc.ClientStream +} + +type runtimePutFileClient struct { + grpc.ClientStream +} + +func (x *runtimePutFileClient) Send(m *PutFileRequest) error { + return x.ClientStream.SendMsg(m) +} + +func (x *runtimePutFileClient) CloseAndRecv() (*emptypb.Empty, error) { + if err := x.ClientStream.CloseSend(); err != nil { + return nil, err + } + m := new(emptypb.Empty) + if err := x.ClientStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func (c *runtimeClient) ListFile(ctx context.Context, in *ListFileRequest, opts ...grpc.CallOption) (*ListFileResp, error) { + out := new(ListFileResp) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/ListFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) DelFile(ctx context.Context, in *DelFileRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { + out := new(emptypb.Empty) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/DelFile", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) GetFileMeta(ctx context.Context, in *GetFileMetaRequest, opts ...grpc.CallOption) (*GetFileMetaResponse, error) { + out := new(GetFileMetaResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetFileMeta", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) InvokeBinding(ctx context.Context, in *InvokeBindingRequest, opts ...grpc.CallOption) (*InvokeBindingResponse, error) { + out := new(InvokeBindingResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/InvokeBinding", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) GetSecret(ctx context.Context, in *GetSecretRequest, opts ...grpc.CallOption) (*GetSecretResponse, error) { + out := new(GetSecretResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetSecret", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *runtimeClient) GetBulkSecret(ctx context.Context, in *GetBulkSecretRequest, opts ...grpc.CallOption) (*GetBulkSecretResponse, error) { + out := new(GetBulkSecretResponse) + err := c.cc.Invoke(ctx, "/spec.proto.runtime.v1.Runtime/GetBulkSecret", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// RuntimeServer is the server API for Runtime service. +// All implementations should embed UnimplementedRuntimeServer +// for forward compatibility +type RuntimeServer interface { + //SayHello used for test + SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) + // InvokeService do rpc calls + InvokeService(context.Context, *InvokeServiceRequest) (*InvokeResponse, error) + // GetConfiguration gets configuration from configuration store. + GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) + // SaveConfiguration saves configuration into configuration store. + SaveConfiguration(context.Context, *SaveConfigurationRequest) (*emptypb.Empty, error) + // DeleteConfiguration deletes configuration from configuration store. + DeleteConfiguration(context.Context, *DeleteConfigurationRequest) (*emptypb.Empty, error) + // SubscribeConfiguration gets configuration from configuration store and subscribe the updates. + SubscribeConfiguration(Runtime_SubscribeConfigurationServer) error + // Distributed Lock API + // A non-blocking method trying to get a lock with ttl. + TryLock(context.Context, *TryLockRequest) (*TryLockResponse, error) + Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) + // Sequencer API + // Get next unique id with some auto-increment guarantee + GetNextId(context.Context, *GetNextIdRequest) (*GetNextIdResponse, error) + // Gets the state for a specific key. + GetState(context.Context, *GetStateRequest) (*GetStateResponse, error) + // Gets a bulk of state items for a list of keys + GetBulkState(context.Context, *GetBulkStateRequest) (*GetBulkStateResponse, error) + // Saves an array of state objects + SaveState(context.Context, *SaveStateRequest) (*emptypb.Empty, error) + // Deletes the state for a specific key. + DeleteState(context.Context, *DeleteStateRequest) (*emptypb.Empty, error) + // Deletes a bulk of state items for a list of keys + DeleteBulkState(context.Context, *DeleteBulkStateRequest) (*emptypb.Empty, error) + // Executes transactions for a specified store + ExecuteStateTransaction(context.Context, *ExecuteStateTransactionRequest) (*emptypb.Empty, error) + // Publishes events to the specific topic + PublishEvent(context.Context, *PublishEventRequest) (*emptypb.Empty, error) + // Get file with stream + GetFile(*GetFileRequest, Runtime_GetFileServer) error + // Put file with stream + PutFile(Runtime_PutFileServer) error + // List all files + ListFile(context.Context, *ListFileRequest) (*ListFileResp, error) + // Delete specific file + DelFile(context.Context, *DelFileRequest) (*emptypb.Empty, error) + // Get file meta data, if file not exist,return code.NotFound error + GetFileMeta(context.Context, *GetFileMetaRequest) (*GetFileMetaResponse, error) + // Invokes binding data to specific output bindings + InvokeBinding(context.Context, *InvokeBindingRequest) (*InvokeBindingResponse, error) + // Gets secrets from secret stores. + GetSecret(context.Context, *GetSecretRequest) (*GetSecretResponse, error) + // Gets a bulk of secrets + GetBulkSecret(context.Context, *GetBulkSecretRequest) (*GetBulkSecretResponse, error) +} + +// UnimplementedRuntimeServer should be embedded to have forward compatible implementations. +type UnimplementedRuntimeServer struct { +} + +func (UnimplementedRuntimeServer) SayHello(context.Context, *SayHelloRequest) (*SayHelloResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") +} +func (UnimplementedRuntimeServer) InvokeService(context.Context, *InvokeServiceRequest) (*InvokeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvokeService not implemented") +} +func (UnimplementedRuntimeServer) GetConfiguration(context.Context, *GetConfigurationRequest) (*GetConfigurationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetConfiguration not implemented") +} +func (UnimplementedRuntimeServer) SaveConfiguration(context.Context, *SaveConfigurationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SaveConfiguration not implemented") +} +func (UnimplementedRuntimeServer) DeleteConfiguration(context.Context, *DeleteConfigurationRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteConfiguration not implemented") +} +func (UnimplementedRuntimeServer) SubscribeConfiguration(Runtime_SubscribeConfigurationServer) error { + return status.Errorf(codes.Unimplemented, "method SubscribeConfiguration not implemented") +} +func (UnimplementedRuntimeServer) TryLock(context.Context, *TryLockRequest) (*TryLockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TryLock not implemented") +} +func (UnimplementedRuntimeServer) Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Unlock not implemented") +} +func (UnimplementedRuntimeServer) GetNextId(context.Context, *GetNextIdRequest) (*GetNextIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNextId not implemented") +} +func (UnimplementedRuntimeServer) GetState(context.Context, *GetStateRequest) (*GetStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetState not implemented") +} +func (UnimplementedRuntimeServer) GetBulkState(context.Context, *GetBulkStateRequest) (*GetBulkStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBulkState not implemented") +} +func (UnimplementedRuntimeServer) SaveState(context.Context, *SaveStateRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method SaveState not implemented") +} +func (UnimplementedRuntimeServer) DeleteState(context.Context, *DeleteStateRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteState not implemented") +} +func (UnimplementedRuntimeServer) DeleteBulkState(context.Context, *DeleteBulkStateRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteBulkState not implemented") +} +func (UnimplementedRuntimeServer) ExecuteStateTransaction(context.Context, *ExecuteStateTransactionRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExecuteStateTransaction not implemented") +} +func (UnimplementedRuntimeServer) PublishEvent(context.Context, *PublishEventRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method PublishEvent not implemented") +} +func (UnimplementedRuntimeServer) GetFile(*GetFileRequest, Runtime_GetFileServer) error { + return status.Errorf(codes.Unimplemented, "method GetFile not implemented") +} +func (UnimplementedRuntimeServer) PutFile(Runtime_PutFileServer) error { + return status.Errorf(codes.Unimplemented, "method PutFile not implemented") +} +func (UnimplementedRuntimeServer) ListFile(context.Context, *ListFileRequest) (*ListFileResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListFile not implemented") +} +func (UnimplementedRuntimeServer) DelFile(context.Context, *DelFileRequest) (*emptypb.Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method DelFile not implemented") +} +func (UnimplementedRuntimeServer) GetFileMeta(context.Context, *GetFileMetaRequest) (*GetFileMetaResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetFileMeta not implemented") +} +func (UnimplementedRuntimeServer) InvokeBinding(context.Context, *InvokeBindingRequest) (*InvokeBindingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method InvokeBinding not implemented") +} +func (UnimplementedRuntimeServer) GetSecret(context.Context, *GetSecretRequest) (*GetSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetSecret not implemented") +} +func (UnimplementedRuntimeServer) GetBulkSecret(context.Context, *GetBulkSecretRequest) (*GetBulkSecretResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetBulkSecret not implemented") +} + +// UnsafeRuntimeServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to RuntimeServer will +// result in compilation errors. +type UnsafeRuntimeServer interface { + mustEmbedUnimplementedRuntimeServer() +} + +func RegisterRuntimeServer(s grpc.ServiceRegistrar, srv RuntimeServer) { + s.RegisterService(&Runtime_ServiceDesc, srv) +} + +func _Runtime_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SayHelloRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).SayHello(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/SayHello", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).SayHello(ctx, req.(*SayHelloRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_InvokeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvokeServiceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).InvokeService(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/InvokeService", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).InvokeService(ctx, req.(*InvokeServiceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_GetConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).GetConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/GetConfiguration", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).GetConfiguration(ctx, req.(*GetConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_SaveConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).SaveConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/SaveConfiguration", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).SaveConfiguration(ctx, req.(*SaveConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_DeleteConfiguration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteConfigurationRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).DeleteConfiguration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/DeleteConfiguration", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).DeleteConfiguration(ctx, req.(*DeleteConfigurationRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_SubscribeConfiguration_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RuntimeServer).SubscribeConfiguration(&runtimeSubscribeConfigurationServer{stream}) +} + +type Runtime_SubscribeConfigurationServer interface { + Send(*SubscribeConfigurationResponse) error + Recv() (*SubscribeConfigurationRequest, error) + grpc.ServerStream +} + +type runtimeSubscribeConfigurationServer struct { + grpc.ServerStream +} + +func (x *runtimeSubscribeConfigurationServer) Send(m *SubscribeConfigurationResponse) error { + return x.ServerStream.SendMsg(m) +} + +func (x *runtimeSubscribeConfigurationServer) Recv() (*SubscribeConfigurationRequest, error) { + m := new(SubscribeConfigurationRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Runtime_TryLock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(TryLockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).TryLock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/TryLock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).TryLock(ctx, req.(*TryLockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_Unlock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UnlockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).Unlock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/Unlock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).Unlock(ctx, req.(*UnlockRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_GetNextId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNextIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).GetNextId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/GetNextId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).GetNextId(ctx, req.(*GetNextIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_GetState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).GetState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/GetState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).GetState(ctx, req.(*GetStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_GetBulkState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBulkStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).GetBulkState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/GetBulkState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).GetBulkState(ctx, req.(*GetBulkStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_SaveState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SaveStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).SaveState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/SaveState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).SaveState(ctx, req.(*SaveStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_DeleteState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).DeleteState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/DeleteState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).DeleteState(ctx, req.(*DeleteStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_DeleteBulkState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBulkStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).DeleteBulkState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/DeleteBulkState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).DeleteBulkState(ctx, req.(*DeleteBulkStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_ExecuteStateTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ExecuteStateTransactionRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).ExecuteStateTransaction(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/ExecuteStateTransaction", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).ExecuteStateTransaction(ctx, req.(*ExecuteStateTransactionRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_PublishEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PublishEventRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).PublishEvent(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/PublishEvent", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).PublishEvent(ctx, req.(*PublishEventRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_GetFile_Handler(srv interface{}, stream grpc.ServerStream) error { + m := new(GetFileRequest) + if err := stream.RecvMsg(m); err != nil { + return err + } + return srv.(RuntimeServer).GetFile(m, &runtimeGetFileServer{stream}) +} + +type Runtime_GetFileServer interface { + Send(*GetFileResponse) error + grpc.ServerStream +} + +type runtimeGetFileServer struct { + grpc.ServerStream +} + +func (x *runtimeGetFileServer) Send(m *GetFileResponse) error { + return x.ServerStream.SendMsg(m) +} + +func _Runtime_PutFile_Handler(srv interface{}, stream grpc.ServerStream) error { + return srv.(RuntimeServer).PutFile(&runtimePutFileServer{stream}) +} + +type Runtime_PutFileServer interface { + SendAndClose(*emptypb.Empty) error + Recv() (*PutFileRequest, error) + grpc.ServerStream +} + +type runtimePutFileServer struct { + grpc.ServerStream +} + +func (x *runtimePutFileServer) SendAndClose(m *emptypb.Empty) error { + return x.ServerStream.SendMsg(m) +} + +func (x *runtimePutFileServer) Recv() (*PutFileRequest, error) { + m := new(PutFileRequest) + if err := x.ServerStream.RecvMsg(m); err != nil { + return nil, err + } + return m, nil +} + +func _Runtime_ListFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).ListFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/ListFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).ListFile(ctx, req.(*ListFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_DelFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DelFileRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).DelFile(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/DelFile", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).DelFile(ctx, req.(*DelFileRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_GetFileMeta_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetFileMetaRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).GetFileMeta(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/GetFileMeta", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).GetFileMeta(ctx, req.(*GetFileMetaRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_InvokeBinding_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InvokeBindingRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).InvokeBinding(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/InvokeBinding", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).InvokeBinding(ctx, req.(*InvokeBindingRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_GetSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetSecretRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).GetSecret(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/GetSecret", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).GetSecret(ctx, req.(*GetSecretRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Runtime_GetBulkSecret_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetBulkSecretRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(RuntimeServer).GetBulkSecret(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/spec.proto.runtime.v1.Runtime/GetBulkSecret", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(RuntimeServer).GetBulkSecret(ctx, req.(*GetBulkSecretRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// Runtime_ServiceDesc is the grpc.ServiceDesc for Runtime service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Runtime_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "spec.proto.runtime.v1.Runtime", + HandlerType: (*RuntimeServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SayHello", + Handler: _Runtime_SayHello_Handler, + }, + { + MethodName: "InvokeService", + Handler: _Runtime_InvokeService_Handler, + }, + { + MethodName: "GetConfiguration", + Handler: _Runtime_GetConfiguration_Handler, + }, + { + MethodName: "SaveConfiguration", + Handler: _Runtime_SaveConfiguration_Handler, + }, + { + MethodName: "DeleteConfiguration", + Handler: _Runtime_DeleteConfiguration_Handler, + }, + { + MethodName: "TryLock", + Handler: _Runtime_TryLock_Handler, + }, + { + MethodName: "Unlock", + Handler: _Runtime_Unlock_Handler, + }, + { + MethodName: "GetNextId", + Handler: _Runtime_GetNextId_Handler, + }, + { + MethodName: "GetState", + Handler: _Runtime_GetState_Handler, + }, + { + MethodName: "GetBulkState", + Handler: _Runtime_GetBulkState_Handler, + }, + { + MethodName: "SaveState", + Handler: _Runtime_SaveState_Handler, + }, + { + MethodName: "DeleteState", + Handler: _Runtime_DeleteState_Handler, + }, + { + MethodName: "DeleteBulkState", + Handler: _Runtime_DeleteBulkState_Handler, + }, + { + MethodName: "ExecuteStateTransaction", + Handler: _Runtime_ExecuteStateTransaction_Handler, + }, + { + MethodName: "PublishEvent", + Handler: _Runtime_PublishEvent_Handler, + }, + { + MethodName: "ListFile", + Handler: _Runtime_ListFile_Handler, + }, + { + MethodName: "DelFile", + Handler: _Runtime_DelFile_Handler, + }, + { + MethodName: "GetFileMeta", + Handler: _Runtime_GetFileMeta_Handler, + }, + { + MethodName: "InvokeBinding", + Handler: _Runtime_InvokeBinding_Handler, + }, + { + MethodName: "GetSecret", + Handler: _Runtime_GetSecret_Handler, + }, + { + MethodName: "GetBulkSecret", + Handler: _Runtime_GetBulkSecret_Handler, + }, + }, + Streams: []grpc.StreamDesc{ + { + StreamName: "SubscribeConfiguration", + Handler: _Runtime_SubscribeConfiguration_Handler, + ServerStreams: true, + ClientStreams: true, + }, + { + StreamName: "GetFile", + Handler: _Runtime_GetFile_Handler, + ServerStreams: true, + }, + { + StreamName: "PutFile", + Handler: _Runtime_PutFile_Handler, + ClientStreams: true, + }, + }, + Metadata: "runtime.proto", +}