aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operation.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2018-09-10 19:03:17 +0200
committerMichael Muré <batolettre@gmail.com>2018-09-10 19:09:20 +0200
commit2dcd06d1e722a81d00fd7f9ef0a62c72b20fac6b (patch)
tree57b025d2500304bdd658affe70de137dbff6b78d /bug/operation.go
parent9bb980e9de1ec3764069ae70baf0c2458e7c35a4 (diff)
downloadgit-bug-2dcd06d1e722a81d00fd7f9ef0a62c72b20fac6b.tar.gz
bug: ensure that OpBase field are public and properly serialized
fix #37
Diffstat (limited to 'bug/operation.go')
-rw-r--r--bug/operation.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/bug/operation.go b/bug/operation.go
index 7d71e352..00313dc0 100644
--- a/bug/operation.go
+++ b/bug/operation.go
@@ -23,8 +23,8 @@ type Operation interface {
OpType() OperationType
// Time return the time when the operation was added
Time() time.Time
- // unixTime return the unix timestamp when the operation was added
- UnixTime() int64
+ // GetUnixTime return the unix timestamp when the operation was added
+ 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
@@ -38,7 +38,7 @@ type Operation interface {
type OpBase struct {
OperationType OperationType
Author Person
- unixTime int64
+ UnixTime int64
}
// NewOpBase is the constructor for an OpBase
@@ -46,7 +46,7 @@ func NewOpBase(opType OperationType, author Person) OpBase {
return OpBase{
OperationType: opType,
Author: author,
- unixTime: time.Now().Unix(),
+ UnixTime: time.Now().Unix(),
}
}
@@ -57,12 +57,12 @@ func (op OpBase) OpType() OperationType {
// Time return the time when the operation was added
func (op OpBase) Time() time.Time {
- return time.Unix(op.unixTime, 0)
+ return time.Unix(op.UnixTime, 0)
}
-// unixTime return the unix timestamp when the operation was added
-func (op OpBase) UnixTime() int64 {
- return op.unixTime
+// GetUnixTime return the unix timestamp when the operation was added
+func (op OpBase) GetUnixTime() int64 {
+ return op.UnixTime
}
// Files return the files needed by this operation