// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
// Use of this source code is governed by the GPL 3.0

package main

import (
	"time"

	"go.wit.com/gui"
	"go.wit.com/lib/gadgets"
	"go.wit.com/lib/protobuf/zoopb"
)

var me *zookeep

// this app's variables
type zookeep struct {
	hostname  string          // my fqdn dns zookeeper hostname
	pollDelay time.Duration   // how often to report our status
	dog       *time.Ticker    // the watchdog timer
	dogchan   chan bool       // can kill the watchdog
	distro    string          // debian,redhat,gentoo,macos,wincrap
	packages  *zoopb.Packages // installed packages and versions
	machines  *zoopb.Machines // every machine that has reported itself to the zookeeper
	// machines2   *zoopb.Machines        // every machine that has reported itself to the zookeeper
	targets     map[string]string      // what versions the machines should be running
	upgrade     map[string]bool        // use this to trigger builds
	myGui       *gui.Node              // the gui toolkit handle
	machinesWin *gadgets.GenericWindow // the machines gui window
	machinesBox *gui.Node              // the machines gui parent box widget
	machinesTB  *zoopb.MachinesTable   // the machines gui table buffer
	zood        *stdTableWin           // the zood version window
}