aboutsummaryrefslogtreecommitdiff
path: root/eventlogging
diff options
context:
space:
mode:
Diffstat (limited to 'eventlogging')
-rw-r--r--eventlogging/eventlogger.go18
-rw-r--r--eventlogging/events.txt8
-rw-r--r--eventlogging/types.go52
3 files changed, 78 insertions, 0 deletions
diff --git a/eventlogging/eventlogger.go b/eventlogging/eventlogger.go
new file mode 100644
index 0000000..e5a1b2b
--- /dev/null
+++ b/eventlogging/eventlogger.go
@@ -0,0 +1,18 @@
1package eventlogging
2
3import "fagott.pw/nsa"
4
5type EventLoggerData struct {
6 User string `json:"user"`
7 UserAgent string `json:"userAgent"`
8}
9
10type EventLogger struct {
11 base *nsa.Logger
12}
13
14func NewEventLogger(ip string) *EventLogger {
15 return &EventLogger{
16 base: nsa.NewLogger(ip),
17 }
18}
diff --git a/eventlogging/events.txt b/eventlogging/events.txt
new file mode 100644
index 0000000..0e170dc
--- /dev/null
+++ b/eventlogging/events.txt
@@ -0,0 +1,8 @@
1VIEW_GRIL
2VIEW_LIST
3CREATE_LIST
4ADD_GRIL_TO_LIST
5DELETE_GRIL_FROM_LIST
6DELETE_LIST
7EDIT_LIST
8CHANGE_GRIL_ORDER
diff --git a/eventlogging/types.go b/eventlogging/types.go
new file mode 100644
index 0000000..96d0ce0
--- /dev/null
+++ b/eventlogging/types.go
@@ -0,0 +1,52 @@
1package eventlogging
2
3type ViewGrilData struct {
4 EventLoggerData
5 GrilID int
6}
7
8type ViewListData struct {
9 EventLoggerData
10 ListID int
11}
12
13type CreateListData struct {
14 EventLoggerData
15 ListID int
16 Name string
17 Description string
18}
19
20type AddGrilToListData struct {
21 EventLoggerData
22 GrilID int
23 ListID int
24}
25
26type DeleteGrilFromListData struct {
27 EventLoggerData
28 ListID int
29 GrilID int
30}
31
32type DeleteListData struct {
33 EventLoggerData
34 ListID int
35}
36
37type EditListData struct {
38 EventLoggerData
39 ListID int
40 OldName string
41 OldDescription string
42 NewName string
43 NewDescription string
44}
45
46type ChangeGrilOrderData struct {
47 EventLoggerData
48 ListID int
49 GrilID int
50 OldOrder int
51 NewOrder int
52}