diff options
author | Michael Muré <batolettre@gmail.com> | 2023-08-14 16:58:06 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2023-08-14 16:58:06 +0200 |
commit | 297e1931a7b5913275e8e9b0a46494d95e7e5e7c (patch) | |
tree | 5c5ef10f66bff4f9e6e3bbe87c70c02940bdbce3 /entity/dag/operation.go | |
parent | f0167a1d6068d22af5ffff260e2848f7c14a71b3 (diff) | |
download | git-bug-bootstrap-rework-2.tar.gz git-bug-bootstrap-rework-2.zip |
WIP 2bootstrap-rework-2
Diffstat (limited to 'entity/dag/operation.go')
-rw-r--r-- | entity/dag/operation.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/entity/dag/operation.go b/entity/dag/operation.go index 40bd7da8d..216788c48 100644 --- a/entity/dag/operation.go +++ b/entity/dag/operation.go @@ -8,7 +8,6 @@ import ( "github.com/pkg/errors" - "github.com/MichaelMure/git-bug/entities/identity" "github.com/MichaelMure/git-bug/entity" ) @@ -19,7 +18,7 @@ type Operation interface { // setId allow to set the Id, used when unmarshalling only setId(id entity.Id) // setAuthor allow to set the author, used when unmarshalling only - setAuthor(author identity.Interface) + setAuthor(author entity.Identity) // setExtraMetadataImmutable add a metadata not carried by the operation itself on the operation setExtraMetadataImmutable(key string, value string) } @@ -36,7 +35,7 @@ type OpBase struct { // Not serialized. Store the op's id in memory. id entity.Id // Not serialized - author identity.Interface + author entity.Identity OperationType entity.OperationType `json:"type"` UnixTime int64 `json:"timestamp"` @@ -52,7 +51,7 @@ type OpBase struct { extraMetadata map[string]string } -func NewOpBase(opType entity.OperationType, author identity.Interface, unixTime int64) OpBase { +func NewOpBase(opType entity.OperationType, author entity.Identity, unixTime int64) OpBase { return OpBase{ OperationType: opType, author: author, @@ -144,7 +143,7 @@ func (base *OpBase) Validate(op entity.Operation, opType entity.OperationType) e func (base *OpBase) IsAuthored() {} // Author return author identity -func (base *OpBase) Author() identity.Interface { +func (base *OpBase) Author() entity.Identity { return base.author } @@ -204,7 +203,7 @@ func (base *OpBase) setId(id entity.Id) { } // setAuthor allow to set the author, used when unmarshalling only -func (base *OpBase) setAuthor(author identity.Interface) { +func (base *OpBase) setAuthor(author entity.Identity) { base.author = author } |