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

Function withCASBackendID

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

withCASBackendID sets the ID field of the mutation.

(id uuid.UUID)

Source from the content-addressed store, hash-verified

1808
1809// withCASBackendID sets the ID field of the mutation.
1810func withCASBackendID(id uuid.UUID) casbackendOption {
1811 return func(m *CASBackendMutation) {
1812 var (
1813 err error
1814 once sync.Once
1815 value *CASBackend
1816 )
1817 m.oldValue = func(ctx context.Context) (*CASBackend, error) {
1818 once.Do(func() {
1819 if m.done {
1820 err = errors.New("querying old values post mutation is not allowed")
1821 } else {
1822 value, err = m.Client().CASBackend.Get(ctx, id)
1823 }
1824 })
1825 return value, err
1826 }
1827 m.id = &id
1828 }
1829}
1830
1831// withCASBackend sets the old CASBackend of the mutation.
1832func withCASBackend(node *CASBackend) casbackendOption {

Callers 1

UpdateOneIDMethod · 0.85

Calls 3

DoMethod · 0.80
GetMethod · 0.65
ClientMethod · 0.45

Tested by

no test coverage detected