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

Function withMembershipID

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

withMembershipID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

7054
7055// withMembershipID sets the ID field of the mutation.
7056func withMembershipID(id uuid.UUID) membershipOption {
7057 return func(m *MembershipMutation) {
7058 var (
7059 err error
7060 once sync.Once
7061 value *Membership
7062 )
7063 m.oldValue = func(ctx context.Context) (*Membership, error) {
7064 once.Do(func() {
7065 if m.done {
7066 err = errors.New("querying old values post mutation is not allowed")
7067 } else {
7068 value, err = m.Client().Membership.Get(ctx, id)
7069 }
7070 })
7071 return value, err
7072 }
7073 m.id = &id
7074 }
7075}
7076
7077// withMembership sets the old Membership of the mutation.
7078func withMembership(node *Membership) membershipOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected