Merge pull request #18685 from calavera/remove_timeutils

Move timeutils functions to the only places where they are used.
Upstream-commit: 52fd30079a8f9a56402d4c4f1666c96bd9af98da
Component: engine
This commit is contained in:
David Calavera
2015-12-15 15:11:18 -08:00
15 changed files with 44 additions and 50 deletions

View File

@ -6,8 +6,8 @@ import (
"time"
"github.com/docker/docker/api/types"
timetypes "github.com/docker/docker/api/types/time"
"github.com/docker/docker/pkg/parsers/filters"
"github.com/docker/docker/pkg/timeutils"
)
// Events returns a stream of events in the daemon in a ReadCloser.
@ -17,14 +17,14 @@ func (cli *Client) Events(options types.EventsOptions) (io.ReadCloser, error) {
ref := time.Now()
if options.Since != "" {
ts, err := timeutils.GetTimestamp(options.Since, ref)
ts, err := timetypes.GetTimestamp(options.Since, ref)
if err != nil {
return nil, err
}
query.Set("since", ts)
}
if options.Until != "" {
ts, err := timeutils.GetTimestamp(options.Until, ref)
ts, err := timetypes.GetTimestamp(options.Until, ref)
if err != nil {
return nil, err
}

View File

@ -6,7 +6,7 @@ import (
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/pkg/timeutils"
timetypes "github.com/docker/docker/api/types/time"
)
// ContainerLogs returns the logs generated by a container in an io.ReadCloser.
@ -22,7 +22,7 @@ func (cli *Client) ContainerLogs(options types.ContainerLogsOptions) (io.ReadClo
}
if options.Since != "" {
ts, err := timeutils.GetTimestamp(options.Since, time.Now())
ts, err := timetypes.GetTimestamp(options.Since, time.Now())
if err != nil {
return nil, err
}