github.com/simpleiot/simpleiot@v0.18.3/data/event.go (about)

     1  package data
     2  
     3  import "time"
     4  
     5  // EventType describes an event. Custom applications that build on top of Simple IoT
     6  // should custom event types at high number above 10,000 to ensure there is not a collision
     7  // between type IDs. Note, these enums should never change.
     8  type EventType int
     9  
    10  // define valid events
    11  const (
    12  	EventTypeStartSystem EventType = 10
    13  	EventTypeStartApp
    14  	EventTypeSystemUpdate
    15  	EventTypeAppUpdate
    16  )
    17  
    18  // EventLevel is used to describe the "severity" of the event and can be used to
    19  // quickly filter the type of events
    20  type EventLevel int
    21  
    22  // define valid events
    23  const (
    24  	EventLevelFault EventLevel = 3
    25  	EventLevelInfo
    26  	EventLevelDebug
    27  )
    28  
    29  // Event describes something that happened and might be displayed to user in a
    30  // a sequential log format.
    31  type Event struct {
    32  	Time    time.Time
    33  	Type    EventType
    34  	Level   EventLevel
    35  	Message string
    36  }