Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNotificationRepo ¶
Types ¶
type Notification ¶
type Notification struct { Id uuid.UUID `gorm:"primaryKey;type:uuid"` NodeId string `gorm:"type:string;size:23;expression:lower(node_id);" json:"nodeId"` NodeType string `json:"nodeType"` Severity SeverityType `gorm:"type:string;expression:lower(severity)" json:"severity"` Type NotificationType `gorm:"type:string;expression:lower(notification_type)" json:"notificationType"` ServiceName string `json:"serviceName"` Status uint32 `json:"status"` Time uint32 `json:"time"` Description string `json:"description"` Details datatypes.JSON `json:"details"` CreatedAt time.Time UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
type NotificationRepo ¶
type NotificationRepo interface { Add(n *Notification) error Get(id uuid.UUID) (*Notification, error) List(nodeId, serviceName, nType string, count uint32, sort bool) ([]Notification, error) Delete(id uuid.UUID) error Purge(nodeId, serviceName, nType string) ([]Notification, error) }
type NotificationType ¶
type NotificationType string
const ( Alert NotificationType = "alert" Event NotificationType = "event" )
func GetNotificationType ¶
func GetNotificationType(s string) (*NotificationType, error)
func (NotificationType) String ¶
func (n NotificationType) String() string
type SeverityType ¶
type SeverityType string
const ( Fatal SeverityType = "fatal" Critical SeverityType = "critical" High SeverityType = "high" Medium SeverityType = "medium" Low SeverityType = "low" Clean SeverityType = "clean" Log SeverityType = "log" Warning SeverityType = "warning" Debug SeverityType = "debug" Trace SeverityType = "trace" )
func GetSeverityType ¶
func GetSeverityType(s string) (*SeverityType, error)
func (SeverityType) String ¶
func (n SeverityType) String() string
Click to show internal directories.
Click to hide internal directories.