Documentation ¶
Index ¶
- Constants
- func MarkI18nMessages()
- type AdvertisePolicyCommand
- type AgreementWorker
- func (w *AgreementWorker) CommandHandler(command worker.Command) bool
- func (w *AgreementWorker) Initialize() bool
- func (w *AgreementWorker) Messages() chan events.Message
- func (w *AgreementWorker) NewEvent(incoming events.Message)
- func (w *AgreementWorker) NodePolicyDeleted()
- func (w *AgreementWorker) NodePolicyUpdated()
- type DeviceRegisteredCommand
- type EdgeConfigCompleteCommand
- type NodePolicyChangedCommand
Constants ¶
const ( EL_AG_UNABLE_READ_POL_FILE = "Unable to read policy file %v for service %v, error: %v" EL_AG_START_ADVERTISE_POL = "Start policy advertising with the exchange for service %v/%v." EL_AG_UNABLE_ADVERTISE_POL = "Unable to advertise policies with exchange for service %v/%v, error: %v" EL_AG_COMPLETE_ADVERTISE_POL = "Complete policy advertising with the exchange for service %v/%v." EL_AG_NODE_HB_FAILED = "Node heartbeat failed for node %v/%v. Error: %v" EL_AG_NODE_HB_RESTORED = "Node heartbeat restored for node %v/%v." EL_AG_UNABLE_READ_NODE_POL_FROM_DB = "unable to read node policy from the local database. %v" EL_AG_UNABLE_READ_NODE_FROM_DB = "Unable to read node object from the local database. %v" EL_AG_UNABLE_SYNC_NODE_POL_WITH_EXCH = "Unable to sync the local node policy with the exchange copy. Error: %v" EL_AG_NODE_POL_SYNCED_WITH_EXCH = "Node policy updated with the exchange copy: %v" EL_AG_UNABLE_SYNC_NODE_UI_WITH_EXCH = "Unable to sync the local node user input with the exchange copy. Error: %v" EL_AG_NODE_UI_SYNCED_WITH_EXCH = "Node user input updated with the exchange copy. The changed user inputs are: %v" EL_AG_NODE_CANNOT_VERIFY_AG = "Node could not verify the agreement %v with the consumer. Will cancel it" EL_AG_NODE_IS_OFFLINE = "Node is offline. Logging of periodic offline error messages will be curtailed until connection is restored" )
messages for eventlog
const HEARTBEAT = "HeartBeat"
for identifying the subworkers used by this worker
const NODEPOLICY = "NodePolicy"
const NODEUSERINPUT = "NodeUserInput"
const SURFACEERRORS = "SurfaceExchErrors"
Variables ¶
This section is empty.
Functions ¶
func MarkI18nMessages ¶
func MarkI18nMessages()
This is does nothing useful at run time. This code is only used in compileing time to make the eventlog messages gets into the catalog so that they can be translated. The event log messages will be saved in English. But the CLI can request them in different languages.
Types ¶
type AdvertisePolicyCommand ¶
type AdvertisePolicyCommand struct {
PolicyFile string
}
==============================================================================================================
func NewAdvertisePolicyCommand ¶
func NewAdvertisePolicyCommand(fileName string) *AdvertisePolicyCommand
func (AdvertisePolicyCommand) ShortString ¶
func (a AdvertisePolicyCommand) ShortString() string
type AgreementWorker ¶
type AgreementWorker struct { worker.BaseWorker // embedded field // contains filtered or unexported fields }
must be safely-constructed!!
func NewAgreementWorker ¶
func NewAgreementWorker(name string, cfg *config.HorizonConfig, db *bolt.DB, pm *policy.PolicyManager) *AgreementWorker
func (*AgreementWorker) CommandHandler ¶
func (w *AgreementWorker) CommandHandler(command worker.Command) bool
Enter the command processing loop. Initialization is complete so wait for commands to perform. Commands are created as the result of events that are triggered elsewhere in the system. This function returns ture if the command was handled, false if not.
func (*AgreementWorker) Initialize ¶
func (w *AgreementWorker) Initialize() bool
Initialize the agreement worker before it begins processing commands.
func (*AgreementWorker) Messages ¶
func (w *AgreementWorker) Messages() chan events.Message
func (*AgreementWorker) NewEvent ¶
func (w *AgreementWorker) NewEvent(incoming events.Message)
func (*AgreementWorker) NodePolicyDeleted ¶
func (w *AgreementWorker) NodePolicyDeleted()
handles the node policy DELETE_POLICY event
func (*AgreementWorker) NodePolicyUpdated ¶
func (w *AgreementWorker) NodePolicyUpdated()
handles the node policy UPDATE_POLICY event
type DeviceRegisteredCommand ¶
type DeviceRegisteredCommand struct {
Msg *events.EdgeRegisteredExchangeMessage
}
func NewDeviceRegisteredCommand ¶
func NewDeviceRegisteredCommand(msg *events.EdgeRegisteredExchangeMessage) *DeviceRegisteredCommand
func (DeviceRegisteredCommand) ShortString ¶
func (d DeviceRegisteredCommand) ShortString() string
type EdgeConfigCompleteCommand ¶
type EdgeConfigCompleteCommand struct {
Msg *events.EdgeConfigCompleteMessage
}
==============================================================================================================
func NewEdgeConfigCompleteCommand ¶
func NewEdgeConfigCompleteCommand(msg *events.EdgeConfigCompleteMessage) *EdgeConfigCompleteCommand
func (EdgeConfigCompleteCommand) ShortString ¶
func (d EdgeConfigCompleteCommand) ShortString() string
type NodePolicyChangedCommand ¶
type NodePolicyChangedCommand struct {
Msg *events.NodePolicyMessage
}
==============================================================================================================
func NewNodePolicyChangedCommand ¶
func NewNodePolicyChangedCommand(msg *events.NodePolicyMessage) *NodePolicyChangedCommand
func (NodePolicyChangedCommand) ShortString ¶
func (d NodePolicyChangedCommand) ShortString() string