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

Method mutate

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

Source from the content-addressed store, hash-verified

1028}
1029
1030func (c *CASMappingClient) mutate(ctx context.Context, m *CASMappingMutation) (Value, error) {
1031 switch m.Op() {
1032 case OpCreate:
1033 return (&CASMappingCreate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
1034 case OpUpdate:
1035 return (&CASMappingUpdate{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
1036 case OpUpdateOne:
1037 return (&CASMappingUpdateOne{config: c.config, hooks: c.Hooks(), mutation: m}).Save(ctx)
1038 case OpDelete, OpDeleteOne:
1039 return (&CASMappingDelete{config: c.config, hooks: c.Hooks(), mutation: m}).Exec(ctx)
1040 default:
1041 return nil, fmt.Errorf("ent: unknown CASMapping mutation op: %q", m.Op())
1042 }
1043}
1044
1045// GroupClient is a client for the Group schema.
1046type GroupClient 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