From eeef14df1a991f17c73846d9152d3c15b79e2409 Mon Sep 17 00:00:00 2001 From: Cian Gallagher Date: Thu, 6 Jan 2022 23:09:38 +0000 Subject: [PATCH] EVENT: Add epoch timestamp to event struct --- event/event.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/event/event.go b/event/event.go index 0d9e8a7..bdc927b 100644 --- a/event/event.go +++ b/event/event.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "os" + "time" "github.com/cian911/switchboard/utils" ) @@ -22,6 +23,8 @@ type Event struct { Operation string // IsDir is the new create vent a directory IsDir bool + // Timestamp in unix time epoch + Timestamp int64 } // New creates and returns a new event struct @@ -31,6 +34,7 @@ func New(file, path, dest, ext string) *Event { Path: path, Destination: dest, Ext: ext, + Timestamp: time.Now().Unix(), } }