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

Function withProjectID

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

withProjectID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

10909
10910// withProjectID sets the ID field of the mutation.
10911func withProjectID(id uuid.UUID) projectOption {
10912 return func(m *ProjectMutation) {
10913 var (
10914 err error
10915 once sync.Once
10916 value *Project
10917 )
10918 m.oldValue = func(ctx context.Context) (*Project, error) {
10919 once.Do(func() {
10920 if m.done {
10921 err = errors.New("querying old values post mutation is not allowed")
10922 } else {
10923 value, err = m.Client().Project.Get(ctx, id)
10924 }
10925 })
10926 return value, err
10927 }
10928 m.id = &id
10929 }
10930}
10931
10932// withProject sets the old Project of the mutation.
10933func withProject(node *Project) projectOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected