Skip to content

Commit

Permalink
add new dir
Browse files Browse the repository at this point in the history
  • Loading branch information
stremovsky committed Dec 28, 2024
1 parent 53b1fc5 commit 4c62cad
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/audit/audit.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package audit

import "time"

type AuditEvent struct {
When int32 `json:"when"`
Who string `json:"who"`
Mode string `json:"mode"`
Identity string `json:"identity"`
Record string `json:"record"`
App string `json:"app"`
Title string `json:"title"`
Status string `json:"status"`
Msg string `json:"msg"`
Debug string `json:"debug"`
Before string `json:"before"`
After string `json:"after"`
Atoken string `json:"atoken"`
}

func CreateAuditEvent(title string, record string, mode string, identity string) *AuditEvent {
//fmt.Printf("/%s : %s\n", title, record)
return &AuditEvent{Title: title, Mode: mode, Who: identity, Record: record, Status: "ok", When: int32(time.Now().Unix())}
}

func CreateAuditAppEvent(title string, record string, app string, mode string, identity string) *AuditEvent {
//fmt.Printf("/%s : %s : %s\n", title, app, record)
return &AuditEvent{Title: title, Mode: mode, Who: identity, Record: record, Status: "ok", When: int32(time.Now().Unix())}
}
3 changes: 3 additions & 0 deletions src/audit/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/securitybunker/databunker/src/utils

go 1.21

0 comments on commit 4c62cad

Please sign in to comment.