Documentation ¶
Index ¶
Constants ¶
View Source
const ( TypeAlarm = "alarm" TypeEntity = "entity" )
View Source
const ( ActionOpen = "open" ActionCopy = "copy" )
Variables ¶
Functions ¶
func MergeLinks ¶
func MergeLinks(left, right map[string]LinksByCategory) map[string]LinksByCategory
Types ¶
type ExternalDataParameters ¶
type ExternalDataParameters struct { Type string `bson:"type" json:"type" binding:"required,oneof=mongo"` Collection string `bson:"collection" json:"collection" binding:"required"` Select map[string]string `bson:"select" json:"select"` Regexp map[string]string `bson:"regexp" json:"regexp"` SortBy string `bson:"sort_by" json:"sort_by"` Sort string `bson:"sort" json:"sort" binding:"oneoforempty=asc desc"` }
type Generator ¶
type Generator interface { GenerateForAlarm(ctx context.Context, alarm types.Alarm, entity types.Entity, user User) (LinksByCategory, error) GenerateForAlarms(ctx context.Context, alarmIds []string, user User) (map[string]LinksByCategory, error) GenerateForEntities(ctx context.Context, entityIds []string, user User) (map[string]LinksByCategory, error) GenerateCombinedForAlarmsByRule(ctx context.Context, ruleId string, alarmIds []string, user User) ([]Link, error) Load(ctx context.Context) error }
type Link ¶
type Parameters ¶
type Parameters struct { Label string `bson:"label" json:"label" binding:"required,max=255"` Category string `bson:"category" json:"category" binding:"max=255"` IconName string `bson:"icon_name" json:"icon_name" binding:"required,max=255"` Url string `bson:"url" json:"url" binding:"required,max=1000"` Action string `bson:"action" json:"action" binding:"required,oneof=open copy"` // Single to mark links unavailable to multiple selected alarms Single bool `bson:"single,omitempty" json:"single,omitempty"` HideInMenu bool `bson:"hide_in_menu,omitempty" json:"hide_in_menu,omitempty"` }
type Rule ¶
type Rule struct { ID string `bson:"_id"` Name string `bson:"name"` Type string `bson:"type"` Enabled bool `bson:"enabled"` Links []Parameters `bson:"links"` SourceCode string `bson:"source_code"` Author string `bson:"author"` Created datetime.CpsTime `bson:"created,omitempty"` Updated datetime.CpsTime `bson:"updated,omitempty"` ExternalData map[string]ExternalDataParameters `bson:"external_data"` savedpattern.EntityPatternFields `bson:",inline"` savedpattern.AlarmPatternFields `bson:",inline"` }
Click to show internal directories.
Click to hide internal directories.