MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / Logs

Method Logs

service/log/iml.go:186–209  ·  view source on GitHub ↗
(ctx context.Context, driver string, cluster string, conditions map[string]string, start time.Time, end time.Time, limit int64, offset int64)

Source from the content-addressed store, hash-verified

184}
185
186func (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
211func (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"))

Callers

nothing calls this directly

Calls 2

GetDriverMethod · 0.80
LogsMethod · 0.65

Tested by

no test coverage detected