| 54 | } |
| 55 | |
| 56 | func (i *imlStrategyService) AllByDriver(ctx context.Context, driver string, scope int, target string) ([]*Strategy, error) { |
| 57 | w := make(map[string]interface{}) |
| 58 | w["scope"] = scope |
| 59 | if target != "" { |
| 60 | w["target"] = target |
| 61 | } |
| 62 | w["driver"] = driver |
| 63 | list, err := i.store.List(ctx, w) |
| 64 | if err != nil { |
| 65 | return nil, err |
| 66 | } |
| 67 | return utils.SliceToSlice(list, FromEntity), nil |
| 68 | } |
| 69 | |
| 70 | func (i *imlStrategyService) CommitStrategy(ctx context.Context, scope string, target string, strategyId string, data *Strategy) error { |
| 71 | key := scope |