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 Server
- type WSClient
- type WSServer
Constants ¶
View Source
const ( FIXED = 1 + iota THRESHOLD )
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 Server ¶
type Server struct { AlertManager *AlertManager Host string // contains filtered or unexported fields }
func NewServerFromConfig ¶
func NewServerFromConfig(a *AlertManager, server *shttp.Server) (*Server, error)
func (*Server) ListenAndServe ¶
func (s *Server) ListenAndServe()
type WSClient ¶
type WSClient struct {
// contains filtered or unexported fields
}
func (*WSClient) OnAlert ¶
func (c *WSClient) OnAlert(amsg *AlertMessage)
Called by alert.EvalNodes()
type WSServer ¶
type WSServer struct { AlertManager *AlertManager // contains filtered or unexported fields }
func (*WSServer) ListenAndServe ¶
func (s *WSServer) ListenAndServe()
Click to show internal directories.
Click to hide internal directories.