(ctx context.Context, serviceId string, update *Update)
| 31 | } |
| 32 | |
| 33 | func (i imlOverviewService) Update(ctx context.Context, serviceId string, update *Update) error { |
| 34 | if update == nil { |
| 35 | return nil |
| 36 | } |
| 37 | |
| 38 | info, err := i.store.First(ctx, map[string]interface{}{ |
| 39 | "service": serviceId, |
| 40 | }) |
| 41 | if err != nil { |
| 42 | if !errors.Is(err, gorm.ErrRecordNotFound) { |
| 43 | return err |
| 44 | } |
| 45 | info = &service.Overview{ |
| 46 | Service: serviceId, |
| 47 | } |
| 48 | genUpdateFields(info, update) |
| 49 | return i.store.Insert(ctx, info) |
| 50 | } |
| 51 | genUpdateFields(info, update) |
| 52 | _, err = i.store.Update(ctx, info) |
| 53 | if err != nil { |
| 54 | return err |
| 55 | } |
| 56 | return nil |
| 57 | } |
| 58 | |
| 59 | func (i imlOverviewService) List(ctx context.Context, serviceIds ...string) ([]*Overview, error) { |
| 60 | w := make(map[string]interface{}) |
nothing calls this directly
no test coverage detected