bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/pkg/database/ent/alert/alert.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package alert 4 5 import ( 6 "time" 7 ) 8 9 const ( 10 // Label holds the string label denoting the alert type in the database. 11 Label = "alert" 12 // FieldID holds the string denoting the id field in the database. 13 FieldID = "id" 14 // FieldCreatedAt holds the string denoting the created_at field in the database. 15 FieldCreatedAt = "created_at" 16 // FieldUpdatedAt holds the string denoting the updated_at field in the database. 17 FieldUpdatedAt = "updated_at" 18 // FieldScenario holds the string denoting the scenario field in the database. 19 FieldScenario = "scenario" 20 // FieldBucketId holds the string denoting the bucketid field in the database. 21 FieldBucketId = "bucket_id" 22 // FieldMessage holds the string denoting the message field in the database. 23 FieldMessage = "message" 24 // FieldEventsCount holds the string denoting the eventscount field in the database. 25 FieldEventsCount = "events_count" 26 // FieldStartedAt holds the string denoting the startedat field in the database. 27 FieldStartedAt = "started_at" 28 // FieldStoppedAt holds the string denoting the stoppedat field in the database. 29 FieldStoppedAt = "stopped_at" 30 // FieldSourceIp holds the string denoting the sourceip field in the database. 31 FieldSourceIp = "source_ip" 32 // FieldSourceRange holds the string denoting the sourcerange field in the database. 33 FieldSourceRange = "source_range" 34 // FieldSourceAsNumber holds the string denoting the sourceasnumber field in the database. 35 FieldSourceAsNumber = "source_as_number" 36 // FieldSourceAsName holds the string denoting the sourceasname field in the database. 37 FieldSourceAsName = "source_as_name" 38 // FieldSourceCountry holds the string denoting the sourcecountry field in the database. 39 FieldSourceCountry = "source_country" 40 // FieldSourceLatitude holds the string denoting the sourcelatitude field in the database. 41 FieldSourceLatitude = "source_latitude" 42 // FieldSourceLongitude holds the string denoting the sourcelongitude field in the database. 43 FieldSourceLongitude = "source_longitude" 44 // FieldSourceScope holds the string denoting the sourcescope field in the database. 45 FieldSourceScope = "source_scope" 46 // FieldSourceValue holds the string denoting the sourcevalue field in the database. 47 FieldSourceValue = "source_value" 48 // FieldCapacity holds the string denoting the capacity field in the database. 49 FieldCapacity = "capacity" 50 // FieldLeakSpeed holds the string denoting the leakspeed field in the database. 51 FieldLeakSpeed = "leak_speed" 52 // FieldScenarioVersion holds the string denoting the scenarioversion field in the database. 53 FieldScenarioVersion = "scenario_version" 54 // FieldScenarioHash holds the string denoting the scenariohash field in the database. 55 FieldScenarioHash = "scenario_hash" 56 // FieldSimulated holds the string denoting the simulated field in the database. 57 FieldSimulated = "simulated" 58 // EdgeOwner holds the string denoting the owner edge name in mutations. 59 EdgeOwner = "owner" 60 // EdgeDecisions holds the string denoting the decisions edge name in mutations. 61 EdgeDecisions = "decisions" 62 // EdgeEvents holds the string denoting the events edge name in mutations. 63 EdgeEvents = "events" 64 // EdgeMetas holds the string denoting the metas edge name in mutations. 65 EdgeMetas = "metas" 66 // Table holds the table name of the alert in the database. 67 Table = "alerts" 68 // OwnerTable is the table the holds the owner relation/edge. 69 OwnerTable = "alerts" 70 // OwnerInverseTable is the table name for the Machine entity. 71 // It exists in this package in order to avoid circular dependency with the "machine" package. 72 OwnerInverseTable = "machines" 73 // OwnerColumn is the table column denoting the owner relation/edge. 74 OwnerColumn = "machine_alerts" 75 // DecisionsTable is the table the holds the decisions relation/edge. 76 DecisionsTable = "decisions" 77 // DecisionsInverseTable is the table name for the Decision entity. 78 // It exists in this package in order to avoid circular dependency with the "decision" package. 79 DecisionsInverseTable = "decisions" 80 // DecisionsColumn is the table column denoting the decisions relation/edge. 81 DecisionsColumn = "alert_decisions" 82 // EventsTable is the table the holds the events relation/edge. 83 EventsTable = "events" 84 // EventsInverseTable is the table name for the Event entity. 85 // It exists in this package in order to avoid circular dependency with the "event" package. 86 EventsInverseTable = "events" 87 // EventsColumn is the table column denoting the events relation/edge. 88 EventsColumn = "alert_events" 89 // MetasTable is the table the holds the metas relation/edge. 90 MetasTable = "meta" 91 // MetasInverseTable is the table name for the Meta entity. 92 // It exists in this package in order to avoid circular dependency with the "meta" package. 93 MetasInverseTable = "meta" 94 // MetasColumn is the table column denoting the metas relation/edge. 95 MetasColumn = "alert_metas" 96 ) 97 98 // Columns holds all SQL columns for alert fields. 99 var Columns = []string{ 100 FieldID, 101 FieldCreatedAt, 102 FieldUpdatedAt, 103 FieldScenario, 104 FieldBucketId, 105 FieldMessage, 106 FieldEventsCount, 107 FieldStartedAt, 108 FieldStoppedAt, 109 FieldSourceIp, 110 FieldSourceRange, 111 FieldSourceAsNumber, 112 FieldSourceAsName, 113 FieldSourceCountry, 114 FieldSourceLatitude, 115 FieldSourceLongitude, 116 FieldSourceScope, 117 FieldSourceValue, 118 FieldCapacity, 119 FieldLeakSpeed, 120 FieldScenarioVersion, 121 FieldScenarioHash, 122 FieldSimulated, 123 } 124 125 // ForeignKeys holds the SQL foreign-keys that are owned by the "alerts" 126 // table and are not defined as standalone fields in the schema. 127 var ForeignKeys = []string{ 128 "machine_alerts", 129 } 130 131 // ValidColumn reports if the column name is valid (part of the table columns). 132 func ValidColumn(column string) bool { 133 for i := range Columns { 134 if column == Columns[i] { 135 return true 136 } 137 } 138 for i := range ForeignKeys { 139 if column == ForeignKeys[i] { 140 return true 141 } 142 } 143 return false 144 } 145 146 var ( 147 // DefaultCreatedAt holds the default value on creation for the "created_at" field. 148 DefaultCreatedAt func() time.Time 149 // DefaultUpdatedAt holds the default value on creation for the "updated_at" field. 150 DefaultUpdatedAt func() time.Time 151 // DefaultBucketId holds the default value on creation for the "bucketId" field. 152 DefaultBucketId string 153 // DefaultMessage holds the default value on creation for the "message" field. 154 DefaultMessage string 155 // DefaultEventsCount holds the default value on creation for the "eventsCount" field. 156 DefaultEventsCount int32 157 // DefaultStartedAt holds the default value on creation for the "startedAt" field. 158 DefaultStartedAt func() time.Time 159 // DefaultStoppedAt holds the default value on creation for the "stoppedAt" field. 160 DefaultStoppedAt func() time.Time 161 // DefaultSimulated holds the default value on creation for the "simulated" field. 162 DefaultSimulated bool 163 )