MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / withAttestationID

Function withAttestationID

app/controlplane/pkg/data/ent/mutation.go:1299–1318  ·  view source on GitHub ↗

withAttestationID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

1297
1298// withAttestationID sets the ID field of the mutation.
1299func withAttestationID(id uuid.UUID) attestationOption {
1300 return func(m *AttestationMutation) {
1301 var (
1302 err error
1303 once sync.Once
1304 value *Attestation
1305 )
1306 m.oldValue = func(ctx context.Context) (*Attestation, error) {
1307 once.Do(func() {
1308 if m.done {
1309 err = errors.New("querying old values post mutation is not allowed")
1310 } else {
1311 value, err = m.Client().Attestation.Get(ctx, id)
1312 }
1313 })
1314 return value, err
1315 }
1316 m.id = &id
1317 }
1318}
1319
1320// withAttestation sets the old Attestation of the mutation.
1321func withAttestation(node *Attestation) attestationOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected