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

Function withUserID

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

withUserID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

14257
14258// withUserID sets the ID field of the mutation.
14259func withUserID(id uuid.UUID) userOption {
14260 return func(m *UserMutation) {
14261 var (
14262 err error
14263 once sync.Once
14264 value *User
14265 )
14266 m.oldValue = func(ctx context.Context) (*User, error) {
14267 once.Do(func() {
14268 if m.done {
14269 err = errors.New("querying old values post mutation is not allowed")
14270 } else {
14271 value, err = m.Client().User.Get(ctx, id)
14272 }
14273 })
14274 return value, err
14275 }
14276 m.id = &id
14277 }
14278}
14279
14280// withUser sets the old User of the mutation.
14281func withUser(node *User) userOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected