// Copyright 2017-2025 WIT.COM Inc. All rights reserved. // Use of this source code is governed by the GPL 3.0 package main import ( sync "sync" "time" "go.wit.com/dev/alexflint/arg" "go.wit.com/gui" "go.wit.com/lib/fhelp" "go.wit.com/lib/gadgets" "go.wit.com/lib/protobuf/argvpb" "go.wit.com/lib/protobuf/forgepb" ) var me *gusconf // this app's variables type gusconf struct { argv *argvpb.Argv // more experiments for bash handling pp *arg.Parser // for parsing the command line args. Yay to alexf lint! myGui *fhelp.GuiPrep // for initializing the GUI toolkits forge *forgepb.Forge // your customized repo preferences and settings portmaps *Portmaps // the portmap window portwin *stdTableWin // the portwin window events *Events // the event log eventswin *stdEventTableWin // the event window eventsChanged bool // are there new events? urlbase string // the dns name for the zookeeper hostname string // my hostname pollDelay time.Duration // how often to report our status dog *time.Ticker // the watchdog timer failcount int // how many times we've failed to contact the zookeeper failcountmax int // after this, exit and let systemd restart the daemon } type stdTableWin struct { sync.Mutex win *gadgets.GenericWindow // the machines gui window box *gui.Node // the machines gui parent box widget TB *PortmapsTable // the gui table buffer update bool // if the window should be updated } func (w *stdTableWin) Toggle() { if w == nil { return } if w.win == nil { return } w.win.Toggle() } type stdEventTableWin struct { sync.Mutex win *gadgets.GenericWindow // the machines gui window box *gui.Node // the machines gui parent box widget TB *EventsTable // the gui table buffer update bool // if the window should be updated } func (w *stdEventTableWin) Toggle() { if w == nil { return } if w.win == nil { return } w.win.Toggle() }