-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dcefe89
commit 6350234
Showing
2 changed files
with
12 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,43 @@ | ||
package couchbase | ||
|
||
import "time" | ||
|
||
type Event struct { | ||
CollectionName string | ||
EventTime time.Time | ||
Key []byte | ||
Value []byte | ||
IsDeleted bool | ||
IsExpired bool | ||
IsMutated bool | ||
} | ||
|
||
func NewDeleteEvent(key []byte, value []byte, collectionName string) Event { | ||
func NewDeleteEvent(key []byte, value []byte, collectionName string, eventTime time.Time) Event { | ||
return Event{ | ||
Key: key, | ||
Value: value, | ||
IsDeleted: true, | ||
CollectionName: collectionName, | ||
EventTime: eventTime, | ||
} | ||
} | ||
|
||
func NewExpireEvent(key []byte, value []byte, collectionName string) Event { | ||
func NewExpireEvent(key []byte, value []byte, collectionName string, eventTime time.Time) Event { | ||
return Event{ | ||
Key: key, | ||
Value: value, | ||
IsExpired: true, | ||
CollectionName: collectionName, | ||
EventTime: eventTime, | ||
} | ||
} | ||
|
||
func NewMutateEvent(key []byte, value []byte, collectionName string) Event { | ||
func NewMutateEvent(key []byte, value []byte, collectionName string, eventTime time.Time) Event { | ||
return Event{ | ||
Key: key, | ||
Value: value, | ||
IsMutated: true, | ||
CollectionName: collectionName, | ||
EventTime: eventTime, | ||
} | ||
} |