updated proto files to conform with autogenpb

This commit is contained in:
Jeff Carr 2025-02-07 18:23:05 -06:00
parent 54f4c4be3d
commit d8a2e56b88
5 changed files with 30 additions and 32 deletions

View File

@ -5,7 +5,7 @@
# go install # go install
all: package.pb.go machine.pb.go vet all: package.pb.go machine.pb.go goimports vet
vet: vet:
@GO111MODULE=off go vet @GO111MODULE=off go vet

9
apt.go
View File

@ -24,17 +24,14 @@ func (me *Machine) initPackages() {
new1 := new(Package) new1 := new(Package)
new1.Name = pkg new1.Name = pkg
new1.Version = version new1.Version = version
if me.Packages.Append(new1) { me.Packages.Append(new1)
// log.Info("added", new1.Name, "ok")
} else {
log.Info("added", new1.Name, "failed") log.Info("added", new1.Name, "failed")
} }
} }
}
func (me *Machine) addNew(name string, version string) bool { func (me *Machine) addNew(name string, version string) {
new1 := new(Package) new1 := new(Package)
new1.Name = name new1.Name = name
new1.Version = version new1.Version = version
return me.Packages.Append(new1) me.Packages.Append(new1)
} }

View File

@ -75,6 +75,7 @@ func (me *Machine) UpdatePackages() string {
log.Info("fixme. broken after move to autogenpb") log.Info("fixme. broken after move to autogenpb")
return "" return ""
} }
/* /*
func (me *Machine) UpdatePackages() string { func (me *Machine) UpdatePackages() string {
// Get the list of installed packages for the detected distro // Get the list of installed packages for the detected distro

View File

@ -20,7 +20,7 @@ message Machine { // `autogenpb:marshal`
} }
message Machines { // `autogenpb:marshal` message Machines { // `autogenpb:marshal`
string uuid = 1; // I guess why not just have this on each file string uuid = 1; // `autogenpb:uuid:b57e7fac-a8fc-4949-9d50-fa38312dec87`
string version = 2; // maybe can be used for protobuf schema change violations string version = 2; // `autogenpb:version:v0.0.1`
repeated Machine machines = 3; repeated Machine machines = 3;
} }

View File

@ -8,7 +8,7 @@ import "google/protobuf/timestamp.proto"; // Import the well-known type for Time
// global settings for autogenpb `autogenpb:mutex` // global settings for autogenpb `autogenpb:mutex`
message Package { message Package {
string name = 1; // `autogenpb:unique` // name: zookeeper-go string name = 1; // `autogenpb:unique` `autogenpb:sort`
string version = 2; // version: 0.0.3 string version = 2; // version: 0.0.3
google.protobuf.Timestamp laststamp = 3; // the last time this package was seen (used to timeout entries) google.protobuf.Timestamp laststamp = 3; // the last time this package was seen (used to timeout entries)
string srcPath = 4; // path to the sources (go.wit.com/apps/zookeeper) string srcPath = 4; // path to the sources (go.wit.com/apps/zookeeper)
@ -17,7 +17,7 @@ message Package {
} }
message Packages { // `autogenpb:marshal` message Packages { // `autogenpb:marshal`
string uuid = 1; // I guess why not just have this on each file string uuid = 1; // `autogenpb:uuid:2f26cc03-ea30-4481-a333-ad0acc86e1d3`
string version = 2; // maybe can be used for protobuf schema change violations string version = 2; // `autogenpb:version:v0.0.1`
repeated Package packages = 3; repeated Package packages = 3;
} }