From 0ac39a7ab5db077fcf0df827e32bf6e625e980da Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Sat, 19 Nov 2022 11:33:12 +0100 Subject: WIP --- entity/dag/operation.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'entity/dag/operation.go') diff --git a/entity/dag/operation.go b/entity/dag/operation.go index 1a778878..1b891aeb 100644 --- a/entity/dag/operation.go +++ b/entity/dag/operation.go @@ -63,6 +63,13 @@ type Operation interface { setExtraMetadataImmutable(key string, value string) } +type OperationWithApply[SnapT Snapshot] interface { + Operation + + // Apply the operation to a Snapshot to create the final state + Apply(snapshot SnapT) +} + // OperationWithFiles is an optional extension for an Operation that has files dependency, stored in git. type OperationWithFiles interface { // GetFiles return the files needed by this operation -- cgit From d65e8837aa7bb1a6abb6892b9f2664e1b7edb02e Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Thu, 22 Dec 2022 00:48:00 +0100 Subject: cache: generic withSnapshot, some cleanup --- entity/dag/operation.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'entity/dag/operation.go') diff --git a/entity/dag/operation.go b/entity/dag/operation.go index 1b891aeb..f50d91b6 100644 --- a/entity/dag/operation.go +++ b/entity/dag/operation.go @@ -90,6 +90,8 @@ type OperationDoesntChangeSnapshot interface { type Snapshot interface { // AllOperations returns all the operations that have been applied to that snapshot, in order AllOperations() []Operation + // AppendOperation add an operation in the list + AppendOperation(op Operation) } // OpBase implement the common feature that every Operation should support. -- cgit