summaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
Diffstat (limited to 'example')
-rw-r--r--example/Makefile5
-rw-r--r--example/patchset.proto37
2 files changed, 42 insertions, 0 deletions
diff --git a/example/Makefile b/example/Makefile
index 1f3d285..e2673c3 100644
--- a/example/Makefile
+++ b/example/Makefile
@@ -16,13 +16,18 @@ vet:
build:
GO111MODULE=off go build -v
+simple:
+ ../autogenpb --proto fruit.proto --package main
+
withMutex:
../autogenpb --proto fruit.proto --package main
../autogenpb --proto file.proto --package main
+ ../autogenpb --proto patchset.proto --package main
withoutMutex:
../autogenpb --proto fruit.proto --package main --mutex=false
../autogenpb --proto file.proto --package main --mutex=false
+ ../autogenpb --proto patchset.proto --package main --mutex=false
goimports:
goimports -w *.go
diff --git a/example/patchset.proto b/example/patchset.proto
new file mode 100644
index 0000000..e5d56b9
--- /dev/null
+++ b/example/patchset.proto
@@ -0,0 +1,37 @@
+syntax = "proto3";
+
+package forgepb;
+
+import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
+
+message Patch {
+ string filename = 1; // `autogenpb:unique` `autogenpb:sort`
+ bytes data = 2; //
+ string repoPath = 3; // path to the git repo
+ string branchName = 4; //
+ string branchHash = 5; //
+ google.protobuf.Timestamp ctime = 7; // the git commit timestamp of this patch
+ string commitHash = 8; // the git commit hash of this patch
+ string startHash = 9; // the start commit hash
+ repeated string Files = 10; // the filenames this patch changes
+}
+
+message Patchset { // `autogenpb:marshal`
+ repeated Patch Patches = 1; //
+ string name = 2; //
+ string comment = 3; //
+ string gitAuthorName = 4; //
+ string gitAuthorEmail = 5; //
+ google.protobuf.Timestamp ctime = 6; // create time of this patchset
+ string tmpDir = 7; // temp dir
+ string startBranchName = 8; //
+ string endBranchName = 9; //
+ string startBranchHash = 10; //
+ string endBranchHash = 11; //
+}
+
+message Patchsets { // `autogenpb:marshal`
+ string uuid = 1; // `autogenpb:uuid:be926ad9-f07f-484c-adf2-d96eeabf3079` // todo: add autogenpb support for this
+ string version = 2; // `autogenpb:version:v0.0.45` // todo: add autogenpb support for this
+ repeated Patchset Patchsets = 3;
+}