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

Method Delete

module/certificate/impl.go:207–233  ·  view source on GitHub ↗
(ctx context.Context, id string)

Source from the content-addressed store, hash-verified

205}
206
207func (m *imlCertificate) Delete(ctx context.Context, id string) error {
208 cert, _, err := m.service.Get(ctx, id)
209 if err != nil {
210 if errors.Is(err, gorm.ErrRecordNotFound) {
211 return nil
212 }
213 return err
214 }
215 clusters, err := m.clusterService.ListByClusters(ctx, cert.Cluster)
216 if err != nil {
217 return err
218 }
219 return m.transaction.Transaction(ctx, func(ctx context.Context) error {
220 for _, c := range clusters {
221 err = m.syncGateway(ctx, c.Uuid, &gateway.DynamicRelease{
222 BasicItem: &gateway.BasicItem{
223 ID: id,
224 Description: "",
225 },
226 }, false)
227 if err != nil {
228 return err
229 }
230 }
231 return m.service.Delete(ctx, id)
232 })
233}

Callers

nothing calls this directly

Calls 4

syncGatewayMethod · 0.95
GetMethod · 0.65
ListByClustersMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected