Skip to content

Commit

Permalink
Merge pull request #5 from BenB196/staging
Browse files Browse the repository at this point in the history
Merge in stage and update to v0.0.4
  • Loading branch information
BenB196 authored Sep 14, 2019
2 parents b2d3de1 + bf7c53e commit 339966e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ Returns:
FileEvent
EventId string
EventType string
EventTimestamp time.Time (potentially empty)
InsertionTimestamp time.Time (potentially empty)
EventTimestamp *time.Time (potentially empty)
InsertionTimestamp *time.Time (potentially empty)
FilePath string (potentially empty)
FileName string
FileType string (potentially empty)
Expand All @@ -110,8 +110,8 @@ FileEvent
FileOwner []string (potentially empty)
Md5Checksum string (potentially empty)
Sha256Checksum string (potentially empty)
CreatedTimestamp time.Time (potentially empty)
ModifyTimestamp time.Time (potentially empty)
CreatedTimestamp *time.Time (potentially empty)
ModifyTimestamp *time.Time (potentially empty)
DeviceUsername string (potentially empty)
DeviceUid string (potentially empty)
UserUid string (potentially empty)
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.3
0.0.4
32 changes: 24 additions & 8 deletions ffs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
type FileEvent struct {
EventId string `json:"eventId"`
EventType string `json:"eventType"`
EventTimestamp time.Time `json:"eventTimestamp,omitempty"`
InsertionTimestamp time.Time `json:"insertionTimestamp,omitempty"`
EventTimestamp *time.Time `json:"eventTimestamp,omitempty"`
InsertionTimestamp *time.Time `json:"insertionTimestamp,omitempty"`
FilePath string `json:"filePath,omitempty"`
FileName string `json:"fileName"`
FileType string `json:"fileType,omitempty"`
Expand All @@ -29,8 +29,8 @@ type FileEvent struct {
FileOwner []string `json:"fileOwner,omitempty"` //Array of owners
Md5Checksum string `json:"md5Checksum,omitempty"`
Sha256Checksum string `json:"sha256Checksum,omitempty"`
CreatedTimestamp time.Time `json:"createdTimestamp,omitempty"`
ModifyTimestamp time.Time `json:"modifyTimestamp,omitempty"`
CreatedTimestamp *time.Time `json:"createdTimestamp,omitempty"`
ModifyTimestamp *time.Time `json:"modifyTimestamp,omitempty"`
DeviceUsername string `json:"deviceUsername,omitempty"`
DeviceUid string `json:"deviceUid,omitempty"`
UserUid string `json:"userUid,omitempty"`
Expand Down Expand Up @@ -327,8 +327,8 @@ func csvLineToFileEvent(csvLine []string) FileEvent {
fileEvent = FileEvent{
EventId: eventId,
EventType: eventType,
EventTimestamp: eventTimeStamp,
InsertionTimestamp: insertionTimestamp,
EventTimestamp: &eventTimeStamp,
InsertionTimestamp: &insertionTimestamp,
FilePath: filePath,
FileName: fileName,
FileType: fileType,
Expand All @@ -337,8 +337,8 @@ func csvLineToFileEvent(csvLine []string) FileEvent {
FileOwner: fileOwner,
Md5Checksum: md5Checksum,
Sha256Checksum: sha256Checksum,
CreatedTimestamp: createdTimestamp,
ModifyTimestamp: modifyTimestamp,
CreatedTimestamp: &createdTimestamp,
ModifyTimestamp: &modifyTimestamp,
DeviceUsername: deviceUserName,
DeviceUid: deviceUid,
UserUid: userUid,
Expand Down Expand Up @@ -366,6 +366,22 @@ func csvLineToFileEvent(csvLine []string) FileEvent {
RemovableMediaBusType: removableMediaBusType,
SyncDestination: syncDestination,
}

if eventTimestampString == "" {
fileEvent.EventTimestamp = nil
}

if insertionTimestampString == "" {
fileEvent.InsertionTimestamp = nil
}

if createdTimestampString == "" {
fileEvent.CreatedTimestamp = nil
}

if modifyTimestampString == "" {
fileEvent.ModifyTimestamp = nil
}

return fileEvent
}
Expand Down

0 comments on commit 339966e

Please sign in to comment.