 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- Constants
- type AlertEventListener
- type AlertManager
- func (a *AlertManager) AddEventListener(l AlertEventListener)
- func (a *AlertManager) DelEventListener(l AlertEventListener)
- func (a *AlertManager) DeleteAlert(id string)
- func (a *AlertManager) EvalNodes()
- func (a *AlertManager) OnNodeAdded(n *graph.Node)
- func (a *AlertManager) OnNodeUpdated(n *graph.Node)
- func (a *AlertManager) SetAlert(at *api.Alert)
- func (a *AlertManager) Start()
- func (a *AlertManager) Stop()
 
- type AlertMessage
- type AlertServer
Constants ¶
      View Source
      
  
    const ( FIXED = 1 + iota THRESHOLD )
      View Source
      
  
const (
	Namespace = "Alert"
)
    Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertEventListener ¶
type AlertEventListener interface {
	OnAlert(n *AlertMessage)
}
    type AlertManager ¶
type AlertManager struct {
	graph.DefaultGraphListener
	Graph        *graph.Graph
	AlertHandler api.ApiHandler
	// contains filtered or unexported fields
}
    func NewAlertManager ¶
func NewAlertManager(g *graph.Graph, ah api.ApiHandler) *AlertManager
func (*AlertManager) AddEventListener ¶
func (a *AlertManager) AddEventListener(l AlertEventListener)
func (*AlertManager) DelEventListener ¶
func (a *AlertManager) DelEventListener(l AlertEventListener)
func (*AlertManager) DeleteAlert ¶
func (a *AlertManager) DeleteAlert(id string)
func (*AlertManager) EvalNodes ¶
func (a *AlertManager) EvalNodes()
func (*AlertManager) OnNodeAdded ¶
func (a *AlertManager) OnNodeAdded(n *graph.Node)
func (*AlertManager) OnNodeUpdated ¶
func (a *AlertManager) OnNodeUpdated(n *graph.Node)
func (*AlertManager) SetAlert ¶
func (a *AlertManager) SetAlert(at *api.Alert)
func (*AlertManager) Start ¶
func (a *AlertManager) Start()
func (*AlertManager) Stop ¶
func (a *AlertManager) Stop()
type AlertMessage ¶
type AlertMessage struct {
	UUID       string
	Type       int
	Timestamp  time.Time
	Count      int
	Reason     string
	ReasonData interface{}
}
    func (*AlertMessage) Marshal ¶
func (am *AlertMessage) Marshal() []byte
func (*AlertMessage) String ¶
func (am *AlertMessage) String() string
type AlertServer ¶ added in v0.5.0
type AlertServer struct {
	shttp.DefaultWSServerEventHandler
	WSServer     *shttp.WSServer
	AlertManager *AlertManager
	// contains filtered or unexported fields
}
    func NewServer ¶
func NewServer(a *AlertManager, server *shttp.WSServer) *AlertServer
func (*AlertServer) OnRegisterClient ¶ added in v0.5.0
func (a *AlertServer) OnRegisterClient(c *shttp.WSClient)
func (*AlertServer) OnUnregisterClient ¶ added in v0.5.0
func (a *AlertServer) OnUnregisterClient(c *shttp.WSClient)
       Source Files
      ¶
      Source Files
      ¶
    
- manager.go
- server.go
 Click to show internal directories. 
   Click to hide internal directories.