aboutsummaryrefslogtreecommitdiff
path: root/src/nimpb_buildpkg/plugin_pb.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/nimpb_buildpkg/plugin_pb.nim')
-rw-r--r--src/nimpb_buildpkg/plugin_pb.nim160
1 files changed, 160 insertions, 0 deletions
diff --git a/src/nimpb_buildpkg/plugin_pb.nim b/src/nimpb_buildpkg/plugin_pb.nim
new file mode 100644
index 0000000..fa9fc94
--- /dev/null
+++ b/src/nimpb_buildpkg/plugin_pb.nim
@@ -0,0 +1,160 @@
+import intsets
+
+import gen
+import nimpb/nimpb
+
+import descriptor_pb
+
+const
+ VersionDesc = MessageDesc(
+ name: "Version",
+ fields: @[
+ FieldDesc(
+ name: "major",
+ number: 1,
+ ftype: FieldType.Int32,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "minor",
+ number: 2,
+ ftype: FieldType.Int32,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "patch",
+ number: 3,
+ ftype: FieldType.Int32,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "suffix",
+ number: 4,
+ ftype: FieldType.String,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ )
+ ]
+ )
+
+ CodeGeneratorRequestDesc = MessageDesc(
+ name: "CodeGeneratorRequest",
+ fields: @[
+ FieldDesc(
+ name: "file_to_generate",
+ number: 1,
+ ftype: FieldType.String,
+ label: FieldLabel.Repeated,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "parameter",
+ number: 2,
+ ftype: FieldType.String,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "proto_file",
+ number: 15,
+ ftype: FieldType.Message,
+ label: FieldLabel.Repeated,
+ typeName: "FileDescriptorProto",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "compiler_version",
+ number: 3,
+ ftype: FieldType.Message,
+ label: FieldLabel.Optional,
+ typeName: "Version",
+ packed: false,
+ oneofIdx: -1,
+ )
+ ]
+ )
+
+ CodeGeneratorResponseDesc = MessageDesc(
+ name: "CodeGeneratorResponse",
+ fields: @[
+ FieldDesc(
+ name: "error",
+ number: 1,
+ ftype: FieldType.String,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "file",
+ number: 15,
+ ftype: FieldType.Message,
+ label: FieldLabel.Repeated,
+ typeName: "CodeGeneratorResponse_File",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ ]
+ )
+
+ CodeGeneratorResponse_FileDesc = MessageDesc(
+ name: "CodeGeneratorResponse_File",
+ fields: @[
+ FieldDesc(
+ name: "name",
+ number: 1,
+ ftype: FieldType.String,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "insertion_point",
+ number: 2,
+ ftype: FieldType.String,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ FieldDesc(
+ name: "content",
+ number: 15,
+ ftype: FieldType.String,
+ label: FieldLabel.Optional,
+ typeName: "",
+ packed: false,
+ oneofIdx: -1,
+ ),
+ ]
+ )
+
+generateMessageType(VersionDesc)
+generateMessageProcs(VersionDesc)
+
+generateMessageType(CodeGeneratorRequestDesc)
+generateMessageProcs(CodeGeneratorRequestDesc)
+
+generateMessageType(CodeGeneratorResponse_FileDesc)
+generateMessageProcs(CodeGeneratorResponse_FileDesc)
+
+generateMessageType(CodeGeneratorResponseDesc)
+generateMessageProcs(CodeGeneratorResponseDesc)