logger

package
v0.0.0-...-9b5cd94 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionCreate   = "create"
	ActionUpdate   = "update"
	ActionDelete   = "delete"
	ActionApproval = "approval"
	ActionExport   = "export"
	ActionImport   = "import"
)
View Source
const (
	ValueTypeUser               = "user"
	ValueTypeRole               = "role"
	ValueTypePlayList           = "playlist"
	ValueTypeEventFilter        = "eventfilter"
	ValueTypeScenario           = "scenario"
	ValueTypeMetaalarmRule      = "metaalarmrule"
	ValueTypeDynamicInfo        = "dynamicinfo"
	ValueTypeEntity             = "entity"
	ValueTypeEntityService      = "entityservice"
	ValueTypeEntityCategory     = "entitycategory"
	ValueTypePbehaviorType      = "pbehaviortype"
	ValueTypePbehaviorReason    = "pbehaviorreason"
	ValueTypePbehaviorException = "pbehaviorexception"
	ValueTypePbehavior          = "pbehavior"
	ValueTypeJobConfig          = "jobconfig"
	ValueTypeJob                = "job"
	ValueTypeInstruction        = "instruction"
	ValueTypeStateSetting       = "statesetting"
	ValueTypeBroadcastMessage   = "broadcastmessage"
	ValueAssociativeTable       = "associativetable"
	ValueTypeIdleRule           = "idlerule"

	ValueTypeView           = "view"
	ValueTypeViewTab        = "viewtab"
	ValueTypeWidget         = "widget"
	ValueTypeWidgetFilter   = "widgetfilter"
	ValueTypeWidgetTemplate = "widgettemplate"
	ValueTypeViewGroup      = "viewgroup"

	ValueTypeResolveRule  = "resolverule"
	ValueTypeFlappingRule = "flappingrule"

	ValueTypeUserPreferences = "userpreferences"

	ValueTypeFilter = "filter"

	ValueTypePattern = "pattern"

	ValueTypeMap = "map"

	ValueTypeShareToken = "sharetoken"

	ValueTypeSnmpRule = "snmprule"
	ValueTypeSnmpMib  = "snmpmib"

	ValueTypeDeclareTicketRule = "declareticketrule"

	ValueTypeLinkRule = "linkrule"

	ValueTypeAlarmTag = "alarmtag"

	ValueTypeColorTheme = "colortheme"

	ValueTypeIcon = "icon"
)
View Source
const ApprovalDecisionApprove = "approve"
View Source
const ApprovalDecisionDismiss = "dismiss"

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionLogger

type ActionLogger interface {
	Action(ctx context.Context, userID string, logEntry LogEntry) error
	Err(err error, msg string)
}

func NewActionLogger

func NewActionLogger(dbClient mongo.DbClient, zLog zerolog.Logger) ActionLogger

type LogEntry

type LogEntry struct {
	Action         string    `bson:"action"`
	ValueType      string    `bson:"value_type"`
	ValueID        string    `bson:"value_id"`
	Author         string    `bson:"author"`
	Time           time.Time `bson:"time"`
	ValidationTime time.Time `bson:"validation_time,omitempty"`
	ApproverUser   string    `bson:"approver_user,omitempty"`
	ApproverRole   string    `bson:"approver_role,omitempty"`
	Decision       string    `bson:"decision,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL