aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operation.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-12 16:57:04 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-12 16:57:46 +0200
commit60fcfcdcb0e89741528cfc99a94a48f204d48e6b (patch)
tree48189b7f85e10b1bdf6a4b897ac0b966c4cec23c /bug/operation.go
parent3605887345792d2f981f971c6c4a2cb7f86a343e (diff)
downloadgit-bug-60fcfcdcb0e89741528cfc99a94a48f204d48e6b.tar.gz
bug: change the OperationPack serialization format for Json
See https://github.com/MichaelMure/git-bug/issues/5 for the details of this choice
Diffstat (limited to 'bug/operation.go')
-rw-r--r--bug/operation.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/bug/operation.go b/bug/operation.go
index f6c63144..5d42a175 100644
--- a/bug/operation.go
+++ b/bug/operation.go
@@ -27,8 +27,8 @@ type Operation interface {
GetUnixTime() int64
// Apply the operation to a Snapshot to create the final state
Apply(snapshot Snapshot) Snapshot
- // Files return the files needed by this operation
- Files() []git.Hash
+ // GetFiles return the files needed by this operation
+ GetFiles() []git.Hash
// TODO: data validation (ex: a title is a single line)
// Validate() bool
@@ -36,9 +36,9 @@ type Operation interface {
// OpBase implement the common code for all operations
type OpBase struct {
- OperationType OperationType
- Author Person
- UnixTime int64
+ OperationType OperationType `json:"type"`
+ Author Person `json:"author"`
+ UnixTime int64 `json:"timestamp"`
}
// NewOpBase is the constructor for an OpBase
@@ -65,7 +65,7 @@ func (op OpBase) GetUnixTime() int64 {
return op.UnixTime
}
-// Files return the files needed by this operation
-func (op OpBase) Files() []git.Hash {
+// GetFiles return the files needed by this operation
+func (op OpBase) GetFiles() []git.Hash {
return nil
}