add hypervisor struct

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-10-22 03:26:02 -05:00
parent 9bc90046d9
commit c9c0abc440
3 changed files with 19 additions and 0 deletions

View File

@ -13,6 +13,8 @@ all:
# Then: # Then:
protoc --version protoc --version
make droplet.pb.go make droplet.pb.go
make hypervisor.pb.go
make cluster.pb.go
cd configfile && make cd configfile && make
vet: vet:
@ -43,10 +45,16 @@ droplet.pb.go: droplet.proto
--go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \ --go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \
droplet.proto droplet.proto
hypervisor.pb.go: hypervisor.proto
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \
--go_opt=Mhypervisor.proto=go.wit.com/lib/protobuf/virtbuf \
hypervisor.proto
cluster.pb.go: cluster.proto cluster.pb.go: cluster.proto
cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \ cd ~/go/src && protoc --go_out=. --proto_path=go.wit.com/lib/protobuf/virtbuf \
--go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \ --go_opt=Mdroplet.proto=go.wit.com/lib/protobuf/virtbuf \
--go_opt=Mcluster.proto=go.wit.com/lib/protobuf/virtbuf \ --go_opt=Mcluster.proto=go.wit.com/lib/protobuf/virtbuf \
--go_opt=Mhypervisor.proto=go.wit.com/lib/protobuf/virtbuf \
cluster.proto cluster.proto

View File

@ -2,8 +2,10 @@ syntax = "proto3";
package virtbuf; package virtbuf;
import "droplet.proto"; import "droplet.proto";
import "hypervisor.proto";
message Cluster { message Cluster {
int64 id = 1; int64 id = 1;
repeated Droplet droplets = 2; repeated Droplet droplets = 2;
repeated Hypervisor hypervisors = 3;
} }

9
hypervisor.proto Normal file
View File

@ -0,0 +1,9 @@
syntax = "proto3";
package virtbuf;
message Hypervisor {
string hostname = 1;
bool active = 2;
int64 cpus = 3;
int64 memory = 4;
}