(clusterId string, start time.Time, end time.Time)
| 159 | } |
| 160 | |
| 161 | func (d *Driver) LogRecords(clusterId string, start time.Time, end time.Time) ([]*log_driver.LogItem, error) { |
| 162 | if start.After(end) { |
| 163 | return nil, fmt.Errorf("start time is greater than end time") |
| 164 | } |
| 165 | queries := url.Values{} |
| 166 | queries.Set("query", fmt.Sprintf("{cluster=\"%s\"} | json", clusterId)) |
| 167 | queries.Set("direction", "backward") |
| 168 | queries.Set("start", strconv.FormatInt(start.UnixNano(), 10)) |
| 169 | queries.Set("end", strconv.FormatInt(end.UnixNano(), 10)) |
| 170 | log.Debug("query is ", queries.Get("query")) |
| 171 | logs, err := d.recuseLogs(queries, end, 1) |
| 172 | if err != nil { |
| 173 | return nil, err |
| 174 | } |
| 175 | |
| 176 | return logs, nil |
| 177 | } |
| 178 | |
| 179 | func (d *Driver) Logs(clusterId string, conditions map[string]string, start time.Time, end time.Time, limit int64, offset int64) ([]*log_driver.LogItem, int64, error) { |
| 180 | if start.After(end) { |
nothing calls this directly
no test coverage detected