-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathevent_access.go
More file actions
44 lines (38 loc) · 882 Bytes
/
event_access.go
File metadata and controls
44 lines (38 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package hc
import "time"
// EventFields returns a shallow-copied field snapshot for e.
// Nested map/slice values are shared by reference.
func EventFields(e *Event) map[string]any {
if e == nil {
return nil
}
return e.snapshot().fields
}
// EventMessage returns e's attached message, or an empty string if unset.
func EventMessage(e *Event) string {
if e == nil {
return ""
}
return e.getMessage()
}
// EventHasError reports whether e has an attached error.
func EventHasError(e *Event) bool {
if e == nil {
return false
}
return e.hasErrorValue()
}
// EventHasMessage reports whether e has an attached message.
func EventHasMessage(e *Event) bool {
if e == nil {
return false
}
return e.hasMessageValue()
}
// EventStartTime returns e's start time.
func EventStartTime(e *Event) time.Time {
if e == nil {
return time.Time{}
}
return e.startedAt()
}