Documentation ¶
Index ¶
- Constants
- type GremlinAlert
- type Message
- type Server
- func (a *Server) OnEdgeAdded(e *graph.Edge)
- func (a *Server) OnEdgeDeleted(e *graph.Edge)
- func (a *Server) OnEdgeUpdated(e *graph.Edge, ops []graph.PartiallyUpdatedOp)
- func (a *Server) OnNodeAdded(n *graph.Node)
- func (a *Server) OnNodeDeleted(n *graph.Node)
- func (a *Server) OnNodeUpdated(n *graph.Node, ops []graph.PartiallyUpdatedOp)
- func (a *Server) Start()
- func (a *Server) Stop()
Constants ¶
View Source
const (
// Namespace is the alerting WebSocket namespace
Namespace = "Alert"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GremlinAlert ¶
GremlinAlert represents an alert that will be triggered if its associated Gremlin expression returns a non empty result.
func NewGremlinAlert ¶
func NewGremlinAlert(alert *types.Alert, g *graph.Graph, p *traversal.GremlinTraversalParser) (*GremlinAlert, error)
NewGremlinAlert returns a new gremlin based alert
type Message ¶
Message describes a websocket message that is sent by the alerting server when an alert was triggered
type Server ¶
type Server struct { insanelock.RWMutex etcd.MasterElection Graph *graph.Graph Pool ws.StructSpeakerPool AlertHandler rest.ResourceWatcher // contains filtered or unexported fields }
Server describes an alerting alerts that evaluates registered alerts on graph events or periodically and trigger them if their condition evaluates to true
func NewServer ¶
func NewServer(apiServer *api.Server, pool ws.StructSpeakerPool, graph *graph.Graph, parser *traversal.GremlinTraversalParser, etcdClient *etcd.Client, assets assets.Assets) (*Server, error)
NewServer creates a new alerting server
func (*Server) OnEdgeUpdated ¶
func (a *Server) OnEdgeUpdated(e *graph.Edge, ops []graph.PartiallyUpdatedOp)
OnEdgeUpdated event
func (*Server) OnNodeUpdated ¶
func (a *Server) OnNodeUpdated(n *graph.Node, ops []graph.PartiallyUpdatedOp)
OnNodeUpdated event
Click to show internal directories.
Click to hide internal directories.