123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527 |
- // Code generated by entc, DO NOT EDIT.
- package decision
- import (
- "time"
- "entgo.io/ent/dialect/sql"
- "entgo.io/ent/dialect/sql/sqlgraph"
- "github.com/crowdsecurity/crowdsec/pkg/database/ent/predicate"
- )
- // ID filters vertices based on their ID field.
- func ID(id int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldID), id))
- })
- }
- // IDEQ applies the EQ predicate on the ID field.
- func IDEQ(id int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldID), id))
- })
- }
- // IDNEQ applies the NEQ predicate on the ID field.
- func IDNEQ(id int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldID), id))
- })
- }
- // IDIn applies the In predicate on the ID field.
- func IDIn(ids ...int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(ids) == 0 {
- s.Where(sql.False())
- return
- }
- v := make([]interface{}, len(ids))
- for i := range v {
- v[i] = ids[i]
- }
- s.Where(sql.In(s.C(FieldID), v...))
- })
- }
- // IDNotIn applies the NotIn predicate on the ID field.
- func IDNotIn(ids ...int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(ids) == 0 {
- s.Where(sql.False())
- return
- }
- v := make([]interface{}, len(ids))
- for i := range v {
- v[i] = ids[i]
- }
- s.Where(sql.NotIn(s.C(FieldID), v...))
- })
- }
- // IDGT applies the GT predicate on the ID field.
- func IDGT(id int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldID), id))
- })
- }
- // IDGTE applies the GTE predicate on the ID field.
- func IDGTE(id int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldID), id))
- })
- }
- // IDLT applies the LT predicate on the ID field.
- func IDLT(id int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldID), id))
- })
- }
- // IDLTE applies the LTE predicate on the ID field.
- func IDLTE(id int) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldID), id))
- })
- }
- // CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
- func CreatedAt(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldCreatedAt), v))
- })
- }
- // UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
- func UpdatedAt(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldUpdatedAt), v))
- })
- }
- // Until applies equality check predicate on the "until" field. It's identical to UntilEQ.
- func Until(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldUntil), v))
- })
- }
- // Scenario applies equality check predicate on the "scenario" field. It's identical to ScenarioEQ.
- func Scenario(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldScenario), v))
- })
- }
- // Type applies equality check predicate on the "type" field. It's identical to TypeEQ.
- func Type(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldType), v))
- })
- }
- // StartIP applies equality check predicate on the "start_ip" field. It's identical to StartIPEQ.
- func StartIP(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldStartIP), v))
- })
- }
- // EndIP applies equality check predicate on the "end_ip" field. It's identical to EndIPEQ.
- func EndIP(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldEndIP), v))
- })
- }
- // StartSuffix applies equality check predicate on the "start_suffix" field. It's identical to StartSuffixEQ.
- func StartSuffix(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldStartSuffix), v))
- })
- }
- // EndSuffix applies equality check predicate on the "end_suffix" field. It's identical to EndSuffixEQ.
- func EndSuffix(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldEndSuffix), v))
- })
- }
- // IPSize applies equality check predicate on the "ip_size" field. It's identical to IPSizeEQ.
- func IPSize(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldIPSize), v))
- })
- }
- // Scope applies equality check predicate on the "scope" field. It's identical to ScopeEQ.
- func Scope(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldScope), v))
- })
- }
- // Value applies equality check predicate on the "value" field. It's identical to ValueEQ.
- func Value(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldValue), v))
- })
- }
- // Origin applies equality check predicate on the "origin" field. It's identical to OriginEQ.
- func Origin(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldOrigin), v))
- })
- }
- // Simulated applies equality check predicate on the "simulated" field. It's identical to SimulatedEQ.
- func Simulated(v bool) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldSimulated), v))
- })
- }
- // CreatedAtEQ applies the EQ predicate on the "created_at" field.
- func CreatedAtEQ(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
- func CreatedAtNEQ(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtIn applies the In predicate on the "created_at" field.
- func CreatedAtIn(vs ...time.Time) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldCreatedAt), v...))
- })
- }
- // CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
- func CreatedAtNotIn(vs ...time.Time) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldCreatedAt), v...))
- })
- }
- // CreatedAtGT applies the GT predicate on the "created_at" field.
- func CreatedAtGT(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtGTE applies the GTE predicate on the "created_at" field.
- func CreatedAtGTE(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtLT applies the LT predicate on the "created_at" field.
- func CreatedAtLT(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtLTE applies the LTE predicate on the "created_at" field.
- func CreatedAtLTE(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldCreatedAt), v))
- })
- }
- // CreatedAtIsNil applies the IsNil predicate on the "created_at" field.
- func CreatedAtIsNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldCreatedAt)))
- })
- }
- // CreatedAtNotNil applies the NotNil predicate on the "created_at" field.
- func CreatedAtNotNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldCreatedAt)))
- })
- }
- // UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
- func UpdatedAtEQ(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldUpdatedAt), v))
- })
- }
- // UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
- func UpdatedAtNEQ(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldUpdatedAt), v))
- })
- }
- // UpdatedAtIn applies the In predicate on the "updated_at" field.
- func UpdatedAtIn(vs ...time.Time) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldUpdatedAt), v...))
- })
- }
- // UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
- func UpdatedAtNotIn(vs ...time.Time) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldUpdatedAt), v...))
- })
- }
- // UpdatedAtGT applies the GT predicate on the "updated_at" field.
- func UpdatedAtGT(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldUpdatedAt), v))
- })
- }
- // UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
- func UpdatedAtGTE(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldUpdatedAt), v))
- })
- }
- // UpdatedAtLT applies the LT predicate on the "updated_at" field.
- func UpdatedAtLT(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldUpdatedAt), v))
- })
- }
- // UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
- func UpdatedAtLTE(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldUpdatedAt), v))
- })
- }
- // UpdatedAtIsNil applies the IsNil predicate on the "updated_at" field.
- func UpdatedAtIsNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldUpdatedAt)))
- })
- }
- // UpdatedAtNotNil applies the NotNil predicate on the "updated_at" field.
- func UpdatedAtNotNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldUpdatedAt)))
- })
- }
- // UntilEQ applies the EQ predicate on the "until" field.
- func UntilEQ(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldUntil), v))
- })
- }
- // UntilNEQ applies the NEQ predicate on the "until" field.
- func UntilNEQ(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldUntil), v))
- })
- }
- // UntilIn applies the In predicate on the "until" field.
- func UntilIn(vs ...time.Time) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldUntil), v...))
- })
- }
- // UntilNotIn applies the NotIn predicate on the "until" field.
- func UntilNotIn(vs ...time.Time) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldUntil), v...))
- })
- }
- // UntilGT applies the GT predicate on the "until" field.
- func UntilGT(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldUntil), v))
- })
- }
- // UntilGTE applies the GTE predicate on the "until" field.
- func UntilGTE(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldUntil), v))
- })
- }
- // UntilLT applies the LT predicate on the "until" field.
- func UntilLT(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldUntil), v))
- })
- }
- // UntilLTE applies the LTE predicate on the "until" field.
- func UntilLTE(v time.Time) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldUntil), v))
- })
- }
- // ScenarioEQ applies the EQ predicate on the "scenario" field.
- func ScenarioEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldScenario), v))
- })
- }
- // ScenarioNEQ applies the NEQ predicate on the "scenario" field.
- func ScenarioNEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldScenario), v))
- })
- }
- // ScenarioIn applies the In predicate on the "scenario" field.
- func ScenarioIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldScenario), v...))
- })
- }
- // ScenarioNotIn applies the NotIn predicate on the "scenario" field.
- func ScenarioNotIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldScenario), v...))
- })
- }
- // ScenarioGT applies the GT predicate on the "scenario" field.
- func ScenarioGT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldScenario), v))
- })
- }
- // ScenarioGTE applies the GTE predicate on the "scenario" field.
- func ScenarioGTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldScenario), v))
- })
- }
- // ScenarioLT applies the LT predicate on the "scenario" field.
- func ScenarioLT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldScenario), v))
- })
- }
- // ScenarioLTE applies the LTE predicate on the "scenario" field.
- func ScenarioLTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldScenario), v))
- })
- }
- // ScenarioContains applies the Contains predicate on the "scenario" field.
- func ScenarioContains(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.Contains(s.C(FieldScenario), v))
- })
- }
- // ScenarioHasPrefix applies the HasPrefix predicate on the "scenario" field.
- func ScenarioHasPrefix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasPrefix(s.C(FieldScenario), v))
- })
- }
- // ScenarioHasSuffix applies the HasSuffix predicate on the "scenario" field.
- func ScenarioHasSuffix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasSuffix(s.C(FieldScenario), v))
- })
- }
- // ScenarioEqualFold applies the EqualFold predicate on the "scenario" field.
- func ScenarioEqualFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EqualFold(s.C(FieldScenario), v))
- })
- }
- // ScenarioContainsFold applies the ContainsFold predicate on the "scenario" field.
- func ScenarioContainsFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.ContainsFold(s.C(FieldScenario), v))
- })
- }
- // TypeEQ applies the EQ predicate on the "type" field.
- func TypeEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldType), v))
- })
- }
- // TypeNEQ applies the NEQ predicate on the "type" field.
- func TypeNEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldType), v))
- })
- }
- // TypeIn applies the In predicate on the "type" field.
- func TypeIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldType), v...))
- })
- }
- // TypeNotIn applies the NotIn predicate on the "type" field.
- func TypeNotIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldType), v...))
- })
- }
- // TypeGT applies the GT predicate on the "type" field.
- func TypeGT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldType), v))
- })
- }
- // TypeGTE applies the GTE predicate on the "type" field.
- func TypeGTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldType), v))
- })
- }
- // TypeLT applies the LT predicate on the "type" field.
- func TypeLT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldType), v))
- })
- }
- // TypeLTE applies the LTE predicate on the "type" field.
- func TypeLTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldType), v))
- })
- }
- // TypeContains applies the Contains predicate on the "type" field.
- func TypeContains(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.Contains(s.C(FieldType), v))
- })
- }
- // TypeHasPrefix applies the HasPrefix predicate on the "type" field.
- func TypeHasPrefix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasPrefix(s.C(FieldType), v))
- })
- }
- // TypeHasSuffix applies the HasSuffix predicate on the "type" field.
- func TypeHasSuffix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasSuffix(s.C(FieldType), v))
- })
- }
- // TypeEqualFold applies the EqualFold predicate on the "type" field.
- func TypeEqualFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EqualFold(s.C(FieldType), v))
- })
- }
- // TypeContainsFold applies the ContainsFold predicate on the "type" field.
- func TypeContainsFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.ContainsFold(s.C(FieldType), v))
- })
- }
- // StartIPEQ applies the EQ predicate on the "start_ip" field.
- func StartIPEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldStartIP), v))
- })
- }
- // StartIPNEQ applies the NEQ predicate on the "start_ip" field.
- func StartIPNEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldStartIP), v))
- })
- }
- // StartIPIn applies the In predicate on the "start_ip" field.
- func StartIPIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldStartIP), v...))
- })
- }
- // StartIPNotIn applies the NotIn predicate on the "start_ip" field.
- func StartIPNotIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldStartIP), v...))
- })
- }
- // StartIPGT applies the GT predicate on the "start_ip" field.
- func StartIPGT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldStartIP), v))
- })
- }
- // StartIPGTE applies the GTE predicate on the "start_ip" field.
- func StartIPGTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldStartIP), v))
- })
- }
- // StartIPLT applies the LT predicate on the "start_ip" field.
- func StartIPLT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldStartIP), v))
- })
- }
- // StartIPLTE applies the LTE predicate on the "start_ip" field.
- func StartIPLTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldStartIP), v))
- })
- }
- // StartIPIsNil applies the IsNil predicate on the "start_ip" field.
- func StartIPIsNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldStartIP)))
- })
- }
- // StartIPNotNil applies the NotNil predicate on the "start_ip" field.
- func StartIPNotNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldStartIP)))
- })
- }
- // EndIPEQ applies the EQ predicate on the "end_ip" field.
- func EndIPEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldEndIP), v))
- })
- }
- // EndIPNEQ applies the NEQ predicate on the "end_ip" field.
- func EndIPNEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldEndIP), v))
- })
- }
- // EndIPIn applies the In predicate on the "end_ip" field.
- func EndIPIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldEndIP), v...))
- })
- }
- // EndIPNotIn applies the NotIn predicate on the "end_ip" field.
- func EndIPNotIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldEndIP), v...))
- })
- }
- // EndIPGT applies the GT predicate on the "end_ip" field.
- func EndIPGT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldEndIP), v))
- })
- }
- // EndIPGTE applies the GTE predicate on the "end_ip" field.
- func EndIPGTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldEndIP), v))
- })
- }
- // EndIPLT applies the LT predicate on the "end_ip" field.
- func EndIPLT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldEndIP), v))
- })
- }
- // EndIPLTE applies the LTE predicate on the "end_ip" field.
- func EndIPLTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldEndIP), v))
- })
- }
- // EndIPIsNil applies the IsNil predicate on the "end_ip" field.
- func EndIPIsNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldEndIP)))
- })
- }
- // EndIPNotNil applies the NotNil predicate on the "end_ip" field.
- func EndIPNotNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldEndIP)))
- })
- }
- // StartSuffixEQ applies the EQ predicate on the "start_suffix" field.
- func StartSuffixEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldStartSuffix), v))
- })
- }
- // StartSuffixNEQ applies the NEQ predicate on the "start_suffix" field.
- func StartSuffixNEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldStartSuffix), v))
- })
- }
- // StartSuffixIn applies the In predicate on the "start_suffix" field.
- func StartSuffixIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldStartSuffix), v...))
- })
- }
- // StartSuffixNotIn applies the NotIn predicate on the "start_suffix" field.
- func StartSuffixNotIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldStartSuffix), v...))
- })
- }
- // StartSuffixGT applies the GT predicate on the "start_suffix" field.
- func StartSuffixGT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldStartSuffix), v))
- })
- }
- // StartSuffixGTE applies the GTE predicate on the "start_suffix" field.
- func StartSuffixGTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldStartSuffix), v))
- })
- }
- // StartSuffixLT applies the LT predicate on the "start_suffix" field.
- func StartSuffixLT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldStartSuffix), v))
- })
- }
- // StartSuffixLTE applies the LTE predicate on the "start_suffix" field.
- func StartSuffixLTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldStartSuffix), v))
- })
- }
- // StartSuffixIsNil applies the IsNil predicate on the "start_suffix" field.
- func StartSuffixIsNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldStartSuffix)))
- })
- }
- // StartSuffixNotNil applies the NotNil predicate on the "start_suffix" field.
- func StartSuffixNotNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldStartSuffix)))
- })
- }
- // EndSuffixEQ applies the EQ predicate on the "end_suffix" field.
- func EndSuffixEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldEndSuffix), v))
- })
- }
- // EndSuffixNEQ applies the NEQ predicate on the "end_suffix" field.
- func EndSuffixNEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldEndSuffix), v))
- })
- }
- // EndSuffixIn applies the In predicate on the "end_suffix" field.
- func EndSuffixIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldEndSuffix), v...))
- })
- }
- // EndSuffixNotIn applies the NotIn predicate on the "end_suffix" field.
- func EndSuffixNotIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldEndSuffix), v...))
- })
- }
- // EndSuffixGT applies the GT predicate on the "end_suffix" field.
- func EndSuffixGT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldEndSuffix), v))
- })
- }
- // EndSuffixGTE applies the GTE predicate on the "end_suffix" field.
- func EndSuffixGTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldEndSuffix), v))
- })
- }
- // EndSuffixLT applies the LT predicate on the "end_suffix" field.
- func EndSuffixLT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldEndSuffix), v))
- })
- }
- // EndSuffixLTE applies the LTE predicate on the "end_suffix" field.
- func EndSuffixLTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldEndSuffix), v))
- })
- }
- // EndSuffixIsNil applies the IsNil predicate on the "end_suffix" field.
- func EndSuffixIsNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldEndSuffix)))
- })
- }
- // EndSuffixNotNil applies the NotNil predicate on the "end_suffix" field.
- func EndSuffixNotNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldEndSuffix)))
- })
- }
- // IPSizeEQ applies the EQ predicate on the "ip_size" field.
- func IPSizeEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldIPSize), v))
- })
- }
- // IPSizeNEQ applies the NEQ predicate on the "ip_size" field.
- func IPSizeNEQ(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldIPSize), v))
- })
- }
- // IPSizeIn applies the In predicate on the "ip_size" field.
- func IPSizeIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldIPSize), v...))
- })
- }
- // IPSizeNotIn applies the NotIn predicate on the "ip_size" field.
- func IPSizeNotIn(vs ...int64) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldIPSize), v...))
- })
- }
- // IPSizeGT applies the GT predicate on the "ip_size" field.
- func IPSizeGT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldIPSize), v))
- })
- }
- // IPSizeGTE applies the GTE predicate on the "ip_size" field.
- func IPSizeGTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldIPSize), v))
- })
- }
- // IPSizeLT applies the LT predicate on the "ip_size" field.
- func IPSizeLT(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldIPSize), v))
- })
- }
- // IPSizeLTE applies the LTE predicate on the "ip_size" field.
- func IPSizeLTE(v int64) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldIPSize), v))
- })
- }
- // IPSizeIsNil applies the IsNil predicate on the "ip_size" field.
- func IPSizeIsNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.IsNull(s.C(FieldIPSize)))
- })
- }
- // IPSizeNotNil applies the NotNil predicate on the "ip_size" field.
- func IPSizeNotNil() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NotNull(s.C(FieldIPSize)))
- })
- }
- // ScopeEQ applies the EQ predicate on the "scope" field.
- func ScopeEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldScope), v))
- })
- }
- // ScopeNEQ applies the NEQ predicate on the "scope" field.
- func ScopeNEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldScope), v))
- })
- }
- // ScopeIn applies the In predicate on the "scope" field.
- func ScopeIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldScope), v...))
- })
- }
- // ScopeNotIn applies the NotIn predicate on the "scope" field.
- func ScopeNotIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldScope), v...))
- })
- }
- // ScopeGT applies the GT predicate on the "scope" field.
- func ScopeGT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldScope), v))
- })
- }
- // ScopeGTE applies the GTE predicate on the "scope" field.
- func ScopeGTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldScope), v))
- })
- }
- // ScopeLT applies the LT predicate on the "scope" field.
- func ScopeLT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldScope), v))
- })
- }
- // ScopeLTE applies the LTE predicate on the "scope" field.
- func ScopeLTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldScope), v))
- })
- }
- // ScopeContains applies the Contains predicate on the "scope" field.
- func ScopeContains(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.Contains(s.C(FieldScope), v))
- })
- }
- // ScopeHasPrefix applies the HasPrefix predicate on the "scope" field.
- func ScopeHasPrefix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasPrefix(s.C(FieldScope), v))
- })
- }
- // ScopeHasSuffix applies the HasSuffix predicate on the "scope" field.
- func ScopeHasSuffix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasSuffix(s.C(FieldScope), v))
- })
- }
- // ScopeEqualFold applies the EqualFold predicate on the "scope" field.
- func ScopeEqualFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EqualFold(s.C(FieldScope), v))
- })
- }
- // ScopeContainsFold applies the ContainsFold predicate on the "scope" field.
- func ScopeContainsFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.ContainsFold(s.C(FieldScope), v))
- })
- }
- // ValueEQ applies the EQ predicate on the "value" field.
- func ValueEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldValue), v))
- })
- }
- // ValueNEQ applies the NEQ predicate on the "value" field.
- func ValueNEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldValue), v))
- })
- }
- // ValueIn applies the In predicate on the "value" field.
- func ValueIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldValue), v...))
- })
- }
- // ValueNotIn applies the NotIn predicate on the "value" field.
- func ValueNotIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldValue), v...))
- })
- }
- // ValueGT applies the GT predicate on the "value" field.
- func ValueGT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldValue), v))
- })
- }
- // ValueGTE applies the GTE predicate on the "value" field.
- func ValueGTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldValue), v))
- })
- }
- // ValueLT applies the LT predicate on the "value" field.
- func ValueLT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldValue), v))
- })
- }
- // ValueLTE applies the LTE predicate on the "value" field.
- func ValueLTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldValue), v))
- })
- }
- // ValueContains applies the Contains predicate on the "value" field.
- func ValueContains(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.Contains(s.C(FieldValue), v))
- })
- }
- // ValueHasPrefix applies the HasPrefix predicate on the "value" field.
- func ValueHasPrefix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasPrefix(s.C(FieldValue), v))
- })
- }
- // ValueHasSuffix applies the HasSuffix predicate on the "value" field.
- func ValueHasSuffix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasSuffix(s.C(FieldValue), v))
- })
- }
- // ValueEqualFold applies the EqualFold predicate on the "value" field.
- func ValueEqualFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EqualFold(s.C(FieldValue), v))
- })
- }
- // ValueContainsFold applies the ContainsFold predicate on the "value" field.
- func ValueContainsFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.ContainsFold(s.C(FieldValue), v))
- })
- }
- // OriginEQ applies the EQ predicate on the "origin" field.
- func OriginEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldOrigin), v))
- })
- }
- // OriginNEQ applies the NEQ predicate on the "origin" field.
- func OriginNEQ(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldOrigin), v))
- })
- }
- // OriginIn applies the In predicate on the "origin" field.
- func OriginIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.In(s.C(FieldOrigin), v...))
- })
- }
- // OriginNotIn applies the NotIn predicate on the "origin" field.
- func OriginNotIn(vs ...string) predicate.Decision {
- v := make([]interface{}, len(vs))
- for i := range v {
- v[i] = vs[i]
- }
- return predicate.Decision(func(s *sql.Selector) {
- // if not arguments were provided, append the FALSE constants,
- // since we can't apply "IN ()". This will make this predicate falsy.
- if len(v) == 0 {
- s.Where(sql.False())
- return
- }
- s.Where(sql.NotIn(s.C(FieldOrigin), v...))
- })
- }
- // OriginGT applies the GT predicate on the "origin" field.
- func OriginGT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GT(s.C(FieldOrigin), v))
- })
- }
- // OriginGTE applies the GTE predicate on the "origin" field.
- func OriginGTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.GTE(s.C(FieldOrigin), v))
- })
- }
- // OriginLT applies the LT predicate on the "origin" field.
- func OriginLT(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LT(s.C(FieldOrigin), v))
- })
- }
- // OriginLTE applies the LTE predicate on the "origin" field.
- func OriginLTE(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.LTE(s.C(FieldOrigin), v))
- })
- }
- // OriginContains applies the Contains predicate on the "origin" field.
- func OriginContains(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.Contains(s.C(FieldOrigin), v))
- })
- }
- // OriginHasPrefix applies the HasPrefix predicate on the "origin" field.
- func OriginHasPrefix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasPrefix(s.C(FieldOrigin), v))
- })
- }
- // OriginHasSuffix applies the HasSuffix predicate on the "origin" field.
- func OriginHasSuffix(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.HasSuffix(s.C(FieldOrigin), v))
- })
- }
- // OriginEqualFold applies the EqualFold predicate on the "origin" field.
- func OriginEqualFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EqualFold(s.C(FieldOrigin), v))
- })
- }
- // OriginContainsFold applies the ContainsFold predicate on the "origin" field.
- func OriginContainsFold(v string) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.ContainsFold(s.C(FieldOrigin), v))
- })
- }
- // SimulatedEQ applies the EQ predicate on the "simulated" field.
- func SimulatedEQ(v bool) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.EQ(s.C(FieldSimulated), v))
- })
- }
- // SimulatedNEQ applies the NEQ predicate on the "simulated" field.
- func SimulatedNEQ(v bool) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s.Where(sql.NEQ(s.C(FieldSimulated), v))
- })
- }
- // HasOwner applies the HasEdge predicate on the "owner" edge.
- func HasOwner() predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(OwnerTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
- )
- sqlgraph.HasNeighbors(s, step)
- })
- }
- // HasOwnerWith applies the HasEdge predicate on the "owner" edge with a given conditions (other predicates).
- func HasOwnerWith(preds ...predicate.Alert) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- step := sqlgraph.NewStep(
- sqlgraph.From(Table, FieldID),
- sqlgraph.To(OwnerInverseTable, FieldID),
- sqlgraph.Edge(sqlgraph.M2O, true, OwnerTable, OwnerColumn),
- )
- sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
- for _, p := range preds {
- p(s)
- }
- })
- })
- }
- // And groups predicates with the AND operator between them.
- func And(predicates ...predicate.Decision) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s1 := s.Clone().SetP(nil)
- for _, p := range predicates {
- p(s1)
- }
- s.Where(s1.P())
- })
- }
- // Or groups predicates with the OR operator between them.
- func Or(predicates ...predicate.Decision) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- s1 := s.Clone().SetP(nil)
- for i, p := range predicates {
- if i > 0 {
- s1.Or()
- }
- p(s1)
- }
- s.Where(s1.P())
- })
- }
- // Not applies the not operator on the given predicate.
- func Not(p predicate.Decision) predicate.Decision {
- return predicate.Decision(func(s *sql.Selector) {
- p(s.Not())
- })
- }
|