MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / Delete

Method Delete

service/universally/delete.go:34–50  ·  view source on GitHub ↗
(ctx context.Context, uuid string)

Source from the content-addressed store, hash-verified

32}
33
34func (p *imlServiceDelete[E]) Delete(ctx context.Context, uuid string) error {
35 return p.store.Transaction(ctx, func(ctx context.Context) error {
36 o, err := p.store.First(ctx, map[string]interface{}{"uuid": uuid})
37 if err != nil && !errors.Is(err, gorm.ErrRecordNotFound) {
38 return err
39 }
40 if o == nil {
41 return fmt.Errorf("partition %s not exists", uuid)
42 }
43
44 _, err = p.store.DeleteWhere(ctx, map[string]interface{}{"uuid": uuid})
45 if err != nil {
46 return err
47 }
48 return p.store.SetLabels(ctx, idValue(o))
49 })
50}
51
52type imlServiceSoftDelete[E any] struct {
53 store store.ISearchStore[E]

Callers

nothing calls this directly

Calls 1

idValueFunction · 0.85

Tested by

no test coverage detected