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

Function init

app/controlplane/pkg/data/ent/runtime.go:35–396  ·  view source on GitHub ↗

The init function reads all schema descriptors with runtime code (default values, validators, hooks and policies) and stitches it to their package variables.

()

Source from the content-addressed store, hash-verified

33// (default values, validators, hooks and policies) and stitches it
34// to their package variables.
35func init() {
36 apitokenFields := schema.APIToken{}.Fields()
37 _ = apitokenFields
38 // apitokenDescCreatedAt is the schema descriptor for created_at field.
39 apitokenDescCreatedAt := apitokenFields[3].Descriptor()
40 // apitoken.DefaultCreatedAt holds the default value on creation for the created_at field.
41 apitoken.DefaultCreatedAt = apitokenDescCreatedAt.Default.(func() time.Time)
42 // apitokenDescIsSystem is the schema descriptor for is_system field.
43 apitokenDescIsSystem := apitokenFields[11].Descriptor()
44 // apitoken.DefaultIsSystem holds the default value on creation for the is_system field.
45 apitoken.DefaultIsSystem = apitokenDescIsSystem.Default.(bool)
46 // apitokenDescID is the schema descriptor for id field.
47 apitokenDescID := apitokenFields[0].Descriptor()
48 // apitoken.DefaultID holds the default value on creation for the id field.
49 apitoken.DefaultID = apitokenDescID.Default.(func() uuid.UUID)
50 attestationFields := schema.Attestation{}.Fields()
51 _ = attestationFields
52 // attestationDescCreatedAt is the schema descriptor for created_at field.
53 attestationDescCreatedAt := attestationFields[1].Descriptor()
54 // attestation.DefaultCreatedAt holds the default value on creation for the created_at field.
55 attestation.DefaultCreatedAt = attestationDescCreatedAt.Default.(func() time.Time)
56 // attestationDescBundle is the schema descriptor for bundle field.
57 attestationDescBundle := attestationFields[2].Descriptor()
58 // attestation.BundleValidator is a validator for the "bundle" field. It is called by the builders before save.
59 attestation.BundleValidator = attestationDescBundle.Validators[0].(func([]byte) error)
60 // attestationDescID is the schema descriptor for id field.
61 attestationDescID := attestationFields[0].Descriptor()
62 // attestation.DefaultID holds the default value on creation for the id field.
63 attestation.DefaultID = attestationDescID.Default.(func() uuid.UUID)
64 casbackendFields := schema.CASBackend{}.Fields()
65 _ = casbackendFields
66 // casbackendDescCreatedAt is the schema descriptor for created_at field.
67 casbackendDescCreatedAt := casbackendFields[6].Descriptor()
68 // casbackend.DefaultCreatedAt holds the default value on creation for the created_at field.
69 casbackend.DefaultCreatedAt = casbackendDescCreatedAt.Default.(func() time.Time)
70 // casbackendDescUpdatedAt is the schema descriptor for updated_at field.
71 casbackendDescUpdatedAt := casbackendFields[7].Descriptor()
72 // casbackend.DefaultUpdatedAt holds the default value on creation for the updated_at field.
73 casbackend.DefaultUpdatedAt = casbackendDescUpdatedAt.Default.(func() time.Time)
74 // casbackend.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field.
75 casbackend.UpdateDefaultUpdatedAt = casbackendDescUpdatedAt.UpdateDefault.(func() time.Time)
76 // casbackendDescValidatedAt is the schema descriptor for validated_at field.
77 casbackendDescValidatedAt := casbackendFields[10].Descriptor()
78 // casbackend.DefaultValidatedAt holds the default value on creation for the validated_at field.
79 casbackend.DefaultValidatedAt = casbackendDescValidatedAt.Default.(func() time.Time)
80 // casbackendDescDefault is the schema descriptor for default field.
81 casbackendDescDefault := casbackendFields[11].Descriptor()
82 // casbackend.DefaultDefault holds the default value on creation for the default field.
83 casbackend.DefaultDefault = casbackendDescDefault.Default.(bool)
84 // casbackendDescFallback is the schema descriptor for fallback field.
85 casbackendDescFallback := casbackendFields[13].Descriptor()
86 // casbackend.DefaultFallback holds the default value on creation for the fallback field.
87 casbackend.DefaultFallback = casbackendDescFallback.Default.(bool)
88 // casbackendDescManaged is the schema descriptor for managed field.
89 casbackendDescManaged := casbackendFields[14].Descriptor()
90 // casbackend.DefaultManaged holds the default value on creation for the managed field.
91 casbackend.DefaultManaged = casbackendDescManaged.Default.(bool)
92 // casbackendDescID is the schema descriptor for id field.

Callers 15

loadReferredByMethod · 0.70
loadReferencesMethod · 0.70
loadWorkflowsMethod · 0.70
loadAttachmentsMethod · 0.70
loadGroupMembershipsMethod · 0.70
loadWorkflowRunMethod · 0.70
loadRobotaccountsMethod · 0.70
loadWorkflowrunsMethod · 0.70
loadReferrersMethod · 0.70
loadMembershipsMethod · 0.70
loadWorkflowContractsMethod · 0.70

Calls 2

FieldsMethod · 0.45
DescriptorMethod · 0.45

Tested by

no test coverage detected