bitbucket.org/Aishee/synsec@v0.0.0-20210414005726-236fc01a153d/pkg/database/ent/decision/where.go (about) 1 // Code generated by entc, DO NOT EDIT. 2 3 package decision 4 5 import ( 6 "time" 7 8 "entgo.io/ent/dialect/sql" 9 "entgo.io/ent/dialect/sql/sqlgraph" 10 "bitbucket.org/Aishee/synsec/pkg/database/ent/predicate" 11 ) 12 13 // ID filters vertices based on their ID field. 14 func ID(id int) predicate.Decision { 15 return predicate.Decision(func(s *sql.Selector) { 16 s.Where(sql.EQ(s.C(FieldID), id)) 17 }) 18 } 19 20 // IDEQ applies the EQ predicate on the ID field. 21 func IDEQ(id int) predicate.Decision { 22 return predicate.Decision(func(s *sql.Selector) { 23 s.Where(sql.EQ(s.C(FieldID), id)) 24 }) 25 } 26 27 // IDNEQ applies the NEQ predicate on the ID field. 28 func IDNEQ(id int) predicate.Decision { 29 return predicate.Decision(func(s *sql.Selector) { 30 s.Where(sql.NEQ(s.C(FieldID), id)) 31 }) 32 } 33 34 // IDIn applies the In predicate on the ID field. 35 func IDIn(ids ...int) predicate.Decision { 36 return predicate.Decision(func(s *sql.Selector) { 37 // if not arguments were provided, append the FALSE constants, 38 // since we can't apply "IN ()". This will make this predicate falsy. 39 if len(ids) == 0 { 40 s.Where(sql.False()) 41 return 42 } 43 v := make([]interface{}, len(ids)) 44 for i := range v { 45 v[i] = ids[i] 46 } 47 s.Where(sql.In(s.C(FieldID), v...)) 48 }) 49 } 50 51 // IDNotIn applies the NotIn predicate on the ID field. 52 func IDNotIn(ids ...int) predicate.Decision { 53 return predicate.Decision(func(s *sql.Selector) { 54 // if not arguments were provided, append the FALSE constants, 55 // since we can't apply "IN ()". This will make this predicate falsy. 56 if len(ids) == 0 { 57 s.Where(sql.False()) 58 return 59 } 60 v := make([]interface{}, len(ids)) 61 for i := range v { 62 v[i] = ids[i] 63 } 64 s.Where(sql.NotIn(s.C(FieldID), v...)) 65 }) 66 } 67 68 // IDGT applies the GT predicate on the ID field. 69 func IDGT(id int) predicate.Decision { 70 return predicate.Decision(func(s *sql.Selector) { 71 s.Where(sql.GT(s.C(FieldID), id)) 72 }) 73 } 74 75 // IDGTE applies the GTE predicate on the ID field. 76 func IDGTE(id int) predicate.Decision { 77 return predicate.Decision(func(s *sql.Selector) { 78 s.Where(sql.GTE(s.C(FieldID), id)) 79 }) 80 } 81 82 // IDLT applies the LT predicate on the ID field. 83 func IDLT(id int) predicate.Decision { 84 return predicate.Decision(func(s *sql.Selector) { 85 s.Where(sql.LT(s.C(FieldID), id)) 86 }) 87 } 88 89 // IDLTE applies the LTE predicate on the ID field. 90 func IDLTE(id int) predicate.Decision { 91 return predicate.Decision(func(s *sql.Selector) { 92 s.Where(sql.LTE(s.C(FieldID), id)) 93 }) 94 } 95 96 // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ. 97 func CreatedAt(v time.Time) predicate.Decision { 98 return predicate.Decision(func(s *sql.Selector) { 99 s.Where(sql.EQ(s.C(FieldCreatedAt), v)) 100 }) 101 } 102 103 // UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ. 104 func UpdatedAt(v time.Time) predicate.Decision { 105 return predicate.Decision(func(s *sql.Selector) { 106 s.Where(sql.EQ(s.C(FieldUpdatedAt), v)) 107 }) 108 } 109 110 // Until applies equality check predicate on the "until" field. It's identical to UntilEQ. 111 func Until(v time.Time) predicate.Decision { 112 return predicate.Decision(func(s *sql.Selector) { 113 s.Where(sql.EQ(s.C(FieldUntil), v)) 114 }) 115 } 116 117 // Scenario applies equality check predicate on the "scenario" field. It's identical to ScenarioEQ. 118 func Scenario(v string) predicate.Decision { 119 return predicate.Decision(func(s *sql.Selector) { 120 s.Where(sql.EQ(s.C(FieldScenario), v)) 121 }) 122 } 123 124 // Type applies equality check predicate on the "type" field. It's identical to TypeEQ. 125 func Type(v string) predicate.Decision { 126 return predicate.Decision(func(s *sql.Selector) { 127 s.Where(sql.EQ(s.C(FieldType), v)) 128 }) 129 } 130 131 // StartIP applies equality check predicate on the "start_ip" field. It's identical to StartIPEQ. 132 func StartIP(v int64) predicate.Decision { 133 return predicate.Decision(func(s *sql.Selector) { 134 s.Where(sql.EQ(s.C(FieldStartIP), v)) 135 }) 136 } 137 138 // EndIP applies equality check predicate on the "end_ip" field. It's identical to EndIPEQ. 139 func EndIP(v int64) predicate.Decision { 140 return predicate.Decision(func(s *sql.Selector) { 141 s.Where(sql.EQ(s.C(FieldEndIP), v)) 142 }) 143 } 144 145 // StartSuffix applies equality check predicate on the "start_suffix" field. It's identical to StartSuffixEQ. 146 func StartSuffix(v int64) predicate.Decision { 147 return predicate.Decision(func(s *sql.Selector) { 148 s.Where(sql.EQ(s.C(FieldStartSuffix), v)) 149 }) 150 } 151 152 // EndSuffix applies equality check predicate on the "end_suffix" field. It's identical to EndSuffixEQ. 153 func EndSuffix(v int64) predicate.Decision { 154 return predicate.Decision(func(s *sql.Selector) { 155 s.Where(sql.EQ(s.C(FieldEndSuffix), v)) 156 }) 157 } 158 159 // IPSize applies equality check predicate on the "ip_size" field. It's identical to IPSizeEQ. 160 func IPSize(v int64) predicate.Decision { 161 return predicate.Decision(func(s *sql.Selector) { 162 s.Where(sql.EQ(s.C(FieldIPSize), v)) 163 }) 164 } 165 166 // Scope applies equality check predicate on the "scope" field. It's identical to ScopeEQ. 167 func Scope(v string) predicate.Decision { 168 return predicate.Decision(func(s *sql.Selector) { 169 s.Where(sql.EQ(s.C(FieldScope), v)) 170 }) 171 } 172 173 // Value applies equality check predicate on the "value" field. It's identical to ValueEQ. 174 func Value(v string) predicate.Decision { 175 return predicate.Decision(func(s *sql.Selector) { 176 s.Where(sql.EQ(s.C(FieldValue), v)) 177 }) 178 } 179 180 // Origin applies equality check predicate on the "origin" field. It's identical to OriginEQ. 181 func Origin(v string) predicate.Decision { 182 return predicate.Decision(func(s *sql.Selector) { 183 s.Where(sql.EQ(s.C(FieldOrigin), v)) 184 }) 185 } 186 187 // Simulated applies equality check predicate on the "simulated" field. It's identical to SimulatedEQ. 188 func Simulated(v bool) predicate.Decision { 189 return predicate.Decision(func(s *sql.Selector) { 190 s.Where(sql.EQ(s.C(FieldSimulated), v)) 191 }) 192 } 193 194 // CreatedAtEQ applies the EQ predicate on the "created_at" field. 195 func CreatedAtEQ(v time.Time) predicate.Decision { 196 return predicate.Decision(func(s *sql.Selector) { 197 s.Where(sql.EQ(s.C(FieldCreatedAt), v)) 198 }) 199 } 200 201 // CreatedAtNEQ applies the NEQ predicate on the "created_at" field. 202 func CreatedAtNEQ(v time.Time) predicate.Decision { 203 return predicate.Decision(func(s *sql.Selector) { 204 s.Where(sql.NEQ(s.C(FieldCreatedAt), v)) 205 }) 206 } 207 208 // CreatedAtIn applies the In predicate on the "created_at" field. 209 func CreatedAtIn(vs ...time.Time) predicate.Decision { 210 v := make([]interface{}, len(vs)) 211 for i := range v { 212 v[i] = vs[i] 213 } 214 return predicate.Decision(func(s *sql.Selector) { 215 // if not arguments were provided, append the FALSE constants, 216 // since we can't apply "IN ()". This will make this predicate falsy. 217 if len(v) == 0 { 218 s.Where(sql.False()) 219 return 220 } 221 s.Where(sql.In(s.C(FieldCreatedAt), v...)) 222 }) 223 } 224 225 // CreatedAtNotIn applies the NotIn predicate on the "created_at" field. 226 func CreatedAtNotIn(vs ...time.Time) predicate.Decision { 227 v := make([]interface{}, len(vs)) 228 for i := range v { 229 v[i] = vs[i] 230 } 231 return predicate.Decision(func(s *sql.Selector) { 232 // if not arguments were provided, append the FALSE constants, 233 // since we can't apply "IN ()". This will make this predicate falsy. 234 if len(v) == 0 { 235 s.Where(sql.False()) 236 return 237 } 238 s.Where(sql.NotIn(s.C(FieldCreatedAt), v...)) 239 }) 240 } 241 242 // CreatedAtGT applies the GT predicate on the "created_at" field. 243 func CreatedAtGT(v time.Time) predicate.Decision { 244 return predicate.Decision(func(s *sql.Selector) { 245 s.Where(sql.GT(s.C(FieldCreatedAt), v)) 246 }) 247 } 248 249 // CreatedAtGTE applies the GTE predicate on the "created_at" field. 250 func CreatedAtGTE(v time.Time) predicate.Decision { 251 return predicate.Decision(func(s *sql.Selector) { 252 s.Where(sql.GTE(s.C(FieldCreatedAt), v)) 253 }) 254 } 255 256 // CreatedAtLT applies the LT predicate on the "created_at" field. 257 func CreatedAtLT(v time.Time) predicate.Decision { 258 return predicate.Decision(func(s *sql.Selector) { 259 s.Where(sql.LT(s.C(FieldCreatedAt), v)) 260 }) 261 } 262 263 // CreatedAtLTE applies the LTE predicate on the "created_at" field. 264 func CreatedAtLTE(v time.Time) predicate.Decision { 265 return predicate.Decision(func(s *sql.Selector) { 266 s.Where(sql.LTE(s.C(FieldCreatedAt), v)) 267 }) 268 } 269 270 // UpdatedAtEQ applies the EQ predicate on the "updated_at" field. 271 func UpdatedAtEQ(v time.Time) predicate.Decision { 272 return predicate.Decision(func(s *sql.Selector) { 273 s.Where(sql.EQ(s.C(FieldUpdatedAt), v)) 274 }) 275 } 276 277 // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field. 278 func UpdatedAtNEQ(v time.Time) predicate.Decision { 279 return predicate.Decision(func(s *sql.Selector) { 280 s.Where(sql.NEQ(s.C(FieldUpdatedAt), v)) 281 }) 282 } 283 284 // UpdatedAtIn applies the In predicate on the "updated_at" field. 285 func UpdatedAtIn(vs ...time.Time) predicate.Decision { 286 v := make([]interface{}, len(vs)) 287 for i := range v { 288 v[i] = vs[i] 289 } 290 return predicate.Decision(func(s *sql.Selector) { 291 // if not arguments were provided, append the FALSE constants, 292 // since we can't apply "IN ()". This will make this predicate falsy. 293 if len(v) == 0 { 294 s.Where(sql.False()) 295 return 296 } 297 s.Where(sql.In(s.C(FieldUpdatedAt), v...)) 298 }) 299 } 300 301 // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field. 302 func UpdatedAtNotIn(vs ...time.Time) predicate.Decision { 303 v := make([]interface{}, len(vs)) 304 for i := range v { 305 v[i] = vs[i] 306 } 307 return predicate.Decision(func(s *sql.Selector) { 308 // if not arguments were provided, append the FALSE constants, 309 // since we can't apply "IN ()". This will make this predicate falsy. 310 if len(v) == 0 { 311 s.Where(sql.False()) 312 return 313 } 314 s.Where(sql.NotIn(s.C(FieldUpdatedAt), v...)) 315 }) 316 } 317 318 // UpdatedAtGT applies the GT predicate on the "updated_at" field. 319 func UpdatedAtGT(v time.Time) predicate.Decision { 320 return predicate.Decision(func(s *sql.Selector) { 321 s.Where(sql.GT(s.C(FieldUpdatedAt), v)) 322 }) 323 } 324 325 // UpdatedAtGTE applies the GTE predicate on the "updated_at" field. 326 func UpdatedAtGTE(v time.Time) predicate.Decision { 327 return predicate.Decision(func(s *sql.Selector) { 328 s.Where(sql.GTE(s.C(FieldUpdatedAt), v)) 329 }) 330 } 331 332 // UpdatedAtLT applies the LT predicate on the "updated_at" field. 333 func UpdatedAtLT(v time.Time) predicate.Decision { 334 return predicate.Decision(func(s *sql.Selector) { 335 s.Where(sql.LT(s.C(FieldUpdatedAt), v)) 336 }) 337 } 338 339 // UpdatedAtLTE applies the LTE predicate on the "updated_at" field. 340 func UpdatedAtLTE(v time.Time) predicate.Decision { 341 return predicate.Decision(func(s *sql.Selector) { 342 s.Where(sql.LTE(s.C(FieldUpdatedAt), v)) 343 }) 344 } 345 346 // UntilEQ applies the EQ predicate on the "until" field. 347 func UntilEQ(v time.Time) predicate.Decision { 348 return predicate.Decision(func(s *sql.Selector) { 349 s.Where(sql.EQ(s.C(FieldUntil), v)) 350 }) 351 } 352 353 // UntilNEQ applies the NEQ predicate on the "until" field. 354 func UntilNEQ(v time.Time) predicate.Decision { 355 return predicate.Decision(func(s *sql.Selector) { 356 s.Where(sql.NEQ(s.C(FieldUntil), v)) 357 }) 358 } 359 360 // UntilIn applies the In predicate on the "until" field. 361 func UntilIn(vs ...time.Time) predicate.Decision { 362 v := make([]interface{}, len(vs)) 363 for i := range v { 364 v[i] = vs[i] 365 } 366 return predicate.Decision(func(s *sql.Selector) { 367 // if not arguments were provided, append the FALSE constants, 368 // since we can't apply "IN ()". This will make this predicate falsy. 369 if len(v) == 0 { 370 s.Where(sql.False()) 371 return 372 } 373 s.Where(sql.In(s.C(FieldUntil), v...)) 374 }) 375 } 376 377 // UntilNotIn applies the NotIn predicate on the "until" field. 378 func UntilNotIn(vs ...time.Time) predicate.Decision { 379 v := make([]interface{}, len(vs)) 380 for i := range v { 381 v[i] = vs[i] 382 } 383 return predicate.Decision(func(s *sql.Selector) { 384 // if not arguments were provided, append the FALSE constants, 385 // since we can't apply "IN ()". This will make this predicate falsy. 386 if len(v) == 0 { 387 s.Where(sql.False()) 388 return 389 } 390 s.Where(sql.NotIn(s.C(FieldUntil), v...)) 391 }) 392 } 393 394 // UntilGT applies the GT predicate on the "until" field. 395 func UntilGT(v time.Time) predicate.Decision { 396 return predicate.Decision(func(s *sql.Selector) { 397 s.Where(sql.GT(s.C(FieldUntil), v)) 398 }) 399 } 400 401 // UntilGTE applies the GTE predicate on the "until" field. 402 func UntilGTE(v time.Time) predicate.Decision { 403 return predicate.Decision(func(s *sql.Selector) { 404 s.Where(sql.GTE(s.C(FieldUntil), v)) 405 }) 406 } 407 408 // UntilLT applies the LT predicate on the "until" field. 409 func UntilLT(v time.Time) predicate.Decision { 410 return predicate.Decision(func(s *sql.Selector) { 411 s.Where(sql.LT(s.C(FieldUntil), v)) 412 }) 413 } 414 415 // UntilLTE applies the LTE predicate on the "until" field. 416 func UntilLTE(v time.Time) predicate.Decision { 417 return predicate.Decision(func(s *sql.Selector) { 418 s.Where(sql.LTE(s.C(FieldUntil), v)) 419 }) 420 } 421 422 // ScenarioEQ applies the EQ predicate on the "scenario" field. 423 func ScenarioEQ(v string) predicate.Decision { 424 return predicate.Decision(func(s *sql.Selector) { 425 s.Where(sql.EQ(s.C(FieldScenario), v)) 426 }) 427 } 428 429 // ScenarioNEQ applies the NEQ predicate on the "scenario" field. 430 func ScenarioNEQ(v string) predicate.Decision { 431 return predicate.Decision(func(s *sql.Selector) { 432 s.Where(sql.NEQ(s.C(FieldScenario), v)) 433 }) 434 } 435 436 // ScenarioIn applies the In predicate on the "scenario" field. 437 func ScenarioIn(vs ...string) predicate.Decision { 438 v := make([]interface{}, len(vs)) 439 for i := range v { 440 v[i] = vs[i] 441 } 442 return predicate.Decision(func(s *sql.Selector) { 443 // if not arguments were provided, append the FALSE constants, 444 // since we can't apply "IN ()". This will make this predicate falsy. 445 if len(v) == 0 { 446 s.Where(sql.False()) 447 return 448 } 449 s.Where(sql.In(s.C(FieldScenario), v...)) 450 }) 451 } 452 453 // ScenarioNotIn applies the NotIn predicate on the "scenario" field. 454 func ScenarioNotIn(vs ...string) predicate.Decision { 455 v := make([]interface{}, len(vs)) 456 for i := range v { 457 v[i] = vs[i] 458 } 459 return predicate.Decision(func(s *sql.Selector) { 460 // if not arguments were provided, append the FALSE constants, 461 // since we can't apply "IN ()". This will make this predicate falsy. 462 if len(v) == 0 { 463 s.Where(sql.False()) 464 return 465 } 466 s.Where(sql.NotIn(s.C(FieldScenario), v...)) 467 }) 468 } 469 470 // ScenarioGT applies the GT predicate on the "scenario" field. 471 func ScenarioGT(v string) predicate.Decision { 472 return predicate.Decision(func(s *sql.Selector) { 473 s.Where(sql.GT(s.C(FieldScenario), v)) 474 }) 475 } 476 477 // ScenarioGTE applies the GTE predicate on the "scenario" field. 478 func ScenarioGTE(v string) predicate.Decision { 479 return predicate.Decision(func(s *sql.Selector) { 480 s.Where(sql.GTE(s.C(FieldScenario), v)) 481 }) 482 } 483 484 // ScenarioLT applies the LT predicate on the "scenario" field. 485 func ScenarioLT(v string) predicate.Decision { 486 return predicate.Decision(func(s *sql.Selector) { 487 s.Where(sql.LT(s.C(FieldScenario), v)) 488 }) 489 } 490 491 // ScenarioLTE applies the LTE predicate on the "scenario" field. 492 func ScenarioLTE(v string) predicate.Decision { 493 return predicate.Decision(func(s *sql.Selector) { 494 s.Where(sql.LTE(s.C(FieldScenario), v)) 495 }) 496 } 497 498 // ScenarioContains applies the Contains predicate on the "scenario" field. 499 func ScenarioContains(v string) predicate.Decision { 500 return predicate.Decision(func(s *sql.Selector) { 501 s.Where(sql.Contains(s.C(FieldScenario), v)) 502 }) 503 } 504 505 // ScenarioHasPrefix applies the HasPrefix predicate on the "scenario" field. 506 func ScenarioHasPrefix(v string) predicate.Decision { 507 return predicate.Decision(func(s *sql.Selector) { 508 s.Where(sql.HasPrefix(s.C(FieldScenario), v)) 509 }) 510 } 511 512 // ScenarioHasSuffix applies the HasSuffix predicate on the "scenario" field. 513 func ScenarioHasSuffix(v string) predicate.Decision { 514 return predicate.Decision(func(s *sql.Selector) { 515 s.Where(sql.HasSuffix(s.C(FieldScenario), v)) 516 }) 517 } 518 519 // ScenarioEqualFold applies the EqualFold predicate on the "scenario" field. 520 func ScenarioEqualFold(v string) predicate.Decision { 521 return predicate.Decision(func(s *sql.Selector) { 522 s.Where(sql.EqualFold(s.C(FieldScenario), v)) 523 }) 524 } 525 526 // ScenarioContainsFold applies the ContainsFold predicate on the "scenario" field. 527 func ScenarioContainsFold(v string) predicate.Decision { 528 return predicate.Decision(func(s *sql.Selector) { 529 s.Where(sql.ContainsFold(s.C(FieldScenario), v)) 530 }) 531 } 532 533 // TypeEQ applies the EQ predicate on the "type" field. 534 func TypeEQ(v string) predicate.Decision { 535 return predicate.Decision(func(s *sql.Selector) { 536 s.Where(sql.EQ(s.C(FieldType), v)) 537 }) 538 } 539 540 // TypeNEQ applies the NEQ predicate on the "type" field. 541 func TypeNEQ(v string) predicate.Decision { 542 return predicate.Decision(func(s *sql.Selector) { 543 s.Where(sql.NEQ(s.C(FieldType), v)) 544 }) 545 } 546 547 // TypeIn applies the In predicate on the "type" field. 548 func TypeIn(vs ...string) predicate.Decision { 549 v := make([]interface{}, len(vs)) 550 for i := range v { 551 v[i] = vs[i] 552 } 553 return predicate.Decision(func(s *sql.Selector) { 554 // if not arguments were provided, append the FALSE constants, 555 // since we can't apply "IN ()". This will make this predicate falsy. 556 if len(v) == 0 { 557 s.Where(sql.False()) 558 return 559 } 560 s.Where(sql.In(s.C(FieldType), v...)) 561 }) 562 } 563 564 // TypeNotIn applies the NotIn predicate on the "type" field. 565 func TypeNotIn(vs ...string) predicate.Decision { 566 v := make([]interface{}, len(vs)) 567 for i := range v { 568 v[i] = vs[i] 569 } 570 return predicate.Decision(func(s *sql.Selector) { 571 // if not arguments were provided, append the FALSE constants, 572 // since we can't apply "IN ()". This will make this predicate falsy. 573 if len(v) == 0 { 574 s.Where(sql.False()) 575 return 576 } 577 s.Where(sql.NotIn(s.C(FieldType), v...)) 578 }) 579 } 580 581 // TypeGT applies the GT predicate on the "type" field. 582 func TypeGT(v string) predicate.Decision { 583 return predicate.Decision(func(s *sql.Selector) { 584 s.Where(sql.GT(s.C(FieldType), v)) 585 }) 586 } 587 588 // TypeGTE applies the GTE predicate on the "type" field. 589 func TypeGTE(v string) predicate.Decision { 590 return predicate.Decision(func(s *sql.Selector) { 591 s.Where(sql.GTE(s.C(FieldType), v)) 592 }) 593 } 594 595 // TypeLT applies the LT predicate on the "type" field. 596 func TypeLT(v string) predicate.Decision { 597 return predicate.Decision(func(s *sql.Selector) { 598 s.Where(sql.LT(s.C(FieldType), v)) 599 }) 600 } 601 602 // TypeLTE applies the LTE predicate on the "type" field. 603 func TypeLTE(v string) predicate.Decision { 604 return predicate.Decision(func(s *sql.Selector) { 605 s.Where(sql.LTE(s.C(FieldType), v)) 606 }) 607 } 608 609 // TypeContains applies the Contains predicate on the "type" field. 610 func TypeContains(v string) predicate.Decision { 611 return predicate.Decision(func(s *sql.Selector) { 612 s.Where(sql.Contains(s.C(FieldType), v)) 613 }) 614 } 615 616 // TypeHasPrefix applies the HasPrefix predicate on the "type" field. 617 func TypeHasPrefix(v string) predicate.Decision { 618 return predicate.Decision(func(s *sql.Selector) { 619 s.Where(sql.HasPrefix(s.C(FieldType), v)) 620 }) 621 } 622 623 // TypeHasSuffix applies the HasSuffix predicate on the "type" field. 624 func TypeHasSuffix(v string) predicate.Decision { 625 return predicate.Decision(func(s *sql.Selector) { 626 s.Where(sql.HasSuffix(s.C(FieldType), v)) 627 }) 628 } 629 630 // TypeEqualFold applies the EqualFold predicate on the "type" field. 631 func TypeEqualFold(v string) predicate.Decision { 632 return predicate.Decision(func(s *sql.Selector) { 633 s.Where(sql.EqualFold(s.C(FieldType), v)) 634 }) 635 } 636 637 // TypeContainsFold applies the ContainsFold predicate on the "type" field. 638 func TypeContainsFold(v string) predicate.Decision { 639 return predicate.Decision(func(s *sql.Selector) { 640 s.Where(sql.ContainsFold(s.C(FieldType), v)) 641 }) 642 } 643 644 // StartIPEQ applies the EQ predicate on the "start_ip" field. 645 func StartIPEQ(v int64) predicate.Decision { 646 return predicate.Decision(func(s *sql.Selector) { 647 s.Where(sql.EQ(s.C(FieldStartIP), v)) 648 }) 649 } 650 651 // StartIPNEQ applies the NEQ predicate on the "start_ip" field. 652 func StartIPNEQ(v int64) predicate.Decision { 653 return predicate.Decision(func(s *sql.Selector) { 654 s.Where(sql.NEQ(s.C(FieldStartIP), v)) 655 }) 656 } 657 658 // StartIPIn applies the In predicate on the "start_ip" field. 659 func StartIPIn(vs ...int64) predicate.Decision { 660 v := make([]interface{}, len(vs)) 661 for i := range v { 662 v[i] = vs[i] 663 } 664 return predicate.Decision(func(s *sql.Selector) { 665 // if not arguments were provided, append the FALSE constants, 666 // since we can't apply "IN ()". This will make this predicate falsy. 667 if len(v) == 0 { 668 s.Where(sql.False()) 669 return 670 } 671 s.Where(sql.In(s.C(FieldStartIP), v...)) 672 }) 673 } 674 675 // StartIPNotIn applies the NotIn predicate on the "start_ip" field. 676 func StartIPNotIn(vs ...int64) predicate.Decision { 677 v := make([]interface{}, len(vs)) 678 for i := range v { 679 v[i] = vs[i] 680 } 681 return predicate.Decision(func(s *sql.Selector) { 682 // if not arguments were provided, append the FALSE constants, 683 // since we can't apply "IN ()". This will make this predicate falsy. 684 if len(v) == 0 { 685 s.Where(sql.False()) 686 return 687 } 688 s.Where(sql.NotIn(s.C(FieldStartIP), v...)) 689 }) 690 } 691 692 // StartIPGT applies the GT predicate on the "start_ip" field. 693 func StartIPGT(v int64) predicate.Decision { 694 return predicate.Decision(func(s *sql.Selector) { 695 s.Where(sql.GT(s.C(FieldStartIP), v)) 696 }) 697 } 698 699 // StartIPGTE applies the GTE predicate on the "start_ip" field. 700 func StartIPGTE(v int64) predicate.Decision { 701 return predicate.Decision(func(s *sql.Selector) { 702 s.Where(sql.GTE(s.C(FieldStartIP), v)) 703 }) 704 } 705 706 // StartIPLT applies the LT predicate on the "start_ip" field. 707 func StartIPLT(v int64) predicate.Decision { 708 return predicate.Decision(func(s *sql.Selector) { 709 s.Where(sql.LT(s.C(FieldStartIP), v)) 710 }) 711 } 712 713 // StartIPLTE applies the LTE predicate on the "start_ip" field. 714 func StartIPLTE(v int64) predicate.Decision { 715 return predicate.Decision(func(s *sql.Selector) { 716 s.Where(sql.LTE(s.C(FieldStartIP), v)) 717 }) 718 } 719 720 // StartIPIsNil applies the IsNil predicate on the "start_ip" field. 721 func StartIPIsNil() predicate.Decision { 722 return predicate.Decision(func(s *sql.Selector) { 723 s.Where(sql.IsNull(s.C(FieldStartIP))) 724 }) 725 } 726 727 // StartIPNotNil applies the NotNil predicate on the "start_ip" field. 728 func StartIPNotNil() predicate.Decision { 729 return predicate.Decision(func(s *sql.Selector) { 730 s.Where(sql.NotNull(s.C(FieldStartIP))) 731 }) 732 } 733 734 // EndIPEQ applies the EQ predicate on the "end_ip" field. 735 func EndIPEQ(v int64) predicate.Decision { 736 return predicate.Decision(func(s *sql.Selector) { 737 s.Where(sql.EQ(s.C(FieldEndIP), v)) 738 }) 739 } 740 741 // EndIPNEQ applies the NEQ predicate on the "end_ip" field. 742 func EndIPNEQ(v int64) predicate.Decision { 743 return predicate.Decision(func(s *sql.Selector) { 744 s.Where(sql.NEQ(s.C(FieldEndIP), v)) 745 }) 746 } 747 748 // EndIPIn applies the In predicate on the "end_ip" field. 749 func EndIPIn(vs ...int64) predicate.Decision { 750 v := make([]interface{}, len(vs)) 751 for i := range v { 752 v[i] = vs[i] 753 } 754 return predicate.Decision(func(s *sql.Selector) { 755 // if not arguments were provided, append the FALSE constants, 756 // since we can't apply "IN ()". This will make this predicate falsy. 757 if len(v) == 0 { 758 s.Where(sql.False()) 759 return 760 } 761 s.Where(sql.In(s.C(FieldEndIP), v...)) 762 }) 763 } 764 765 // EndIPNotIn applies the NotIn predicate on the "end_ip" field. 766 func EndIPNotIn(vs ...int64) predicate.Decision { 767 v := make([]interface{}, len(vs)) 768 for i := range v { 769 v[i] = vs[i] 770 } 771 return predicate.Decision(func(s *sql.Selector) { 772 // if not arguments were provided, append the FALSE constants, 773 // since we can't apply "IN ()". This will make this predicate falsy. 774 if len(v) == 0 { 775 s.Where(sql.False()) 776 return 777 } 778 s.Where(sql.NotIn(s.C(FieldEndIP), v...)) 779 }) 780 } 781 782 // EndIPGT applies the GT predicate on the "end_ip" field. 783 func EndIPGT(v int64) predicate.Decision { 784 return predicate.Decision(func(s *sql.Selector) { 785 s.Where(sql.GT(s.C(FieldEndIP), v)) 786 }) 787 } 788 789 // EndIPGTE applies the GTE predicate on the "end_ip" field. 790 func EndIPGTE(v int64) predicate.Decision { 791 return predicate.Decision(func(s *sql.Selector) { 792 s.Where(sql.GTE(s.C(FieldEndIP), v)) 793 }) 794 } 795 796 // EndIPLT applies the LT predicate on the "end_ip" field. 797 func EndIPLT(v int64) predicate.Decision { 798 return predicate.Decision(func(s *sql.Selector) { 799 s.Where(sql.LT(s.C(FieldEndIP), v)) 800 }) 801 } 802 803 // EndIPLTE applies the LTE predicate on the "end_ip" field. 804 func EndIPLTE(v int64) predicate.Decision { 805 return predicate.Decision(func(s *sql.Selector) { 806 s.Where(sql.LTE(s.C(FieldEndIP), v)) 807 }) 808 } 809 810 // EndIPIsNil applies the IsNil predicate on the "end_ip" field. 811 func EndIPIsNil() predicate.Decision { 812 return predicate.Decision(func(s *sql.Selector) { 813 s.Where(sql.IsNull(s.C(FieldEndIP))) 814 }) 815 } 816 817 // EndIPNotNil applies the NotNil predicate on the "end_ip" field. 818 func EndIPNotNil() predicate.Decision { 819 return predicate.Decision(func(s *sql.Selector) { 820 s.Where(sql.NotNull(s.C(FieldEndIP))) 821 }) 822 } 823 824 // StartSuffixEQ applies the EQ predicate on the "start_suffix" field. 825 func StartSuffixEQ(v int64) predicate.Decision { 826 return predicate.Decision(func(s *sql.Selector) { 827 s.Where(sql.EQ(s.C(FieldStartSuffix), v)) 828 }) 829 } 830 831 // StartSuffixNEQ applies the NEQ predicate on the "start_suffix" field. 832 func StartSuffixNEQ(v int64) predicate.Decision { 833 return predicate.Decision(func(s *sql.Selector) { 834 s.Where(sql.NEQ(s.C(FieldStartSuffix), v)) 835 }) 836 } 837 838 // StartSuffixIn applies the In predicate on the "start_suffix" field. 839 func StartSuffixIn(vs ...int64) predicate.Decision { 840 v := make([]interface{}, len(vs)) 841 for i := range v { 842 v[i] = vs[i] 843 } 844 return predicate.Decision(func(s *sql.Selector) { 845 // if not arguments were provided, append the FALSE constants, 846 // since we can't apply "IN ()". This will make this predicate falsy. 847 if len(v) == 0 { 848 s.Where(sql.False()) 849 return 850 } 851 s.Where(sql.In(s.C(FieldStartSuffix), v...)) 852 }) 853 } 854 855 // StartSuffixNotIn applies the NotIn predicate on the "start_suffix" field. 856 func StartSuffixNotIn(vs ...int64) predicate.Decision { 857 v := make([]interface{}, len(vs)) 858 for i := range v { 859 v[i] = vs[i] 860 } 861 return predicate.Decision(func(s *sql.Selector) { 862 // if not arguments were provided, append the FALSE constants, 863 // since we can't apply "IN ()". This will make this predicate falsy. 864 if len(v) == 0 { 865 s.Where(sql.False()) 866 return 867 } 868 s.Where(sql.NotIn(s.C(FieldStartSuffix), v...)) 869 }) 870 } 871 872 // StartSuffixGT applies the GT predicate on the "start_suffix" field. 873 func StartSuffixGT(v int64) predicate.Decision { 874 return predicate.Decision(func(s *sql.Selector) { 875 s.Where(sql.GT(s.C(FieldStartSuffix), v)) 876 }) 877 } 878 879 // StartSuffixGTE applies the GTE predicate on the "start_suffix" field. 880 func StartSuffixGTE(v int64) predicate.Decision { 881 return predicate.Decision(func(s *sql.Selector) { 882 s.Where(sql.GTE(s.C(FieldStartSuffix), v)) 883 }) 884 } 885 886 // StartSuffixLT applies the LT predicate on the "start_suffix" field. 887 func StartSuffixLT(v int64) predicate.Decision { 888 return predicate.Decision(func(s *sql.Selector) { 889 s.Where(sql.LT(s.C(FieldStartSuffix), v)) 890 }) 891 } 892 893 // StartSuffixLTE applies the LTE predicate on the "start_suffix" field. 894 func StartSuffixLTE(v int64) predicate.Decision { 895 return predicate.Decision(func(s *sql.Selector) { 896 s.Where(sql.LTE(s.C(FieldStartSuffix), v)) 897 }) 898 } 899 900 // StartSuffixIsNil applies the IsNil predicate on the "start_suffix" field. 901 func StartSuffixIsNil() predicate.Decision { 902 return predicate.Decision(func(s *sql.Selector) { 903 s.Where(sql.IsNull(s.C(FieldStartSuffix))) 904 }) 905 } 906 907 // StartSuffixNotNil applies the NotNil predicate on the "start_suffix" field. 908 func StartSuffixNotNil() predicate.Decision { 909 return predicate.Decision(func(s *sql.Selector) { 910 s.Where(sql.NotNull(s.C(FieldStartSuffix))) 911 }) 912 } 913 914 // EndSuffixEQ applies the EQ predicate on the "end_suffix" field. 915 func EndSuffixEQ(v int64) predicate.Decision { 916 return predicate.Decision(func(s *sql.Selector) { 917 s.Where(sql.EQ(s.C(FieldEndSuffix), v)) 918 }) 919 } 920 921 // EndSuffixNEQ applies the NEQ predicate on the "end_suffix" field. 922 func EndSuffixNEQ(v int64) predicate.Decision { 923 return predicate.Decision(func(s *sql.Selector) { 924 s.Where(sql.NEQ(s.C(FieldEndSuffix), v)) 925 }) 926 } 927 928 // EndSuffixIn applies the In predicate on the "end_suffix" field. 929 func EndSuffixIn(vs ...int64) predicate.Decision { 930 v := make([]interface{}, len(vs)) 931 for i := range v { 932 v[i] = vs[i] 933 } 934 return predicate.Decision(func(s *sql.Selector) { 935 // if not arguments were provided, append the FALSE constants, 936 // since we can't apply "IN ()". This will make this predicate falsy. 937 if len(v) == 0 { 938 s.Where(sql.False()) 939 return 940 } 941 s.Where(sql.In(s.C(FieldEndSuffix), v...)) 942 }) 943 } 944 945 // EndSuffixNotIn applies the NotIn predicate on the "end_suffix" field. 946 func EndSuffixNotIn(vs ...int64) predicate.Decision { 947 v := make([]interface{}, len(vs)) 948 for i := range v { 949 v[i] = vs[i] 950 } 951 return predicate.Decision(func(s *sql.Selector) { 952 // if not arguments were provided, append the FALSE constants, 953 // since we can't apply "IN ()". This will make this predicate falsy. 954 if len(v) == 0 { 955 s.Where(sql.False()) 956 return 957 } 958 s.Where(sql.NotIn(s.C(FieldEndSuffix), v...)) 959 }) 960 } 961 962 // EndSuffixGT applies the GT predicate on the "end_suffix" field. 963 func EndSuffixGT(v int64) predicate.Decision { 964 return predicate.Decision(func(s *sql.Selector) { 965 s.Where(sql.GT(s.C(FieldEndSuffix), v)) 966 }) 967 } 968 969 // EndSuffixGTE applies the GTE predicate on the "end_suffix" field. 970 func EndSuffixGTE(v int64) predicate.Decision { 971 return predicate.Decision(func(s *sql.Selector) { 972 s.Where(sql.GTE(s.C(FieldEndSuffix), v)) 973 }) 974 } 975 976 // EndSuffixLT applies the LT predicate on the "end_suffix" field. 977 func EndSuffixLT(v int64) predicate.Decision { 978 return predicate.Decision(func(s *sql.Selector) { 979 s.Where(sql.LT(s.C(FieldEndSuffix), v)) 980 }) 981 } 982 983 // EndSuffixLTE applies the LTE predicate on the "end_suffix" field. 984 func EndSuffixLTE(v int64) predicate.Decision { 985 return predicate.Decision(func(s *sql.Selector) { 986 s.Where(sql.LTE(s.C(FieldEndSuffix), v)) 987 }) 988 } 989 990 // EndSuffixIsNil applies the IsNil predicate on the "end_suffix" field. 991 func EndSuffixIsNil() predicate.Decision { 992 return predicate.Decision(func(s *sql.Selector) { 993 s.Where(sql.IsNull(s.C(FieldEndSuffix))) 994 }) 995 } 996 997 // EndSuffixNotNil applies the NotNil predicate on the "end_suffix" field. 998 func EndSuffixNotNil() predicate.Decision { 999 return predicate.Decision(func(s *sql.Selector) { 1000 s.Where(sql.NotNull(s.C(FieldEndSuffix))) 1001 }) 1002 } 1003 1004 // IPSizeEQ applies the EQ predicate on the "ip_size" field. 1005 func IPSizeEQ(v int64) predicate.Decision { 1006 return predicate.Decision(func(s *sql.Selector) { 1007 s.Where(sql.EQ(s.C(FieldIPSize), v)) 1008 }) 1009 } 1010 1011 // IPSizeNEQ applies the NEQ predicate on the "ip_size" field. 1012 func IPSizeNEQ(v int64) predicate.Decision { 1013 return predicate.Decision(func(s *sql.Selector) { 1014 s.Where(sql.NEQ(s.C(FieldIPSize), v)) 1015 }) 1016 } 1017 1018 // IPSizeIn applies the In predicate on the "ip_size" field. 1019 func IPSizeIn(vs ...int64) predicate.Decision { 1020 v := make([]interface{}, len(vs)) 1021 for i := range v { 1022 v[i] = vs[i] 1023 } 1024 return predicate.Decision(func(s *sql.Selector) { 1025 // if not arguments were provided, append the FALSE constants, 1026 // since we can't apply "IN ()". This will make this predicate falsy. 1027 if len(v) == 0 { 1028 s.Where(sql.False()) 1029 return 1030 } 1031 s.Where(sql.In(s.C(FieldIPSize), v...)) 1032 }) 1033 } 1034 1035 // IPSizeNotIn applies the NotIn predicate on the "ip_size" field. 1036 func IPSizeNotIn(vs ...int64) predicate.Decision { 1037 v := make([]interface{}, len(vs)) 1038 for i := range v { 1039 v[i] = vs[i] 1040 } 1041 return predicate.Decision(func(s *sql.Selector) { 1042 // if not arguments were provided, append the FALSE constants, 1043 // since we can't apply "IN ()". This will make this predicate falsy. 1044 if len(v) == 0 { 1045 s.Where(sql.False()) 1046 return 1047 } 1048 s.Where(sql.NotIn(s.C(FieldIPSize), v...)) 1049 }) 1050 } 1051 1052 // IPSizeGT applies the GT predicate on the "ip_size" field. 1053 func IPSizeGT(v int64) predicate.Decision { 1054 return predicate.Decision(func(s *sql.Selector) { 1055 s.Where(sql.GT(s.C(FieldIPSize), v)) 1056 }) 1057 } 1058 1059 // IPSizeGTE applies the GTE predicate on the "ip_size" field. 1060 func IPSizeGTE(v int64) predicate.Decision { 1061 return predicate.Decision(func(s *sql.Selector) { 1062 s.Where(sql.GTE(s.C(FieldIPSize), v)) 1063 }) 1064 } 1065 1066 // IPSizeLT applies the LT predicate on the "ip_size" field. 1067 func IPSizeLT(v int64) predicate.Decision { 1068 return predicate.Decision(func(s *sql.Selector) { 1069 s.Where(sql.LT(s.C(FieldIPSize), v)) 1070 }) 1071 } 1072 1073 // IPSizeLTE applies the LTE predicate on the "ip_size" field. 1074 func IPSizeLTE(v int64) predicate.Decision { 1075 return predicate.Decision(func(s *sql.Selector) { 1076 s.Where(sql.LTE(s.C(FieldIPSize), v)) 1077 }) 1078 } 1079 1080 // IPSizeIsNil applies the IsNil predicate on the "ip_size" field. 1081 func IPSizeIsNil() predicate.Decision { 1082 return predicate.Decision(func(s *sql.Selector) { 1083 s.Where(sql.IsNull(s.C(FieldIPSize))) 1084 }) 1085 } 1086 1087 // IPSizeNotNil applies the NotNil predicate on the "ip_size" field. 1088 func IPSizeNotNil() predicate.Decision { 1089 return predicate.Decision(func(s *sql.Selector) { 1090 s.Where(sql.NotNull(s.C(FieldIPSize))) 1091 }) 1092 } 1093 1094 // ScopeEQ applies the EQ predicate on the "scope" field. 1095 func ScopeEQ(v string) predicate.Decision { 1096 return predicate.Decision(func(s *sql.Selector) { 1097 s.Where(sql.EQ(s.C(FieldScope), v)) 1098 }) 1099 } 1100 1101 // ScopeNEQ applies the NEQ predicate on the "scope" field. 1102 func ScopeNEQ(v string) predicate.Decision { 1103 return predicate.Decision(func(s *sql.Selector) { 1104 s.Where(sql.NEQ(s.C(FieldScope), v)) 1105 }) 1106 } 1107 1108 // ScopeIn applies the In predicate on the "scope" field. 1109 func ScopeIn(vs ...string) predicate.Decision { 1110 v := make([]interface{}, len(vs)) 1111 for i := range v { 1112 v[i] = vs[i] 1113 } 1114 return predicate.Decision(func(s *sql.Selector) { 1115 // if not arguments were provided, append the FALSE constants, 1116 // since we can't apply "IN ()". This will make this predicate falsy. 1117 if len(v) == 0 { 1118 s.Where(sql.False()) 1119 return 1120 } 1121 s.Where(sql.In(s.C(FieldScope), v...)) 1122 }) 1123 } 1124 1125 // ScopeNotIn applies the NotIn predicate on the "scope" field. 1126 func ScopeNotIn(vs ...string) predicate.Decision { 1127 v := make([]interface{}, len(vs)) 1128 for i := range v { 1129 v[i] = vs[i] 1130 } 1131 return predicate.Decision(func(s *sql.Selector) { 1132 // if not arguments were provided, append the FALSE constants, 1133 // since we can't apply "IN ()". This will make this predicate falsy. 1134 if len(v) == 0 { 1135 s.Where(sql.False()) 1136 return 1137 } 1138 s.Where(sql.NotIn(s.C(FieldScope), v...)) 1139 }) 1140 } 1141 1142 // ScopeGT applies the GT predicate on the "scope" field. 1143 func ScopeGT(v string) predicate.Decision { 1144 return predicate.Decision(func(s *sql.Selector) { 1145 s.Where(sql.GT(s.C(FieldScope), v)) 1146 }) 1147 } 1148 1149 // ScopeGTE applies the GTE predicate on the "scope" field. 1150 func ScopeGTE(v string) predicate.Decision { 1151 return predicate.Decision(func(s *sql.Selector) { 1152 s.Where(sql.GTE(s.C(FieldScope), v)) 1153 }) 1154 } 1155 1156 // ScopeLT applies the LT predicate on the "scope" field. 1157 func ScopeLT(v string) predicate.Decision { 1158 return predicate.Decision(func(s *sql.Selector) { 1159 s.Where(sql.LT(s.C(FieldScope), v)) 1160 }) 1161 } 1162 1163 // ScopeLTE applies the LTE predicate on the "scope" field. 1164 func ScopeLTE(v string) predicate.Decision { 1165 return predicate.Decision(func(s *sql.Selector) { 1166 s.Where(sql.LTE(s.C(FieldScope), v)) 1167 }) 1168 } 1169 1170 // ScopeContains applies the Contains predicate on the "scope" field. 1171 func ScopeContains(v string) predicate.Decision { 1172 return predicate.Decision(func(s *sql.Selector) { 1173 s.Where(sql.Contains(s.C(FieldScope), v)) 1174 }) 1175 } 1176 1177 // ScopeHasPrefix applies the HasPrefix predicate on the "scope" field. 1178 func ScopeHasPrefix(v string) predicate.Decision { 1179 return predicate.Decision(func(s *sql.Selector) { 1180 s.Where(sql.HasPrefix(s.C(FieldScope), v)) 1181 }) 1182 } 1183 1184 // ScopeHasSuffix applies the HasSuffix predicate on the "scope" field. 1185 func ScopeHasSuffix(v string) predicate.Decision { 1186 return predicate.Decision(func(s *sql.Selector) { 1187 s.Where(sql.HasSuffix(s.C(FieldScope), v)) 1188 }) 1189 } 1190 1191 // ScopeEqualFold applies the EqualFold predicate on the "scope" field. 1192 func ScopeEqualFold(v string) predicate.Decision { 1193 return predicate.Decision(func(s *sql.Selector) { 1194 s.Where(sql.EqualFold(s.C(FieldScope), v)) 1195 }) 1196 } 1197 1198 // ScopeContainsFold applies the ContainsFold predicate on the "scope" field. 1199 func ScopeContainsFold(v string) predicate.Decision { 1200 return predicate.Decision(func(s *sql.Selector) { 1201 s.Where(sql.ContainsFold(s.C(FieldScope), v)) 1202 }) 1203 } 1204 1205 // ValueEQ applies the EQ predicate on the "value" field. 1206 func ValueEQ(v string) predicate.Decision { 1207 return predicate.Decision(func(s *sql.Selector) { 1208 s.Where(sql.EQ(s.C(FieldValue), v)) 1209 }) 1210 } 1211 1212 // ValueNEQ applies the NEQ predicate on the "value" field. 1213 func ValueNEQ(v string) predicate.Decision { 1214 return predicate.Decision(func(s *sql.Selector) { 1215 s.Where(sql.NEQ(s.C(FieldValue), v)) 1216 }) 1217 } 1218 1219 // ValueIn applies the In predicate on the "value" field. 1220 func ValueIn(vs ...string) predicate.Decision { 1221 v := make([]interface{}, len(vs)) 1222 for i := range v { 1223 v[i] = vs[i] 1224 } 1225 return predicate.Decision(func(s *sql.Selector) { 1226 // if not arguments were provided, append the FALSE constants, 1227 // since we can't apply "IN ()". This will make this predicate falsy. 1228 if len(v) == 0 { 1229 s.Where(sql.False()) 1230 return 1231 } 1232 s.Where(sql.In(s.C(FieldValue), v...)) 1233 }) 1234 } 1235 1236 // ValueNotIn applies the NotIn predicate on the "value" field. 1237 func ValueNotIn(vs ...string) predicate.Decision { 1238 v := make([]interface{}, len(vs)) 1239 for i := range v { 1240 v[i] = vs[i] 1241 } 1242 return predicate.Decision(func(s *sql.Selector) { 1243 // if not arguments were provided, append the FALSE constants, 1244 // since we can't apply "IN ()". This will make this predicate falsy. 1245 if len(v) == 0 { 1246 s.Where(sql.False()) 1247 return 1248 } 1249 s.Where(sql.NotIn(s.C(FieldValue), v...)) 1250 }) 1251 } 1252 1253 // ValueGT applies the GT predicate on the "value" field. 1254 func ValueGT(v string) predicate.Decision { 1255 return predicate.Decision(func(s *sql.Selector) { 1256 s.Where(sql.GT(s.C(FieldValue), v)) 1257 }) 1258 } 1259 1260 // ValueGTE applies the GTE predicate on the "value" field. 1261 func ValueGTE(v string) predicate.Decision { 1262 return predicate.Decision(func(s *sql.Selector) { 1263 s.Where(sql.GTE(s.C(FieldValue), v)) 1264 }) 1265 } 1266 1267 // ValueLT applies the LT predicate on the "value" field. 1268 func ValueLT(v string) predicate.Decision { 1269 return predicate.Decision(func(s *sql.Selector) { 1270 s.Where(sql.LT(s.C(FieldValue), v)) 1271 }) 1272 } 1273 1274 // ValueLTE applies the LTE predicate on the "value" field. 1275 func ValueLTE(v string) predicate.Decision { 1276 return predicate.Decision(func(s *sql.Selector) { 1277 s.Where(sql.LTE(s.C(FieldValue), v)) 1278 }) 1279 } 1280 1281 // ValueContains applies the Contains predicate on the "value" field. 1282 func ValueContains(v string) predicate.Decision { 1283 return predicate.Decision(func(s *sql.Selector) { 1284 s.Where(sql.Contains(s.C(FieldValue), v)) 1285 }) 1286 } 1287 1288 // ValueHasPrefix applies the HasPrefix predicate on the "value" field. 1289 func ValueHasPrefix(v string) predicate.Decision { 1290 return predicate.Decision(func(s *sql.Selector) { 1291 s.Where(sql.HasPrefix(s.C(FieldValue), v)) 1292 }) 1293 } 1294 1295 // ValueHasSuffix applies the HasSuffix predicate on the "value" field. 1296 func ValueHasSuffix(v string) predicate.Decision { 1297 return predicate.Decision(func(s *sql.Selector) { 1298 s.Where(sql.HasSuffix(s.C(FieldValue), v)) 1299 }) 1300 } 1301 1302 // ValueEqualFold applies the EqualFold predicate on the "value" field. 1303 func ValueEqualFold(v string) predicate.Decision { 1304 return predicate.Decision(func(s *sql.Selector) { 1305 s.Where(sql.EqualFold(s.C(FieldValue), v)) 1306 }) 1307 } 1308 1309 // ValueContainsFold applies the ContainsFold predicate on the "value" field. 1310 func ValueContainsFold(v string) predicate.Decision { 1311 return predicate.Decision(func(s *sql.Selector) { 1312 s.Where(sql.ContainsFold(s.C(FieldValue), v)) 1313 }) 1314 } 1315 1316 // OriginEQ applies the EQ predicate on the "origin" field. 1317 func OriginEQ(v string) predicate.Decision { 1318 return predicate.Decision(func(s *sql.Selector) { 1319 s.Where(sql.EQ(s.C(FieldOrigin), v)) 1320 }) 1321 } 1322 1323 // OriginNEQ applies the NEQ predicate on the "origin" field. 1324 func OriginNEQ(v string) predicate.Decision { 1325 return predicate.Decision(func(s *sql.Selector) { 1326 s.Where(sql.NEQ(s.C(FieldOrigin), v)) 1327 }) 1328 } 1329 1330 // OriginIn applies the In predicate on the "origin" field. 1331 func OriginIn(vs ...string) predicate.Decision { 1332 v := make([]interface{}, len(vs)) 1333 for i := range v { 1334 v[i] = vs[i] 1335 } 1336 return predicate.Decision(func(s *sql.Selector) { 1337 // if not arguments were provided, append the FALSE constants, 1338 // since we can't apply "IN ()". This will make this predicate falsy. 1339 if len(v) == 0 { 1340 s.Where(sql.False()) 1341 return 1342 } 1343 s.Where(sql.In(s.C(FieldOrigin), v...)) 1344 }) 1345 } 1346 1347 // OriginNotIn applies the NotIn predicate on the "origin" field. 1348 func OriginNotIn(vs ...string) predicate.Decision { 1349 v := make([]interface{}, len(vs)) 1350 for i := range v { 1351 v[i] = vs[i] 1352 } 1353 return predicate.Decision(func(s *sql.Selector) { 1354 // if not arguments were provided, append the FALSE constants, 1355 // since we can't apply "IN ()". This will make this predicate falsy. 1356 if len(v) == 0 { 1357 s.Where(sql.False()) 1358 return 1359 } 1360 s.Where(sql.NotIn(s.C(FieldOrigin), v...)) 1361 }) 1362 } 1363 1364 // OriginGT applies the GT predicate on the "origin" field. 1365 func OriginGT(v string) predicate.Decision { 1366 return predicate.Decision(func(s *sql.Selector) { 1367 s.Where(sql.GT(s.C(FieldOrigin), v)) 1368 }) 1369 } 1370 1371 // OriginGTE applies the GTE predicate on the "origin" field. 1372 func OriginGTE(v string) predicate.Decision { 1373 return predicate.Decision(func(s *sql.Selector) { 1374 s.Where(sql.GTE(s.C(FieldOrigin), v)) 1375 }) 1376 } 1377 1378 // OriginLT applies the LT predicate on the "origin" field. 1379 func OriginLT(v string) predicate.Decision { 1380 return predicate.Decision(func(s *sql.Selector) { 1381 s.Where(sql.LT(s.C(FieldOrigin), v)) 1382 }) 1383 } 1384 1385 // OriginLTE applies the LTE predicate on the "origin" field. 1386 func OriginLTE(v string) predicate.Decision { 1387 return predicate.Decision(func(s *sql.Selector) { 1388 s.Where(sql.LTE(s.C(FieldOrigin), v)) 1389 }) 1390 } 1391 1392 // OriginContains applies the Contains predicate on the "origin" field. 1393 func OriginContains(v string) predicate.Decision { 1394 return predicate.Decision(func(s *sql.Selector) { 1395 s.Where(sql.Contains(s.C(FieldOrigin), v)) 1396 }) 1397 } 1398 1399 // OriginHasPrefix applies the HasPrefix predicate on the "origin" field. 1400 func OriginHasPrefix(v string) predicate.Decision { 1401 return predicate.Decision(func(s *sql.Selector) { 1402 s.Where(sql.HasPrefix(s.C(FieldOrigin), v)) 1403 }) 1404 } 1405 1406 // OriginHasSuffix applies the HasSuffix predicate on the "origin" field. 1407 func OriginHasSuffix(v string) predicate.Decision { 1408 return predicate.Decision(func(s *sql.Selector) { 1409 s.Where(sql.HasSuffix(s.C(FieldOrigin), v)) 1410 }) 1411 } 1412 1413 // OriginEqualFold applies the EqualFold predicate on the "origin" field. 1414 func OriginEqualFold(v string) predicate.Decision { 1415 return predicate.Decision(func(s *sql.Selector) { 1416 s.Where(sql.EqualFold(s.C(FieldOrigin), v)) 1417 }) 1418 } 1419 1420 // OriginContainsFold applies the ContainsFold predicate on the "origin" field. 1421 func OriginContainsFold(v string) predicate.Decision { 1422 return predicate.Decision(func(s *sql.Selector) { 1423 s.Where(sql.ContainsFold(s.C(FieldOrigin), v)) 1424 }) 1425 } 1426 1427 // SimulatedEQ applies the EQ predicate on the "simulated" field. 1428 func SimulatedEQ(v bool) predicate.Decision { 1429 return predicate.Decision(func(s *sql.Selector) { 1430 s.Where(sql.EQ(s.C(FieldSimulated), v)) 1431 }) 1432 } 1433 1434 // SimulatedNEQ applies the NEQ predicate on the "simulated" field. 1435 func SimulatedNEQ(v bool) predicate.Decision { 1436 return predicate.Decision(func(s *sql.Selector) { 1437 s.Where(sql.NEQ(s.C(FieldSimulated), v)) 1438 }) 1439 } 1440 1441 // HasOwner applies the HasEdge predicate on the "owner" edge. 1442 func HasOwner() predicate.Decision { 1443 return predicate.Decision(func(s *sql.Selector) { 1444 step := sqlgraph.NewStep( 1445 sqlgraph.From(Table, FieldID), 1446 sqlgraph.To(OwnerTable, FieldID), 1447 sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), 1448 ) 1449 sqlgraph.HasNeighbors(s, step) 1450 }) 1451 } 1452 1453 // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates). 1454 func HasOwnerWith(preds ...predicate.Alert) predicate.Decision { 1455 return predicate.Decision(func(s *sql.Selector) { 1456 step := sqlgraph.NewStep( 1457 sqlgraph.From(Table, FieldID), 1458 sqlgraph.To(OwnerInverseTable, FieldID), 1459 sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn), 1460 ) 1461 sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) { 1462 for _, p := range preds { 1463 p(s) 1464 } 1465 }) 1466 }) 1467 } 1468 1469 // And groups predicates with the AND operator between them. 1470 func And(predicates ...predicate.Decision) predicate.Decision { 1471 return predicate.Decision(func(s *sql.Selector) { 1472 s1 := s.Clone().SetP(nil) 1473 for _, p := range predicates { 1474 p(s1) 1475 } 1476 s.Where(s1.P()) 1477 }) 1478 } 1479 1480 // Or groups predicates with the OR operator between them. 1481 func Or(predicates ...predicate.Decision) predicate.Decision { 1482 return predicate.Decision(func(s *sql.Selector) { 1483 s1 := s.Clone().SetP(nil) 1484 for i, p := range predicates { 1485 if i > 0 { 1486 s1.Or() 1487 } 1488 p(s1) 1489 } 1490 s.Where(s1.P()) 1491 }) 1492 } 1493 1494 // Not applies the not operator on the given predicate. 1495 func Not(p predicate.Decision) predicate.Decision { 1496 return predicate.Decision(func(s *sql.Selector) { 1497 p(s.Not()) 1498 }) 1499 }