Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlertToFault ¶
func AlertToFault(alert template.Alert, fm *FaultManager, namingCodes map[string]string) (StatusResult, *govel.EventFault, CommitFunc)
AlertToFault convert Alert to VES fault and store it into a map; return status, id and a function used to finalize the operation. The function returned must be called after having successfully sent the alert to VES status could be: inError,alreadyExist, stored, cleared
Types ¶
type AlertInfos ¶
AlertInfos struct used to store sequence and startepoch of the alert
type CommitFunc ¶
type CommitFunc func() error
CommitFunc is a function used to commit a fault conversion operation
type FaultManager ¶
type FaultManager struct {
// contains filtered or unexported fields
}
FaultManager struct used to manage and store fault
func NewFaultManager ¶
func NewFaultManager(conf *govel.EventConfiguration) *FaultManager
NewFaultManager create a FaultManager return a pointer on the FaultManager created
func NewFaultManagerWithState ¶
func NewFaultManagerWithState(conf *govel.EventConfiguration, state FaultManagerState) *FaultManager
NewFaultManagerWithState with state management
func (*FaultManager) GetEventConf ¶
func (fm *FaultManager) GetEventConf() *govel.EventConfiguration
GetEventConf return a pointer on config.EventConfiguration
func (*FaultManager) GetFaultState ¶
func (fm *FaultManager) GetFaultState() FaultManagerState
GetFaultState returns a reference to the underlying fault manager state
type FaultManagerState ¶
type FaultManagerState interface { // NextFaultIndex return the Fault Index and increments it NextFaultIndex() (int32, error) // IncrementFaultSn increments the fault sequence number IncrementFaultSn(faultID int32) error // GetFaultSn return the fault sequence number GetFaultSn(faultID int32) int64 // GetFaultStartEpoch return the startEpoch GetFaultStartEpoch(faultID int32) int64 // SetFaultStartEpoch set the startEpoch SetFaultStartEpoch(faultID int32, epoch int64) error // InitAlertInfos update the alertInfos map InitAlertInfos(faultID int32) error // GetFaultInStorage checks if faultName already associated to an index GetFaultInStorage(faultName string) int32 // StoreFaultInStorage stores the index associated to the faultName StoreFaultInStorage(faultName string, faultID int32) error // DeleteFaultInStorage delete Fault in storage DeleteFaultInStorage(faultName string) error }
FaultManagerState handles the alert internal state
type StatusResult ¶
type StatusResult int
StatusResult describes the result of the operation on storage
const ( InError StatusResult = 0 AlreadyExist StatusResult = 1 Stored StatusResult = 2 Cleared StatusResult = 3 NotExist StatusResult = 4 )
Possible values for StatusResult