diff options
| author | Paul Buetow <paul@buetow.org> | 2024-09-12 23:04:04 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-09-12 23:04:04 +0300 |
| commit | 279ee9e1026f74f923766286b767d4df3901b82f (patch) | |
| tree | d8e32ebd235149904ccfd1da35cbf47a7b90cd36 | |
| parent | 608f9a54cef4f081bfa245fec27e49bc237820eb (diff) | |
can set an entry shared
| -rw-r--r-- | internal/types/entry.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/internal/types/entry.go b/internal/types/entry.go index f17c06a..6e06aec 100644 --- a/internal/types/entry.go +++ b/internal/types/entry.go @@ -8,6 +8,7 @@ import ( "os" "sort" "strings" + "time" ) type EntryID = string @@ -94,6 +95,14 @@ func (e Entry) IsShared(platform PlatformName) bool { return shared.Is } +func (e Entry) SetShared(platform PlatformName) Entry { + e.Shared[platform] = Shared{ + Is: true, + Timestamp: time.Now().Format("20060102150405"), + } + return e +} + /** * This updates the entry with the other entry. The Shared slice will also be * updated. If entry is missing, it will be added. If entry is there, the shared |
