github.com/crowdsecurity/crowdsec@v1.6.1/pkg/database/ent/runtime.go (about) 1 // Code generated by ent, DO NOT EDIT. 2 3 package ent 4 5 import ( 6 "time" 7 8 "github.com/crowdsecurity/crowdsec/pkg/database/ent/alert" 9 "github.com/crowdsecurity/crowdsec/pkg/database/ent/bouncer" 10 "github.com/crowdsecurity/crowdsec/pkg/database/ent/configitem" 11 "github.com/crowdsecurity/crowdsec/pkg/database/ent/decision" 12 "github.com/crowdsecurity/crowdsec/pkg/database/ent/event" 13 "github.com/crowdsecurity/crowdsec/pkg/database/ent/lock" 14 "github.com/crowdsecurity/crowdsec/pkg/database/ent/machine" 15 "github.com/crowdsecurity/crowdsec/pkg/database/ent/meta" 16 "github.com/crowdsecurity/crowdsec/pkg/database/ent/schema" 17 ) 18 19 // The init function reads all schema descriptors with runtime code 20 // (default values, validators, hooks and policies) and stitches it 21 // to their package variables. 22 func init() { 23 alertFields := schema.Alert{}.Fields() 24 _ = alertFields 25 // alertDescCreatedAt is the schema descriptor for created_at field. 26 alertDescCreatedAt := alertFields[0].Descriptor() 27 // alert.DefaultCreatedAt holds the default value on creation for the created_at field. 28 alert.DefaultCreatedAt = alertDescCreatedAt.Default.(func() time.Time) 29 // alert.UpdateDefaultCreatedAt holds the default value on update for the created_at field. 30 alert.UpdateDefaultCreatedAt = alertDescCreatedAt.UpdateDefault.(func() time.Time) 31 // alertDescUpdatedAt is the schema descriptor for updated_at field. 32 alertDescUpdatedAt := alertFields[1].Descriptor() 33 // alert.DefaultUpdatedAt holds the default value on creation for the updated_at field. 34 alert.DefaultUpdatedAt = alertDescUpdatedAt.Default.(func() time.Time) 35 // alert.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. 36 alert.UpdateDefaultUpdatedAt = alertDescUpdatedAt.UpdateDefault.(func() time.Time) 37 // alertDescBucketId is the schema descriptor for bucketId field. 38 alertDescBucketId := alertFields[3].Descriptor() 39 // alert.DefaultBucketId holds the default value on creation for the bucketId field. 40 alert.DefaultBucketId = alertDescBucketId.Default.(string) 41 // alertDescMessage is the schema descriptor for message field. 42 alertDescMessage := alertFields[4].Descriptor() 43 // alert.DefaultMessage holds the default value on creation for the message field. 44 alert.DefaultMessage = alertDescMessage.Default.(string) 45 // alertDescEventsCount is the schema descriptor for eventsCount field. 46 alertDescEventsCount := alertFields[5].Descriptor() 47 // alert.DefaultEventsCount holds the default value on creation for the eventsCount field. 48 alert.DefaultEventsCount = alertDescEventsCount.Default.(int32) 49 // alertDescStartedAt is the schema descriptor for startedAt field. 50 alertDescStartedAt := alertFields[6].Descriptor() 51 // alert.DefaultStartedAt holds the default value on creation for the startedAt field. 52 alert.DefaultStartedAt = alertDescStartedAt.Default.(func() time.Time) 53 // alertDescStoppedAt is the schema descriptor for stoppedAt field. 54 alertDescStoppedAt := alertFields[7].Descriptor() 55 // alert.DefaultStoppedAt holds the default value on creation for the stoppedAt field. 56 alert.DefaultStoppedAt = alertDescStoppedAt.Default.(func() time.Time) 57 // alertDescSimulated is the schema descriptor for simulated field. 58 alertDescSimulated := alertFields[21].Descriptor() 59 // alert.DefaultSimulated holds the default value on creation for the simulated field. 60 alert.DefaultSimulated = alertDescSimulated.Default.(bool) 61 bouncerFields := schema.Bouncer{}.Fields() 62 _ = bouncerFields 63 // bouncerDescCreatedAt is the schema descriptor for created_at field. 64 bouncerDescCreatedAt := bouncerFields[0].Descriptor() 65 // bouncer.DefaultCreatedAt holds the default value on creation for the created_at field. 66 bouncer.DefaultCreatedAt = bouncerDescCreatedAt.Default.(func() time.Time) 67 // bouncer.UpdateDefaultCreatedAt holds the default value on update for the created_at field. 68 bouncer.UpdateDefaultCreatedAt = bouncerDescCreatedAt.UpdateDefault.(func() time.Time) 69 // bouncerDescUpdatedAt is the schema descriptor for updated_at field. 70 bouncerDescUpdatedAt := bouncerFields[1].Descriptor() 71 // bouncer.DefaultUpdatedAt holds the default value on creation for the updated_at field. 72 bouncer.DefaultUpdatedAt = bouncerDescUpdatedAt.Default.(func() time.Time) 73 // bouncer.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. 74 bouncer.UpdateDefaultUpdatedAt = bouncerDescUpdatedAt.UpdateDefault.(func() time.Time) 75 // bouncerDescIPAddress is the schema descriptor for ip_address field. 76 bouncerDescIPAddress := bouncerFields[5].Descriptor() 77 // bouncer.DefaultIPAddress holds the default value on creation for the ip_address field. 78 bouncer.DefaultIPAddress = bouncerDescIPAddress.Default.(string) 79 // bouncerDescUntil is the schema descriptor for until field. 80 bouncerDescUntil := bouncerFields[8].Descriptor() 81 // bouncer.DefaultUntil holds the default value on creation for the until field. 82 bouncer.DefaultUntil = bouncerDescUntil.Default.(func() time.Time) 83 // bouncerDescLastPull is the schema descriptor for last_pull field. 84 bouncerDescLastPull := bouncerFields[9].Descriptor() 85 // bouncer.DefaultLastPull holds the default value on creation for the last_pull field. 86 bouncer.DefaultLastPull = bouncerDescLastPull.Default.(func() time.Time) 87 // bouncerDescAuthType is the schema descriptor for auth_type field. 88 bouncerDescAuthType := bouncerFields[10].Descriptor() 89 // bouncer.DefaultAuthType holds the default value on creation for the auth_type field. 90 bouncer.DefaultAuthType = bouncerDescAuthType.Default.(string) 91 configitemFields := schema.ConfigItem{}.Fields() 92 _ = configitemFields 93 // configitemDescCreatedAt is the schema descriptor for created_at field. 94 configitemDescCreatedAt := configitemFields[0].Descriptor() 95 // configitem.DefaultCreatedAt holds the default value on creation for the created_at field. 96 configitem.DefaultCreatedAt = configitemDescCreatedAt.Default.(func() time.Time) 97 // configitem.UpdateDefaultCreatedAt holds the default value on update for the created_at field. 98 configitem.UpdateDefaultCreatedAt = configitemDescCreatedAt.UpdateDefault.(func() time.Time) 99 // configitemDescUpdatedAt is the schema descriptor for updated_at field. 100 configitemDescUpdatedAt := configitemFields[1].Descriptor() 101 // configitem.DefaultUpdatedAt holds the default value on creation for the updated_at field. 102 configitem.DefaultUpdatedAt = configitemDescUpdatedAt.Default.(func() time.Time) 103 // configitem.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. 104 configitem.UpdateDefaultUpdatedAt = configitemDescUpdatedAt.UpdateDefault.(func() time.Time) 105 decisionFields := schema.Decision{}.Fields() 106 _ = decisionFields 107 // decisionDescCreatedAt is the schema descriptor for created_at field. 108 decisionDescCreatedAt := decisionFields[0].Descriptor() 109 // decision.DefaultCreatedAt holds the default value on creation for the created_at field. 110 decision.DefaultCreatedAt = decisionDescCreatedAt.Default.(func() time.Time) 111 // decision.UpdateDefaultCreatedAt holds the default value on update for the created_at field. 112 decision.UpdateDefaultCreatedAt = decisionDescCreatedAt.UpdateDefault.(func() time.Time) 113 // decisionDescUpdatedAt is the schema descriptor for updated_at field. 114 decisionDescUpdatedAt := decisionFields[1].Descriptor() 115 // decision.DefaultUpdatedAt holds the default value on creation for the updated_at field. 116 decision.DefaultUpdatedAt = decisionDescUpdatedAt.Default.(func() time.Time) 117 // decision.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. 118 decision.UpdateDefaultUpdatedAt = decisionDescUpdatedAt.UpdateDefault.(func() time.Time) 119 // decisionDescSimulated is the schema descriptor for simulated field. 120 decisionDescSimulated := decisionFields[13].Descriptor() 121 // decision.DefaultSimulated holds the default value on creation for the simulated field. 122 decision.DefaultSimulated = decisionDescSimulated.Default.(bool) 123 eventFields := schema.Event{}.Fields() 124 _ = eventFields 125 // eventDescCreatedAt is the schema descriptor for created_at field. 126 eventDescCreatedAt := eventFields[0].Descriptor() 127 // event.DefaultCreatedAt holds the default value on creation for the created_at field. 128 event.DefaultCreatedAt = eventDescCreatedAt.Default.(func() time.Time) 129 // event.UpdateDefaultCreatedAt holds the default value on update for the created_at field. 130 event.UpdateDefaultCreatedAt = eventDescCreatedAt.UpdateDefault.(func() time.Time) 131 // eventDescUpdatedAt is the schema descriptor for updated_at field. 132 eventDescUpdatedAt := eventFields[1].Descriptor() 133 // event.DefaultUpdatedAt holds the default value on creation for the updated_at field. 134 event.DefaultUpdatedAt = eventDescUpdatedAt.Default.(func() time.Time) 135 // event.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. 136 event.UpdateDefaultUpdatedAt = eventDescUpdatedAt.UpdateDefault.(func() time.Time) 137 // eventDescSerialized is the schema descriptor for serialized field. 138 eventDescSerialized := eventFields[3].Descriptor() 139 // event.SerializedValidator is a validator for the "serialized" field. It is called by the builders before save. 140 event.SerializedValidator = eventDescSerialized.Validators[0].(func(string) error) 141 lockFields := schema.Lock{}.Fields() 142 _ = lockFields 143 // lockDescCreatedAt is the schema descriptor for created_at field. 144 lockDescCreatedAt := lockFields[1].Descriptor() 145 // lock.DefaultCreatedAt holds the default value on creation for the created_at field. 146 lock.DefaultCreatedAt = lockDescCreatedAt.Default.(func() time.Time) 147 machineFields := schema.Machine{}.Fields() 148 _ = machineFields 149 // machineDescCreatedAt is the schema descriptor for created_at field. 150 machineDescCreatedAt := machineFields[0].Descriptor() 151 // machine.DefaultCreatedAt holds the default value on creation for the created_at field. 152 machine.DefaultCreatedAt = machineDescCreatedAt.Default.(func() time.Time) 153 // machine.UpdateDefaultCreatedAt holds the default value on update for the created_at field. 154 machine.UpdateDefaultCreatedAt = machineDescCreatedAt.UpdateDefault.(func() time.Time) 155 // machineDescUpdatedAt is the schema descriptor for updated_at field. 156 machineDescUpdatedAt := machineFields[1].Descriptor() 157 // machine.DefaultUpdatedAt holds the default value on creation for the updated_at field. 158 machine.DefaultUpdatedAt = machineDescUpdatedAt.Default.(func() time.Time) 159 // machine.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. 160 machine.UpdateDefaultUpdatedAt = machineDescUpdatedAt.UpdateDefault.(func() time.Time) 161 // machineDescLastPush is the schema descriptor for last_push field. 162 machineDescLastPush := machineFields[2].Descriptor() 163 // machine.DefaultLastPush holds the default value on creation for the last_push field. 164 machine.DefaultLastPush = machineDescLastPush.Default.(func() time.Time) 165 // machine.UpdateDefaultLastPush holds the default value on update for the last_push field. 166 machine.UpdateDefaultLastPush = machineDescLastPush.UpdateDefault.(func() time.Time) 167 // machineDescLastHeartbeat is the schema descriptor for last_heartbeat field. 168 machineDescLastHeartbeat := machineFields[3].Descriptor() 169 // machine.DefaultLastHeartbeat holds the default value on creation for the last_heartbeat field. 170 machine.DefaultLastHeartbeat = machineDescLastHeartbeat.Default.(func() time.Time) 171 // machine.UpdateDefaultLastHeartbeat holds the default value on update for the last_heartbeat field. 172 machine.UpdateDefaultLastHeartbeat = machineDescLastHeartbeat.UpdateDefault.(func() time.Time) 173 // machineDescScenarios is the schema descriptor for scenarios field. 174 machineDescScenarios := machineFields[7].Descriptor() 175 // machine.ScenariosValidator is a validator for the "scenarios" field. It is called by the builders before save. 176 machine.ScenariosValidator = machineDescScenarios.Validators[0].(func(string) error) 177 // machineDescIsValidated is the schema descriptor for isValidated field. 178 machineDescIsValidated := machineFields[9].Descriptor() 179 // machine.DefaultIsValidated holds the default value on creation for the isValidated field. 180 machine.DefaultIsValidated = machineDescIsValidated.Default.(bool) 181 // machineDescAuthType is the schema descriptor for auth_type field. 182 machineDescAuthType := machineFields[11].Descriptor() 183 // machine.DefaultAuthType holds the default value on creation for the auth_type field. 184 machine.DefaultAuthType = machineDescAuthType.Default.(string) 185 metaFields := schema.Meta{}.Fields() 186 _ = metaFields 187 // metaDescCreatedAt is the schema descriptor for created_at field. 188 metaDescCreatedAt := metaFields[0].Descriptor() 189 // meta.DefaultCreatedAt holds the default value on creation for the created_at field. 190 meta.DefaultCreatedAt = metaDescCreatedAt.Default.(func() time.Time) 191 // meta.UpdateDefaultCreatedAt holds the default value on update for the created_at field. 192 meta.UpdateDefaultCreatedAt = metaDescCreatedAt.UpdateDefault.(func() time.Time) 193 // metaDescUpdatedAt is the schema descriptor for updated_at field. 194 metaDescUpdatedAt := metaFields[1].Descriptor() 195 // meta.DefaultUpdatedAt holds the default value on creation for the updated_at field. 196 meta.DefaultUpdatedAt = metaDescUpdatedAt.Default.(func() time.Time) 197 // meta.UpdateDefaultUpdatedAt holds the default value on update for the updated_at field. 198 meta.UpdateDefaultUpdatedAt = metaDescUpdatedAt.UpdateDefault.(func() time.Time) 199 // metaDescValue is the schema descriptor for value field. 200 metaDescValue := metaFields[3].Descriptor() 201 // meta.ValueValidator is a validator for the "value" field. It is called by the builders before save. 202 meta.ValueValidator = metaDescValue.Validators[0].(func(string) error) 203 }