Documentation ¶
Index ¶
- type SkyManagerMonitor
- func (smm *SkyManagerMonitor) BuildConnectionStatusMsg(msgTitle string) string
- func (smm *SkyManagerMonitor) ConnectedDiscNodeCount() (int, error)
- func (smm *SkyManagerMonitor) DoCancelFunc()
- func (smm *SkyManagerMonitor) GetCancelFunc() func()
- func (smm *SkyManagerMonitor) GetConnectedNodeCount() int
- func (smm *SkyManagerMonitor) GetNodeKeyList() []string
- func (smm *SkyManagerMonitor) GetUpdateStarted() bool
- func (smm *SkyManagerMonitor) IsRunning() bool
- func (smm *SkyManagerMonitor) RunManagerMonitor(runctx context.Context, doCancelFunc func(), statusMsgChan chan<- string, ...)
- func (smm *SkyManagerMonitor) SetCancelFunc(cf func())
- func (smm *SkyManagerMonitor) SetUpdateStarted(flag bool)
- func (smm *SkyManagerMonitor) StopManagerMonitor()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SkyManagerMonitor ¶
type SkyManagerMonitor struct { ManagerAddress string DiscoveryAddress string // contains filtered or unexported fields }
SkyManagerMonitor is used to monitor a Sky Manager and provide messages to the main process when specific events are detected.
func NewMonitor ¶
func NewMonitor(manageraddress, discoveryaddress string) *SkyManagerMonitor
NewMonitor creates a SkyManagerMonitor which will monitor the provided managerip.
func (*SkyManagerMonitor) BuildConnectionStatusMsg ¶
func (smm *SkyManagerMonitor) BuildConnectionStatusMsg(msgTitle string) string
BuildConnectionStatusMsg returns a formatted status message regarding the current connection status with the Discovery Server
func (*SkyManagerMonitor) ConnectedDiscNodeCount ¶
func (smm *SkyManagerMonitor) ConnectedDiscNodeCount() (int, error)
ConnectedDiscNodeCount returns a count the locally Managed Nodes that are connected to the Discovery Node
func (*SkyManagerMonitor) DoCancelFunc ¶
func (smm *SkyManagerMonitor) DoCancelFunc()
DoCancelFunc is a thread-safe function for calling the cancelFunc on the SkyManagerMonitor struct
func (*SkyManagerMonitor) GetCancelFunc ¶
func (smm *SkyManagerMonitor) GetCancelFunc() func()
GetCancelFunc is a thread-safe function for accessing (getting) the value of cancelFunc on the SkyManagerMonitor struct
func (*SkyManagerMonitor) GetConnectedNodeCount ¶
func (smm *SkyManagerMonitor) GetConnectedNodeCount() int
GetConnectedNodeCount will return the count of Nodes within the connectedNodes structure If the structure is nil (not yet assigned), 0 will be returned
func (*SkyManagerMonitor) GetNodeKeyList ¶
func (smm *SkyManagerMonitor) GetNodeKeyList() []string
GetNodeKeyList returns a []string (slice) containing the currently connected node keys
func (*SkyManagerMonitor) GetUpdateStarted ¶
func (smm *SkyManagerMonitor) GetUpdateStarted() bool
GetUpdateStarted is a thread-safe function for checking if the updateStarted flag has been set
func (*SkyManagerMonitor) IsRunning ¶
func (smm *SkyManagerMonitor) IsRunning() bool
IsRunning determines if the SkyMgrMonitor is running or not. This is assessed based on the assignment of the context cancel function (one is assigned if it is running).
func (*SkyManagerMonitor) RunManagerMonitor ¶
func (smm *SkyManagerMonitor) RunManagerMonitor(runctx context.Context, doCancelFunc func(), statusMsgChan chan<- string, pollInt time.Duration)
RunManagerMonitor starts the SkyManagerMonitor monitoring of the local Manager Node. If `ctx` is not nil, the monitor will listen to ctx.Done() and stop monitoring when it receives the signal.
func (*SkyManagerMonitor) SetCancelFunc ¶
func (smm *SkyManagerMonitor) SetCancelFunc(cf func())
SetCancelFunc is a thread-safe function for setting the cancelFunc on the SkyManagerMonitor struct
func (*SkyManagerMonitor) SetUpdateStarted ¶
func (smm *SkyManagerMonitor) SetUpdateStarted(flag bool)
SetUpdateStarted is a thread-safe function for setting the updateStarted flag has been set
func (*SkyManagerMonitor) StopManagerMonitor ¶
func (smm *SkyManagerMonitor) StopManagerMonitor()
StopManagerMonitor stops the SkyManagerMonitor monitoring of the local Manager Node. If `ctx` is not nil, the monitor will listen to ctx.Done() and stop monitoring when it receives the signal.