소스 검색

gorunjs grpc

maxiaoshan 2 년 전
부모
커밋
5692b4a958
3개의 변경된 파일356개의 추가작업 그리고 0개의 파일을 삭제
  1. 230 0
      src/gorunjs/proto/js.pb.go
  2. 21 0
      src/gorunjs/proto/js.proto
  3. 105 0
      src/gorunjs/proto/js_grpc.pb.go

+ 230 - 0
src/gorunjs/proto/js.pb.go

@@ -0,0 +1,230 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// 	protoc-gen-go v1.28.0
+// 	protoc        v3.19.4
+// source: proto/js.proto
+
+package proto
+
+import (
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
+	sync "sync"
+)
+
+const (
+	// Verify that this generated code is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+	// Verify that runtime/protoimpl is sufficiently up-to-date.
+	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+//model
+type GoRunJsReq struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Code  string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"`
+	Param string `protobuf:"bytes,2,opt,name=param,proto3" json:"param,omitempty"`
+	Step  string `protobuf:"bytes,3,opt,name=step,proto3" json:"step,omitempty"`
+}
+
+func (x *GoRunJsReq) Reset() {
+	*x = GoRunJsReq{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_proto_js_proto_msgTypes[0]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *GoRunJsReq) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GoRunJsReq) ProtoMessage() {}
+
+func (x *GoRunJsReq) ProtoReflect() protoreflect.Message {
+	mi := &file_proto_js_proto_msgTypes[0]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use GoRunJsReq.ProtoReflect.Descriptor instead.
+func (*GoRunJsReq) Descriptor() ([]byte, []int) {
+	return file_proto_js_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *GoRunJsReq) GetCode() string {
+	if x != nil {
+		return x.Code
+	}
+	return ""
+}
+
+func (x *GoRunJsReq) GetParam() string {
+	if x != nil {
+		return x.Param
+	}
+	return ""
+}
+
+func (x *GoRunJsReq) GetStep() string {
+	if x != nil {
+		return x.Step
+	}
+	return ""
+}
+
+type GoRunJsResp struct {
+	state         protoimpl.MessageState
+	sizeCache     protoimpl.SizeCache
+	unknownFields protoimpl.UnknownFields
+
+	Result string `protobuf:"bytes,1,opt,name=result,proto3" json:"result,omitempty"`
+}
+
+func (x *GoRunJsResp) Reset() {
+	*x = GoRunJsResp{}
+	if protoimpl.UnsafeEnabled {
+		mi := &file_proto_js_proto_msgTypes[1]
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		ms.StoreMessageInfo(mi)
+	}
+}
+
+func (x *GoRunJsResp) String() string {
+	return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GoRunJsResp) ProtoMessage() {}
+
+func (x *GoRunJsResp) ProtoReflect() protoreflect.Message {
+	mi := &file_proto_js_proto_msgTypes[1]
+	if protoimpl.UnsafeEnabled && x != nil {
+		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+		if ms.LoadMessageInfo() == nil {
+			ms.StoreMessageInfo(mi)
+		}
+		return ms
+	}
+	return mi.MessageOf(x)
+}
+
+// Deprecated: Use GoRunJsResp.ProtoReflect.Descriptor instead.
+func (*GoRunJsResp) Descriptor() ([]byte, []int) {
+	return file_proto_js_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *GoRunJsResp) GetResult() string {
+	if x != nil {
+		return x.Result
+	}
+	return ""
+}
+
+var File_proto_js_proto protoreflect.FileDescriptor
+
+var file_proto_js_proto_rawDesc = []byte{
+	0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x6a, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+	0x12, 0x05, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x4a, 0x0a, 0x0a, 0x47, 0x6f, 0x52, 0x75, 0x6e,
+	0x4a, 0x73, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x72,
+	0x61, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x12,
+	0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73,
+	0x74, 0x65, 0x70, 0x22, 0x25, 0x0a, 0x0b, 0x47, 0x6f, 0x52, 0x75, 0x6e, 0x4a, 0x73, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x32, 0x44, 0x0a, 0x07, 0x47, 0x6f,
+	0x52, 0x75, 0x6e, 0x4a, 0x73, 0x12, 0x39, 0x0a, 0x10, 0x47, 0x6f, 0x52, 0x75, 0x6e, 0x4a, 0x73,
+	0x47, 0x65, 0x74, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x2e, 0x47, 0x6f, 0x52, 0x75, 0x6e, 0x4a, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70,
+	0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x47, 0x6f, 0x52, 0x75, 0x6e, 0x4a, 0x73, 0x52, 0x65, 0x73, 0x70,
+	0x42, 0x08, 0x5a, 0x06, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
+	0x6f, 0x33,
+}
+
+var (
+	file_proto_js_proto_rawDescOnce sync.Once
+	file_proto_js_proto_rawDescData = file_proto_js_proto_rawDesc
+)
+
+func file_proto_js_proto_rawDescGZIP() []byte {
+	file_proto_js_proto_rawDescOnce.Do(func() {
+		file_proto_js_proto_rawDescData = protoimpl.X.CompressGZIP(file_proto_js_proto_rawDescData)
+	})
+	return file_proto_js_proto_rawDescData
+}
+
+var file_proto_js_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_proto_js_proto_goTypes = []interface{}{
+	(*GoRunJsReq)(nil),  // 0: proto.GoRunJsReq
+	(*GoRunJsResp)(nil), // 1: proto.GoRunJsResp
+}
+var file_proto_js_proto_depIdxs = []int32{
+	0, // 0: proto.GoRunJs.GoRunJsGetResult:input_type -> proto.GoRunJsReq
+	1, // 1: proto.GoRunJs.GoRunJsGetResult:output_type -> proto.GoRunJsResp
+	1, // [1:2] is the sub-list for method output_type
+	0, // [0:1] is the sub-list for method input_type
+	0, // [0:0] is the sub-list for extension type_name
+	0, // [0:0] is the sub-list for extension extendee
+	0, // [0:0] is the sub-list for field type_name
+}
+
+func init() { file_proto_js_proto_init() }
+func file_proto_js_proto_init() {
+	if File_proto_js_proto != nil {
+		return
+	}
+	if !protoimpl.UnsafeEnabled {
+		file_proto_js_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*GoRunJsReq); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+		file_proto_js_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+			switch v := v.(*GoRunJsResp); i {
+			case 0:
+				return &v.state
+			case 1:
+				return &v.sizeCache
+			case 2:
+				return &v.unknownFields
+			default:
+				return nil
+			}
+		}
+	}
+	type x struct{}
+	out := protoimpl.TypeBuilder{
+		File: protoimpl.DescBuilder{
+			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+			RawDescriptor: file_proto_js_proto_rawDesc,
+			NumEnums:      0,
+			NumMessages:   2,
+			NumExtensions: 0,
+			NumServices:   1,
+		},
+		GoTypes:           file_proto_js_proto_goTypes,
+		DependencyIndexes: file_proto_js_proto_depIdxs,
+		MessageInfos:      file_proto_js_proto_msgTypes,
+	}.Build()
+	File_proto_js_proto = out.File
+	file_proto_js_proto_rawDesc = nil
+	file_proto_js_proto_goTypes = nil
+	file_proto_js_proto_depIdxs = nil
+}

