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>
Upstream-commit: 27220ecc6b1eedf650ca9cf94965cb0dc2054efd
Component: engine
This commit is contained in:
David Calavera
2015-12-15 14:49:41 -05:00
parent ff4354d4e6
commit 7f43cd332d
15 changed files with 44 additions and 50 deletions

View File

@ -9,10 +9,10 @@ import (
"github.com/docker/docker/api"
"github.com/docker/docker/api/server/httputils"
"github.com/docker/docker/api/types"
timetypes "github.com/docker/docker/api/types/time"
"github.com/docker/docker/pkg/ioutils"
"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/parsers/filters"
"github.com/docker/docker/pkg/timeutils"
"golang.org/x/net/context"
)
@ -46,11 +46,11 @@ func (s *systemRouter) getEvents(ctx context.Context, w http.ResponseWriter, r *
if err := httputils.ParseForm(r); err != nil {
return err
}
since, sinceNano, err := timeutils.ParseTimestamps(r.Form.Get("since"), -1)
since, sinceNano, err := timetypes.ParseTimestamps(r.Form.Get("since"), -1)
if err != nil {
return err
}
until, untilNano, err := timeutils.ParseTimestamps(r.Form.Get("until"), -1)
until, untilNano, err := timetypes.ParseTimestamps(r.Form.Get("until"), -1)
if err != nil {
return err
}