Documentation
¶
Overview ¶
Package es contains an emergency stop implementation. This data is read from es.json file every 10 seconds. If the data changes, subscribers will receive an update.
Using this is simple:
ch, cancel := es.Data.Subscribe("SatelliteDiskErase") defer cancel() if <-ch != es.Go { // Do something } select { case <-ch: log.Println("ES changed to Stop state ") }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct { // Name is the WorkReq type. Name string // Status is the emergency stop status. Status Status }
Info is the emergency stop information for a particular entry in our es.json file.
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
Reader reads the es.json file at intervals and makes the data and changes to the data available.
var Data *Reader
Data is how to access the emergency stop information.
func (*Reader) Subscribe ¶
Subscribe returns a channel that sends a Status whenever a ES entry changes status. This will send the initial Status immediately. If the name is not found, this will send Stop and close the channel. If there is a transition to Stop, the channel will be closed once this is sent. Once you either receive a Stop or are no longer interested in listening, simply call Cancel().