MCPcopy
hub / github.com/caddyserver/certmagic / storeTx

Function storeTx

storage.go:194–205  ·  view source on GitHub ↗

storeTx stores all the values or none at all.

(ctx context.Context, s Storage, all []keyValue)

Source from the content-addressed store, hash-verified

192
193// storeTx stores all the values or none at all.
194func storeTx(ctx context.Context, s Storage, all []keyValue) error {
195 for i, kv := range all {
196 err := s.Store(ctx, kv.key, kv.value)
197 if err != nil {
198 for j := i - 1; j >= 0; j-- {
199 s.Delete(ctx, all[j].key)
200 }
201 return err
202 }
203 }
204 return nil
205}
206
207// keyValue pairs a key and a value.
208type keyValue struct {

Callers 2

saveAccountMethod · 0.85
saveCertResourceMethod · 0.85

Calls 2

StoreMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…