autogenpb now configured in .proto files

This commit is contained in:
Jeff Carr 2024-12-01 22:24:01 -06:00
parent aeac6b5af7
commit 8f3953159a
6 changed files with 18 additions and 7 deletions

View File

@ -23,16 +23,16 @@ clean:
-rm -f go.* -rm -f go.*
droplet.pb.go: droplet.proto droplet.pb.go: droplet.proto
autogenpb --proto droplet.proto --mutex autogenpb --proto droplet.proto
hypervisor.pb.go: hypervisor.proto hypervisor.pb.go: hypervisor.proto
autogenpb --proto hypervisor.proto --mutex autogenpb --proto hypervisor.proto
event.pb.go: event.proto event.pb.go: event.proto
autogenpb --proto event.proto --mutex --no-sort autogenpb --proto event.proto
experiments.pb.go: experiments.proto experiments.pb.go: experiments.proto
autogenpb --proto experiments.proto --no-marshal --no-sort autogenpb --proto experiments.proto
deps: deps:
apt install golang-goprotobuf-dev apt install golang-goprotobuf-dev

View File

@ -1,3 +1,6 @@
these are .proto files. first stab. may be inaccurate This go library handles the protobuf files
writes out config files as protojson and prototext and various functions for virtigo.
todo: lots of stuff
You must build the protobuf files using autogenpb
go install go.wit.com/apps/autogenpb@latest

View File

@ -4,6 +4,8 @@ package virtbuf;
import "google/protobuf/duration.proto"; // Import the well-known type for Timestamp import "google/protobuf/duration.proto"; // Import the well-known type for Timestamp
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
// global settings for autogenpb `autogenpb:mutex`
message Droplets { // `autogenpb:marshal` message Droplets { // `autogenpb:marshal`
string uuid = 1; // I guess why not just have this on each file string uuid = 1; // I guess why not just have this on each file
string version = 2; // maybe can be used for protobuf schema change violations string version = 2; // maybe can be used for protobuf schema change violations

View File

@ -4,6 +4,8 @@ package virtbuf;
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
import "google/protobuf/any.proto"; // Import the well-known type for Timestamp import "google/protobuf/any.proto"; // Import the well-known type for Timestamp
// global settings for autogenpb `autogenpb:no-sort` `autogenpb:mutex`
message Events { // `autogenpb:marshal` message Events { // `autogenpb:marshal`
string uuid = 1; // I guess why not just have this on each file string uuid = 1; // I guess why not just have this on each file
string version = 2; // maybe can be used for protobuf schema change violations string version = 2; // maybe can be used for protobuf schema change violations

View File

@ -4,6 +4,8 @@ package virtbuf;
import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp import "google/protobuf/timestamp.proto"; // Import the well-known type for Timestamp
import "google/protobuf/any.proto"; // Import the well-known type for Timestamp import "google/protobuf/any.proto"; // Import the well-known type for Timestamp
// global settings for autogenpb `autogenpb:no-sort` `autogenpb:no-marshal`
message WhatsThis { message WhatsThis {
// is it possible to have custom formatting in JSON and TEXT marshal/unmarshal ? // is it possible to have custom formatting in JSON and TEXT marshal/unmarshal ?
WhatInfo humantest = 1; WhatInfo humantest = 1;

View File

@ -1,6 +1,8 @@
syntax = "proto3"; syntax = "proto3";
package virtbuf; package virtbuf;
// global settings for autogenpb `autogenpb:mutex`
message Hypervisors { // `autogenpb:marshal` message Hypervisors { // `autogenpb:marshal`
string uuid = 1; // I guess why not just have this on each file string uuid = 1; // I guess why not just have this on each file
string version = 2; // maybe can be used for protobuf schema change violations string version = 2; // maybe can be used for protobuf schema change violations