diff --git a/Makefile b/Makefile index c9517e5..d8f264b 100644 --- a/Makefile +++ b/Makefile @@ -23,16 +23,16 @@ clean: -rm -f go.* droplet.pb.go: droplet.proto - autogenpb --proto droplet.proto --mutex + autogenpb --proto droplet.proto hypervisor.pb.go: hypervisor.proto - autogenpb --proto hypervisor.proto --mutex + autogenpb --proto hypervisor.proto event.pb.go: event.proto - autogenpb --proto event.proto --mutex --no-sort + autogenpb --proto event.proto experiments.pb.go: experiments.proto - autogenpb --proto experiments.proto --no-marshal --no-sort + autogenpb --proto experiments.proto deps: apt install golang-goprotobuf-dev diff --git a/README.md b/README.md index 6c1ca70..d9ad0ca 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ -these are .proto files. first stab. may be inaccurate -writes out config files as protojson and prototext -todo: lots of stuff +This go library handles the protobuf files +and various functions for virtigo. + +You must build the protobuf files using autogenpb + + go install go.wit.com/apps/autogenpb@latest diff --git a/droplet.proto b/droplet.proto index 42eeec5..f483f7d 100644 --- a/droplet.proto +++ b/droplet.proto @@ -4,6 +4,8 @@ package virtbuf; import "google/protobuf/duration.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` 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 diff --git a/event.proto b/event.proto index 8e098b5..421565b 100644 --- a/event.proto +++ b/event.proto @@ -4,6 +4,8 @@ package virtbuf; import "google/protobuf/timestamp.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` 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 diff --git a/experiments.proto b/experiments.proto index 2db67b3..a489952 100644 --- a/experiments.proto +++ b/experiments.proto @@ -4,6 +4,8 @@ package virtbuf; import "google/protobuf/timestamp.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 { // is it possible to have custom formatting in JSON and TEXT marshal/unmarshal ? WhatInfo humantest = 1; diff --git a/hypervisor.proto b/hypervisor.proto index d91aef3..703ffb3 100644 --- a/hypervisor.proto +++ b/hypervisor.proto @@ -1,6 +1,8 @@ syntax = "proto3"; package virtbuf; +// global settings for autogenpb `autogenpb:mutex` + message Hypervisors { // `autogenpb:marshal` 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