| 215 | } |
| 216 | |
| 217 | func (i *imlLocalModelCacheService) GetByTarget(ctx context.Context, typ CacheType, target string) (*LocalModelCache, error) { |
| 218 | item, err := i.store.First(ctx, map[string]interface{}{"target": target, "type": typ.Int()}) |
| 219 | if err != nil { |
| 220 | return nil, err |
| 221 | } |
| 222 | return &LocalModelCache{ |
| 223 | Model: item.Model, |
| 224 | Target: item.Target, |
| 225 | Type: CacheType(item.Type), |
| 226 | }, nil |
| 227 | } |
| 228 | |
| 229 | func (i *imlLocalModelCacheService) List(ctx context.Context, model string, typ CacheType) ([]*LocalModelCache, error) { |
| 230 | list, err := i.store.List(ctx, map[string]interface{}{"model": model, "type": typ.Int()}) |