Skip to content

Commit

Permalink
EVENT: Add epoch timestamp to event struct
Browse files Browse the repository at this point in the history
  • Loading branch information
Cian911 committed Jan 6, 2022
1 parent 32809f8 commit eeef14d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions event/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"log"
"os"
"time"

"github.com/cian911/switchboard/utils"
)
Expand All @@ -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
Expand All @@ -31,6 +34,7 @@ func New(file, path, dest, ext string) *Event {
Path: path,
Destination: dest,
Ext: ext,
Timestamp: time.Now().Unix(),
}
}

Expand Down

0 comments on commit eeef14d

Please sign in to comment.