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

Function withIntegrationID

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

withIntegrationID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

5533
5534// withIntegrationID sets the ID field of the mutation.
5535func withIntegrationID(id uuid.UUID) integrationOption {
5536 return func(m *IntegrationMutation) {
5537 var (
5538 err error
5539 once sync.Once
5540 value *Integration
5541 )
5542 m.oldValue = func(ctx context.Context) (*Integration, error) {
5543 once.Do(func() {
5544 if m.done {
5545 err = errors.New("querying old values post mutation is not allowed")
5546 } else {
5547 value, err = m.Client().Integration.Get(ctx, id)
5548 }
5549 })
5550 return value, err
5551 }
5552 m.id = &id
5553 }
5554}
5555
5556// withIntegration sets the old Integration of the mutation.
5557func withIntegration(node *Integration) integrationOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected