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

Function withCASMappingID

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

withCASMappingID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

3186
3187// withCASMappingID sets the ID field of the mutation.
3188func withCASMappingID(id uuid.UUID) casmappingOption {
3189 return func(m *CASMappingMutation) {
3190 var (
3191 err error
3192 once sync.Once
3193 value *CASMapping
3194 )
3195 m.oldValue = func(ctx context.Context) (*CASMapping, error) {
3196 once.Do(func() {
3197 if m.done {
3198 err = errors.New("querying old values post mutation is not allowed")
3199 } else {
3200 value, err = m.Client().CASMapping.Get(ctx, id)
3201 }
3202 })
3203 return value, err
3204 }
3205 m.id = &id
3206 }
3207}
3208
3209// withCASMapping sets the old CASMapping of the mutation.
3210func withCASMapping(node *CASMapping) casmappingOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected