| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 package swarming | 5 package swarming |
| 6 | 6 |
| 7 import ( | 7 import ( |
| 8 "errors" | 8 "errors" |
| 9 "net/http" | 9 "net/http" |
| 10 "strings" | 10 "strings" |
| 11 "time" | 11 "time" |
| 12 | 12 |
| 13 » "github.com/luci/luci-go/client/internal/lhttp" | 13 » "github.com/luci/luci-go/common/lhttp" |
| 14 » "github.com/luci/luci-go/client/internal/retry" | 14 » "github.com/luci/luci-go/common/retry" |
| 15 ) | 15 ) |
| 16 | 16 |
| 17 // TaskID is a unique reference to a Swarming task. | 17 // TaskID is a unique reference to a Swarming task. |
| 18 type TaskID string | 18 type TaskID string |
| 19 | 19 |
| 20 // Swarming defines a Swarming client. | 20 // Swarming defines a Swarming client. |
| 21 type Swarming struct { | 21 type Swarming struct { |
| 22 host string | 22 host string |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 User string `json:"user"` | 90 User string `json:"user"` |
| 91 } | 91 } |
| 92 | 92 |
| 93 // Duration returns the total duration of a task. | 93 // Duration returns the total duration of a task. |
| 94 func (s *TaskResult) Duration() (out time.Duration) { | 94 func (s *TaskResult) Duration() (out time.Duration) { |
| 95 for _, d := range s.Durations { | 95 for _, d := range s.Durations { |
| 96 out += time.Duration(d) * time.Second | 96 out += time.Duration(d) * time.Second |
| 97 } | 97 } |
| 98 return | 98 return |
| 99 } | 99 } |
| OLD | NEW |