Log represents an audit log entry. The keys in JSON struct tags are in camel case because this struct is directly returned in the GraphQL endpoint. Making the keys in camel case saves us from writing boilerplate resolver code.
| 12 | // because this struct is directly returned in the GraphQL endpoint. |
| 13 | // Making the keys in camel case saves us from writing boilerplate resolver code. |
| 14 | type Log struct { |
| 15 | ID string `json:"id"` |
| 16 | CreatedAt time.Time `json:"createdAt"` |
| 17 | ActivityType string `json:"activityType"` |
| 18 | UserID string `json:"userID,omitempty"` |
| 19 | IPAddress string `json:"ipAddress,omitempty"` |
| 20 | UserAgent string `json:"userAgent,omitempty"` |
| 21 | ClientID string `json:"clientID,omitempty"` |
| 22 | Data map[string]any `json:"data,omitempty"` |
| 23 | } |
| 24 | |
| 25 | func NewLog(e *event.Event) (*Log, error) { |
| 26 | var userID string |
nothing calls this directly
no outgoing calls
no test coverage detected