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

Function withGroupID

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

withGroupID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

3937
3938// withGroupID sets the ID field of the mutation.
3939func withGroupID(id uuid.UUID) groupOption {
3940 return func(m *GroupMutation) {
3941 var (
3942 err error
3943 once sync.Once
3944 value *Group
3945 )
3946 m.oldValue = func(ctx context.Context) (*Group, error) {
3947 once.Do(func() {
3948 if m.done {
3949 err = errors.New("querying old values post mutation is not allowed")
3950 } else {
3951 value, err = m.Client().Group.Get(ctx, id)
3952 }
3953 })
3954 return value, err
3955 }
3956 m.id = &id
3957 }
3958}
3959
3960// withGroup sets the old Group of the mutation.
3961func withGroup(node *Group) groupOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected