Debian Codegraph @

ent/runtime.go

raw
1 // Code generated by ent, DO NOT EDIT.
2
3 package ent
4
5 import (
6 "time"
7
8 "github.com/google/uuid"
9 "github.com/in-toto/archivista/ent/attestation"
10 "github.com/in-toto/archivista/ent/attestationcollection"
11 "github.com/in-toto/archivista/ent/attestationpolicy"
12 "github.com/in-toto/archivista/ent/dsse"
13 "github.com/in-toto/archivista/ent/payloaddigest"
14 "github.com/in-toto/archivista/ent/schema"
15 "github.com/in-toto/archivista/ent/signature"
16 "github.com/in-toto/archivista/ent/statement"
17 "github.com/in-toto/archivista/ent/subject"
18 "github.com/in-toto/archivista/ent/subjectdigest"
19 "github.com/in-toto/archivista/ent/timestamp"
20 )
21
22 // The init function reads all schema descriptors with runtime code
23 // (default values, validators, hooks and policies) and stitches it
24 // to their package variables.
25 func init() {
26 attestationFields := schema.Attestation{}.Fields()
27 _ = attestationFields
28 // attestationDescType is the schema descriptor for type field.
29 attestationDescType := attestationFields[1].Descriptor()
30 // attestation.TypeValidator is a validator for the "type" field. It is called by the builders before save.
31 attestation.TypeValidator = attestationDescType.Validators[0].(func(string) error)
32 // attestationDescID is the schema descriptor for id field.
33 attestationDescID := attestationFields[0].Descriptor()
34 // attestation.DefaultID holds the default value on creation for the id field.
35 attestation.DefaultID = attestationDescID.Default.(func() uuid.UUID)
36 attestationcollectionFields := schema.AttestationCollection{}.Fields()
37 _ = attestationcollectionFields
38 // attestationcollectionDescName is the schema descriptor for name field.
39 attestationcollectionDescName := attestationcollectionFields[1].Descriptor()
40 // attestationcollection.NameValidator is a validator for the "name" field. It is called by the builders before save.
41 attestationcollection.NameValidator = attestationcollectionDescName.Validators[0].(func(string) error)
42 // attestationcollectionDescID is the schema descriptor for id field.
43 attestationcollectionDescID := attestationcollectionFields[0].Descriptor()
44 // attestationcollection.DefaultID holds the default value on creation for the id field.
45 attestationcollection.DefaultID = attestationcollectionDescID.Default.(func() uuid.UUID)
46 attestationpolicyFields := schema.AttestationPolicy{}.Fields()
47 _ = attestationpolicyFields
48 // attestationpolicyDescName is the schema descriptor for name field.
49 attestationpolicyDescName := attestationpolicyFields[1].Descriptor()
50 // attestationpolicy.NameValidator is a validator for the "name" field. It is called by the builders before save.
51 attestationpolicy.NameValidator = attestationpolicyDescName.Validators[0].(func(string) error)
52 // attestationpolicyDescID is the schema descriptor for id field.
53 attestationpolicyDescID := attestationpolicyFields[0].Descriptor()
54 // attestationpolicy.DefaultID holds the default value on creation for the id field.
55 attestationpolicy.DefaultID = attestationpolicyDescID.Default.(func() uuid.UUID)
56 dsseFields := schema.Dsse{}.Fields()
57 _ = dsseFields
58 // dsseDescCreatedAt is the schema descriptor for created_at field.
59 dsseDescCreatedAt := dsseFields[1].Descriptor()
60 // dsse.DefaultCreatedAt holds the default value on creation for the created_at field.
61 dsse.DefaultCreatedAt = dsseDescCreatedAt.Default.(func() time.Time)
62 // dsseDescGitoidSha256 is the schema descriptor for gitoid_sha256 field.
63 dsseDescGitoidSha256 := dsseFields[2].Descriptor()
64 // dsse.GitoidSha256Validator is a validator for the "gitoid_sha256" field. It is called by the builders before save.
65 dsse.GitoidSha256Validator = dsseDescGitoidSha256.Validators[0].(func(string) error)
66 // dsseDescPayloadType is the schema descriptor for payload_type field.
67 dsseDescPayloadType := dsseFields[3].Descriptor()
68 // dsse.PayloadTypeValidator is a validator for the "payload_type" field. It is called by the builders before save.
69 dsse.PayloadTypeValidator = dsseDescPayloadType.Validators[0].(func(string) error)
70 // dsseDescID is the schema descriptor for id field.
71 dsseDescID := dsseFields[0].Descriptor()
72 // dsse.DefaultID holds the default value on creation for the id field.
73 dsse.DefaultID = dsseDescID.Default.(func() uuid.UUID)
74 payloaddigestFields := schema.PayloadDigest{}.Fields()
75 _ = payloaddigestFields
76 // payloaddigestDescAlgorithm is the schema descriptor for algorithm field.
77 payloaddigestDescAlgorithm := payloaddigestFields[1].Descriptor()
78 // payloaddigest.AlgorithmValidator is a validator for the "algorithm" field. It is called by the builders before save.
79 payloaddigest.AlgorithmValidator = payloaddigestDescAlgorithm.Validators[0].(func(string) error)
80 // payloaddigestDescValue is the schema descriptor for value field.
81 payloaddigestDescValue := payloaddigestFields[2].Descriptor()
82 // payloaddigest.ValueValidator is a validator for the "value" field. It is called by the builders before save.
83 payloaddigest.ValueValidator = payloaddigestDescValue.Validators[0].(func(string) error)
84 // payloaddigestDescID is the schema descriptor for id field.
85 payloaddigestDescID := payloaddigestFields[0].Descriptor()
86 // payloaddigest.DefaultID holds the default value on creation for the id field.
87 payloaddigest.DefaultID = payloaddigestDescID.Default.(func() uuid.UUID)
88 signatureFields := schema.Signature{}.Fields()
89 _ = signatureFields
90 // signatureDescSignature is the schema descriptor for signature field.
91 signatureDescSignature := signatureFields[2].Descriptor()
92 // signature.SignatureValidator is a validator for the "signature" field. It is called by the builders before save.
93 signature.SignatureValidator = signatureDescSignature.Validators[0].(func(string) error)
94 // signatureDescID is the schema descriptor for id field.
95 signatureDescID := signatureFields[0].Descriptor()
96 // signature.DefaultID holds the default value on creation for the id field.
97 signature.DefaultID = signatureDescID.Default.(func() uuid.UUID)
98 statementFields := schema.Statement{}.Fields()
99 _ = statementFields
100 // statementDescPredicate is the schema descriptor for predicate field.
101 statementDescPredicate := statementFields[1].Descriptor()
102 // statement.PredicateValidator is a validator for the "predicate" field. It is called by the builders before save.
103 statement.PredicateValidator = statementDescPredicate.Validators[0].(func(string) error)
104 // statementDescID is the schema descriptor for id field.
105 statementDescID := statementFields[0].Descriptor()
106 // statement.DefaultID holds the default value on creation for the id field.
107 statement.DefaultID = statementDescID.Default.(func() uuid.UUID)
108 subjectFields := schema.Subject{}.Fields()
109 _ = subjectFields
110 // subjectDescCreatedAt is the schema descriptor for created_at field.
111 subjectDescCreatedAt := subjectFields[1].Descriptor()
112 // subject.DefaultCreatedAt holds the default value on creation for the created_at field.
113 subject.DefaultCreatedAt = subjectDescCreatedAt.Default.(func() time.Time)
114 // subjectDescName is the schema descriptor for name field.
115 subjectDescName := subjectFields[2].Descriptor()
116 // subject.NameValidator is a validator for the "name" field. It is called by the builders before save.
117 subject.NameValidator = subjectDescName.Validators[0].(func(string) error)
118 // subjectDescID is the schema descriptor for id field.
119 subjectDescID := subjectFields[0].Descriptor()
120 // subject.DefaultID holds the default value on creation for the id field.
121 subject.DefaultID = subjectDescID.Default.(func() uuid.UUID)
122 subjectdigestFields := schema.SubjectDigest{}.Fields()
123 _ = subjectdigestFields
124 // subjectdigestDescAlgorithm is the schema descriptor for algorithm field.
125 subjectdigestDescAlgorithm := subjectdigestFields[1].Descriptor()
126 // subjectdigest.AlgorithmValidator is a validator for the "algorithm" field. It is called by the builders before save.
127 subjectdigest.AlgorithmValidator = subjectdigestDescAlgorithm.Validators[0].(func(string) error)
128 // subjectdigestDescValue is the schema descriptor for value field.
129 subjectdigestDescValue := subjectdigestFields[2].Descriptor()
130 // subjectdigest.ValueValidator is a validator for the "value" field. It is called by the builders before save.
131 subjectdigest.ValueValidator = subjectdigestDescValue.Validators[0].(func(string) error)
132 // subjectdigestDescID is the schema descriptor for id field.
133 subjectdigestDescID := subjectdigestFields[0].Descriptor()
134 // subjectdigest.DefaultID holds the default value on creation for the id field.
135 subjectdigest.DefaultID = subjectdigestDescID.Default.(func() uuid.UUID)
136 timestampFields := schema.Timestamp{}.Fields()
137 _ = timestampFields
138 // timestampDescID is the schema descriptor for id field.
139 timestampDescID := timestampFields[0].Descriptor()
140 // timestamp.DefaultID holds the default value on creation for the id field.
141 timestamp.DefaultID = timestampDescID.Default.(func() uuid.UUID)
142 }