skymgrmon

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 2, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL