autogenpb now configured in .proto files
This commit is contained in:
parent
aeac6b5af7
commit
8f3953159a
8
Makefile
8
Makefile
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue