runtime.go 11 KB

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