diff options
author | Michael Muré <batolettre@gmail.com> | 2022-08-01 17:16:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 17:16:45 +0200 |
commit | cd52872475f1b39f3fb6546606c1e78afb6c08e3 (patch) | |
tree | 9f04b1e1ee362e210e74aaa324d950058ed14bf2 /bug/snapshot.go | |
parent | 2ade8fb1d570ddcb4aedc9386af46d208b129daa (diff) | |
parent | 56966fec5562c3a0e23340d0fbe754626c3beb64 (diff) | |
download | git-bug-cd52872475f1b39f3fb6546606c1e78afb6c08e3.tar.gz |
Merge pull request #835 from MichaelMure/op-base
entity/dag: proper base operation for simplified implementation
Diffstat (limited to 'bug/snapshot.go')
-rw-r--r-- | bug/snapshot.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/bug/snapshot.go b/bug/snapshot.go index d73e4bb6..2efc067e 100644 --- a/bug/snapshot.go +++ b/bug/snapshot.go @@ -5,9 +5,12 @@ import ( "time" "github.com/MichaelMure/git-bug/entity" + "github.com/MichaelMure/git-bug/entity/dag" "github.com/MichaelMure/git-bug/identity" ) +var _ dag.Snapshot = &Snapshot{} + // Snapshot is a compiled form of the Bug data structure used for storage and merge type Snapshot struct { id entity.Id @@ -23,7 +26,7 @@ type Snapshot struct { Timeline []TimelineItem - Operations []Operation + Operations []dag.Operation } // Id returns the Bug identifier @@ -35,6 +38,10 @@ func (snap *Snapshot) Id() entity.Id { return snap.id } +func (snap *Snapshot) AllOperations() []dag.Operation { + return snap.Operations +} + // EditTime returns the last time a bug was modified func (snap *Snapshot) EditTime() time.Time { if len(snap.Operations) == 0 { @@ -133,5 +140,5 @@ func (snap *Snapshot) HasAnyActor(ids ...entity.Id) bool { return false } -// Sign post method for gqlgen +// IsAuthored is a sign post method for gqlgen func (snap *Snapshot) IsAuthored() {} |