+ 21 - 0
src/gorunjs/proto/js.proto

@@ -0,0 +1,21 @@
+syntax = "proto3";
+
+option go_package = "/proto";
+
+package proto;
+
+
+//model
+message GoRunJsReq {
+  string code  = 1;
+  string param = 2;
+  string step = 3;
+}
+message GoRunJsResp {
+  string result = 1;
+}
+
+//service
+service GoRunJs {
+  rpc GoRunJsGetResult(GoRunJsReq) returns(GoRunJsResp);
+}

+ 105 - 0
src/gorunjs/proto/js_grpc.pb.go

@@ -0,0 +1,105 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.2.0
+// - protoc             v3.19.4
+// source: proto/js.proto
+
+package proto
+
+import (
+	context "context"
+	grpc "google.golang.org/grpc"
+	codes "google.golang.org/grpc/codes"
+	status "google.golang.org/grpc/status"
+)
+
+// 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
+
+// GoRunJsClient is the client API for GoRunJs 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 GoRunJsClient interface {
+	GoRunJsGetResult(ctx context.Context, in *GoRunJsReq, opts ...grpc.CallOption) (*GoRunJsResp, error)
+}
+
+type goRunJsClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewGoRunJsClient(cc grpc.ClientConnInterface) GoRunJsClient {
+	return &goRunJsClient{cc}
+}
+
+func (c *goRunJsClient) GoRunJsGetResult(ctx context.Context, in *GoRunJsReq, opts ...grpc.CallOption) (*GoRunJsResp, error) {
+	out := new(GoRunJsResp)
+	err := c.cc.Invoke(ctx, "/proto.GoRunJs/GoRunJsGetResult", in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+// GoRunJsServer is the server API for GoRunJs service.
+// All implementations must embed UnimplementedGoRunJsServer
+// for forward compatibility
+type GoRunJsServer interface {
+	GoRunJsGetResult(context.Context, *GoRunJsReq) (*GoRunJsResp, error)
+	mustEmbedUnimplementedGoRunJsServer()
+}
+
+// UnimplementedGoRunJsServer must be embedded to have forward compatible implementations.
+type UnimplementedGoRunJsServer struct {
+}
+
+func (UnimplementedGoRunJsServer) GoRunJsGetResult(context.Context, *GoRunJsReq) (*GoRunJsResp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method GoRunJsGetResult not implemented")
+}
+func (UnimplementedGoRunJsServer) mustEmbedUnimplementedGoRunJsServer() {}
+
+// UnsafeGoRunJsServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to GoRunJsServer will
+// result in compilation errors.
+type UnsafeGoRunJsServer interface {
+	mustEmbedUnimplementedGoRunJsServer()
+}
+
+func RegisterGoRunJsServer(s grpc.ServiceRegistrar, srv GoRunJsServer) {
+	s.RegisterService(&GoRunJs_ServiceDesc, srv)
+}
+
+func _GoRunJs_GoRunJsGetResult_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(GoRunJsReq)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(GoRunJsServer).GoRunJsGetResult(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: "/proto.GoRunJs/GoRunJsGetResult",
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(GoRunJsServer).GoRunJsGetResult(ctx, req.(*GoRunJsReq))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+// GoRunJs_ServiceDesc is the grpc.ServiceDesc for GoRunJs service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var GoRunJs_ServiceDesc = grpc.ServiceDesc{
+	ServiceName: "proto.GoRunJs",
+	HandlerType: (*GoRunJsServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "GoRunJsGetResult",
+			Handler:    _GoRunJs_GoRunJsGetResult_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "proto/js.proto",
+}