| 66 | } |
| 67 | |
| 68 | func (s *EntityService) Uninstall(kind, name string) (OperationResult, error) { |
| 69 | store, err := entityStore(kind) |
| 70 | if err != nil { |
| 71 | return OperationResult{}, err |
| 72 | } |
| 73 | removed, err := store.Delete(name) |
| 74 | if err != nil { |
| 75 | return OperationResult{}, wrapError("ENTITY_DELETE_FAILED", err) |
| 76 | } |
| 77 | if !removed { |
| 78 | return OperationResult{}, NewError("ENTITY_NOT_FOUND", "entity not found", map[string]string{"kind": kind, "name": name}) |
| 79 | } |
| 80 | return OperationResult{OK: true, Message: "entity removed", Path: store.Path()}, nil |
| 81 | } |
| 82 | |
| 83 | func (s *EntityService) Install(kind string, input EntityDTO) (EntityDTO, error) { |
| 84 | return s.Save(kind, input) |