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

Method Delete

service/cluster/cluster.go:94–116  ·  view source on GitHub ↗
(ctx context.Context, id string)

Source from the content-addressed store, hash-verified

92}
93
94func (s *imlClusterService) Delete(ctx context.Context, id string) error {
95 return s.store.Transaction(ctx, func(ctx context.Context) error {
96 _, err := s.store.DeleteWhere(ctx, map[string]interface{}{
97 "uuid": id,
98 })
99 if err != nil {
100 return err
101 }
102 _, err = s.nodeStore.DeleteWhere(ctx, map[string]interface{}{
103 "cluster": id,
104 })
105 if err != nil {
106 return err
107 }
108 _, err = s.nodeAddressStore.DeleteWhere(ctx, map[string]interface{}{
109 "cluster": id,
110 })
111 if err != nil {
112 return err
113 }
114 return nil
115 })
116}
117
118func (s *imlClusterService) Get(ctx context.Context, id string) (*Cluster, error) {
119 v, err := s.store.FirstQuery(ctx, "`uuid` = ?", []interface{}{id}, "id desc")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected