| 184 | } |
| 185 | |
| 186 | func (i *imlLogService) Logs(ctx context.Context, driver string, cluster string, conditions map[string]string, start time.Time, end time.Time, limit int64, offset int64) ([]*Item, int64, error) { |
| 187 | d, has := log_driver.GetDriver(driver) |
| 188 | if !has { |
| 189 | return nil, 0, errors.New("driver not found") |
| 190 | } |
| 191 | list, count, err := d.Logs(cluster, conditions, start, end, limit, offset) |
| 192 | if err != nil { |
| 193 | return nil, 0, err |
| 194 | } |
| 195 | result := make([]*Item, 0, len(list)) |
| 196 | for _, l := range list { |
| 197 | result = append(result, &Item{ |
| 198 | ID: l.ID, |
| 199 | Service: l.Service, |
| 200 | Method: l.Method, |
| 201 | Url: l.Url, |
| 202 | RemoteIP: l.RemoteIP, |
| 203 | Consumer: l.Consumer, |
| 204 | Authorization: l.Authorization, |
| 205 | RecordTime: l.RecordTime, |
| 206 | }) |
| 207 | } |
| 208 | return result, count, nil |
| 209 | } |
| 210 | |
| 211 | func (i *imlLogService) LogRecords(ctx context.Context, driver string, keyword string, start time.Time, end time.Time) ([]*Item, int64, error) { |
| 212 | panic(errors.New("not implemented")) |