errorpassthroughrule.go 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. // Code generated by ent, DO NOT EDIT.
  2. package errorpassthroughrule
  3. import (
  4. "time"
  5. "entgo.io/ent/dialect/sql"
  6. )
  7. const (
  8. // Label holds the string label denoting the errorpassthroughrule type in the database.
  9. Label = "error_passthrough_rule"
  10. // FieldID holds the string denoting the id field in the database.
  11. FieldID = "id"
  12. // FieldCreatedAt holds the string denoting the created_at field in the database.
  13. FieldCreatedAt = "created_at"
  14. // FieldUpdatedAt holds the string denoting the updated_at field in the database.
  15. FieldUpdatedAt = "updated_at"
  16. // FieldName holds the string denoting the name field in the database.
  17. FieldName = "name"
  18. // FieldEnabled holds the string denoting the enabled field in the database.
  19. FieldEnabled = "enabled"
  20. // FieldPriority holds the string denoting the priority field in the database.
  21. FieldPriority = "priority"
  22. // FieldErrorCodes holds the string denoting the error_codes field in the database.
  23. FieldErrorCodes = "error_codes"
  24. // FieldKeywords holds the string denoting the keywords field in the database.
  25. FieldKeywords = "keywords"
  26. // FieldMatchMode holds the string denoting the match_mode field in the database.
  27. FieldMatchMode = "match_mode"
  28. // FieldPlatforms holds the string denoting the platforms field in the database.
  29. FieldPlatforms = "platforms"
  30. // FieldPassthroughCode holds the string denoting the passthrough_code field in the database.
  31. FieldPassthroughCode = "passthrough_code"
  32. // FieldResponseCode holds the string denoting the response_code field in the database.
  33. FieldResponseCode = "response_code"
  34. // FieldPassthroughBody holds the string denoting the passthrough_body field in the database.
  35. FieldPassthroughBody = "passthrough_body"
  36. // FieldCustomMessage holds the string denoting the custom_message field in the database.
  37. FieldCustomMessage = "custom_message"
  38. // FieldSkipMonitoring holds the string denoting the skip_monitoring field in the database.
  39. FieldSkipMonitoring = "skip_monitoring"
  40. // FieldDescription holds the string denoting the description field in the database.
  41. FieldDescription = "description"
  42. // Table holds the table name of the errorpassthroughrule in the database.
  43. Table = "error_passthrough_rules"
  44. )
  45. // Columns holds all SQL columns for errorpassthroughrule fields.
  46. var Columns = []string{
  47. FieldID,
  48. FieldCreatedAt,
  49. FieldUpdatedAt,
  50. FieldName,
  51. FieldEnabled,
  52. FieldPriority,
  53. FieldErrorCodes,
  54. FieldKeywords,
  55. FieldMatchMode,
  56. FieldPlatforms,
  57. FieldPassthroughCode,
  58. FieldResponseCode,
  59. FieldPassthroughBody,
  60. FieldCustomMessage,
  61. FieldSkipMonitoring,
  62. FieldDescription,
  63. }
  64. // ValidColumn reports if the column name is valid (part of the table columns).
  65. func ValidColumn(column string) bool {
  66. for i := range Columns {
  67. if column == Columns[i] {
  68. return true
  69. }
  70. }
  71. return false
  72. }
  73. var (
  74. // DefaultCreatedAt holds the default value on creation for the "created_at" field.
  75. DefaultCreatedAt func() time.Time
  76. // DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
  77. DefaultUpdatedAt func() time.Time
  78. // UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
  79. UpdateDefaultUpdatedAt func() time.Time
  80. // NameValidator is a validator for the "name" field. It is called by the builders before save.
  81. NameValidator func(string) error
  82. // DefaultEnabled holds the default value on creation for the "enabled" field.
  83. DefaultEnabled bool
  84. // DefaultPriority holds the default value on creation for the "priority" field.
  85. DefaultPriority int
  86. // DefaultMatchMode holds the default value on creation for the "match_mode" field.
  87. DefaultMatchMode string
  88. // MatchModeValidator is a validator for the "match_mode" field. It is called by the builders before save.
  89. MatchModeValidator func(string) error
  90. // DefaultPassthroughCode holds the default value on creation for the "passthrough_code" field.
  91. DefaultPassthroughCode bool
  92. // DefaultPassthroughBody holds the default value on creation for the "passthrough_body" field.
  93. DefaultPassthroughBody bool
  94. // DefaultSkipMonitoring holds the default value on creation for the "skip_monitoring" field.
  95. DefaultSkipMonitoring bool
  96. )
  97. // OrderOption defines the ordering options for the ErrorPassthroughRule queries.
  98. type OrderOption func(*sql.Selector)
  99. // ByID orders the results by the id field.
  100. func ByID(opts ...sql.OrderTermOption) OrderOption {
  101. return sql.OrderByField(FieldID, opts...).ToFunc()
  102. }
  103. // ByCreatedAt orders the results by the created_at field.
  104. func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
  105. return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
  106. }
  107. // ByUpdatedAt orders the results by the updated_at field.
  108. func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
  109. return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
  110. }
  111. // ByName orders the results by the name field.
  112. func ByName(opts ...sql.OrderTermOption) OrderOption {
  113. return sql.OrderByField(FieldName, opts...).ToFunc()
  114. }
  115. // ByEnabled orders the results by the enabled field.
  116. func ByEnabled(opts ...sql.OrderTermOption) OrderOption {
  117. return sql.OrderByField(FieldEnabled, opts...).ToFunc()
  118. }
  119. // ByPriority orders the results by the priority field.
  120. func ByPriority(opts ...sql.OrderTermOption) OrderOption {
  121. return sql.OrderByField(FieldPriority, opts...).ToFunc()
  122. }
  123. // ByMatchMode orders the results by the match_mode field.
  124. func ByMatchMode(opts ...sql.OrderTermOption) OrderOption {
  125. return sql.OrderByField(FieldMatchMode, opts...).ToFunc()
  126. }
  127. // ByPassthroughCode orders the results by the passthrough_code field.
  128. func ByPassthroughCode(opts ...sql.OrderTermOption) OrderOption {
  129. return sql.OrderByField(FieldPassthroughCode, opts...).ToFunc()
  130. }
  131. // ByResponseCode orders the results by the response_code field.
  132. func ByResponseCode(opts ...sql.OrderTermOption) OrderOption {
  133. return sql.OrderByField(FieldResponseCode, opts...).ToFunc()
  134. }
  135. // ByPassthroughBody orders the results by the passthrough_body field.
  136. func ByPassthroughBody(opts ...sql.OrderTermOption) OrderOption {
  137. return sql.OrderByField(FieldPassthroughBody, opts...).ToFunc()
  138. }
  139. // ByCustomMessage orders the results by the custom_message field.
  140. func ByCustomMessage(opts ...sql.OrderTermOption) OrderOption {
  141. return sql.OrderByField(FieldCustomMessage, opts...).ToFunc()
  142. }
  143. // BySkipMonitoring orders the results by the skip_monitoring field.
  144. func BySkipMonitoring(opts ...sql.OrderTermOption) OrderOption {
  145. return sql.OrderByField(FieldSkipMonitoring, opts...).ToFunc()
  146. }
  147. // ByDescription orders the results by the description field.
  148. func ByDescription(opts ...sql.OrderTermOption) OrderOption {
  149. return sql.OrderByField(FieldDescription, opts...).ToFunc()
  150. }