Implement a simpler unversioned.Time serialization

Time is the number of seconds since the unix epoch and is consistent
with our JSON fields.
This commit is contained in:
Clayton Coleman
2016-04-04 23:02:37 -04:00
parent 529bd2bf98
commit 1f012a2bb3
2 changed files with 12 additions and 19 deletions

View File

@@ -28,8 +28,9 @@ import (
// of the factory methods that the time package offers.
//
// +protobuf.options.marshal=false
// +protobuf.as=Timestamp
type Time struct {
time.Time `protobuf:"Timestamp,1,req,name=time"`
time.Time `protobuf:"-"`
}
// NewTime returns a wrapped instance of the provided time