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

Method mutate

app/controlplane/pkg/data/ent/client.go:684–697  ·  view source on GitHub ↗
(ctx context.Context, m *AttestationMutation)

Source from the content-addressed store, hash-verified

682}
683
684func (c *AttestationClient) mutate(ctx context.Context, m *AttestationMutation) (Value, error) {
685 switch m.Op() {
686 case OpCreate:
687 return (&AttestationCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
688 case OpUpdate:
689 return (&AttestationUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
690 case OpUpdateOne:
691 return (&AttestationUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
692 case OpDelete, OpDeleteOne:
693 return (&AttestationDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
694 default:
695 return nil, fmt.Errorf("ent: unknown Attestation mutation op: %q", m.Op())
696 }
697}
698
699// CASBackendClient is a client for the CASBackend schema.
700type CASBackendClient struct {

Callers

nothing calls this directly

Calls 4

HooksMethod · 0.95
SaveMethod · 0.65
ExecMethod · 0.65
OpMethod · 0.45

Tested by

no test coverage detected