Move timeutils functions to the only places where they are used.

- Move time json marshaling to the jsonlog package: this is a docker
  internal hack that we should not promote as a library.
- Move Timestamp encoding/decoding functions to the API types: This is
  only used there. It could be a standalone library but I don't this
it's worth having a separated repo for this. It could introduce more
complexity than it solves.

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera
2015-12-15 14:49:41 -05:00
parent 2180dd6cf0
commit 27220ecc6b
15 changed files with 44 additions and 50 deletions

View File

@@ -11,7 +11,7 @@ import (
"time"
"github.com/docker/docker/pkg/integration/checker"
"github.com/docker/docker/pkg/timeutils"
"github.com/docker/docker/pkg/jsonlog"
"github.com/go-check/check"
)
@@ -75,7 +75,7 @@ func (s *DockerSuite) TestLogsTimestamps(c *check.C) {
for _, l := range lines {
if l != "" {
_, err := time.Parse(timeutils.RFC3339NanoFixed+" ", ts.FindString(l))
_, err := time.Parse(jsonlog.RFC3339NanoFixed+" ", ts.FindString(l))
c.Assert(err, checker.IsNil, check.Commentf("Failed to parse timestamp from %v", l))
// ensure we have padded 0's
c.Assert(l[29], checker.Equals, uint8('Z'))