From e07c6a35fd5d2ca1b3a6c09d9781d21f676f52f2 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 10 Jan 2025 07:40:24 -0600 Subject: detect that autogenpb has already been run and exit --- file.proto | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'file.proto') diff --git a/file.proto b/file.proto index 740761d..18b096a 100644 --- a/file.proto +++ b/file.proto @@ -25,6 +25,12 @@ package main; // it needs in these protobuf files, then it processes the // protobuf files to write out *.sort.pb.go and *.marshal.pb.go files // +message MsgVar { + string varName = 1; // the variable name + string varType = 2; // the variable type + bool isRepeated = 3; // does the variable repeate +} + message MsgName { string name = 1; // the name of the message aka struct. for this example: "Shelf" string lockname = 2; // name of the lockfile. ends in Mu @@ -34,6 +40,7 @@ message MsgName { bool mutexFound = 6; // true if the mutex was added to the protoc pb.go file repeated string sort = 7; // keys to sort on repeated string unique = 8; // if the fields should have AppendUnique() functions + repeated MsgVar vars = 9; // store all the vars in the message } message File { @@ -48,6 +55,7 @@ message File { // every struct in this proto file, this file has: "Apple", "Apples", ... "File", etc... repeated MsgName msgNames = 9; + repeated MsgName sortNames = 10; // variables that are repeated can have the standard functions generated (Sort(), etc) } // I know, I know, the whole point of using protobuf -- cgit v1.2.3