Add ent autogenerated code
Signed-off-by: m.nabokikh <maksim.nabokikh@flant.com>
This commit is contained in:
45
storage/ent/db/keys/keys.go
Normal file
45
storage/ent/db/keys/keys.go
Normal file
@@ -0,0 +1,45 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package keys
|
||||
|
||||
const (
|
||||
// Label holds the string label denoting the keys type in the database.
|
||||
Label = "keys"
|
||||
// FieldID holds the string denoting the id field in the database.
|
||||
FieldID = "id"
|
||||
// FieldVerificationKeys holds the string denoting the verification_keys field in the database.
|
||||
FieldVerificationKeys = "verification_keys"
|
||||
// FieldSigningKey holds the string denoting the signing_key field in the database.
|
||||
FieldSigningKey = "signing_key"
|
||||
// FieldSigningKeyPub holds the string denoting the signing_key_pub field in the database.
|
||||
FieldSigningKeyPub = "signing_key_pub"
|
||||
// FieldNextRotation holds the string denoting the next_rotation field in the database.
|
||||
FieldNextRotation = "next_rotation"
|
||||
|
||||
// Table holds the table name of the keys in the database.
|
||||
Table = "keys"
|
||||
)
|
||||
|
||||
// Columns holds all SQL columns for keys fields.
|
||||
var Columns = []string{
|
||||
FieldID,
|
||||
FieldVerificationKeys,
|
||||
FieldSigningKey,
|
||||
FieldSigningKeyPub,
|
||||
FieldNextRotation,
|
||||
}
|
||||
|
||||
// ValidColumn reports if the column name is valid (part of the table columns).
|
||||
func ValidColumn(column string) bool {
|
||||
for i := range Columns {
|
||||
if column == Columns[i] {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
var (
|
||||
// IDValidator is a validator for the "id" field. It is called by the builders before save.
|
||||
IDValidator func(string) error
|
||||
)
|
208
storage/ent/db/keys/where.go
Normal file
208
storage/ent/db/keys/where.go
Normal file
@@ -0,0 +1,208 @@
|
||||
// Code generated by entc, DO NOT EDIT.
|
||||
|
||||
package keys
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/dexidp/dex/storage/ent/db/predicate"
|
||||
"github.com/facebook/ent/dialect/sql"
|
||||
)
|
||||
|
||||
// ID filters vertices based on their ID field.
|
||||
func ID(id string) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDEQ applies the EQ predicate on the ID field.
|
||||
func IDEQ(id string) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDNEQ applies the NEQ predicate on the ID field.
|
||||
func IDNEQ(id string) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDIn applies the In predicate on the ID field.
|
||||
func IDIn(ids ...string) predicate.Keys {
|
||||
return predicate.Keys(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 ...string) predicate.Keys {
|
||||
return predicate.Keys(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 string) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDGTE applies the GTE predicate on the ID field.
|
||||
func IDGTE(id string) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDLT applies the LT predicate on the ID field.
|
||||
func IDLT(id string) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// IDLTE applies the LTE predicate on the ID field.
|
||||
func IDLTE(id string) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldID), id))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotation applies equality check predicate on the "next_rotation" field. It's identical to NextRotationEQ.
|
||||
func NextRotation(v time.Time) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldNextRotation), v))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotationEQ applies the EQ predicate on the "next_rotation" field.
|
||||
func NextRotationEQ(v time.Time) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.EQ(s.C(FieldNextRotation), v))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotationNEQ applies the NEQ predicate on the "next_rotation" field.
|
||||
func NextRotationNEQ(v time.Time) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.NEQ(s.C(FieldNextRotation), v))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotationIn applies the In predicate on the "next_rotation" field.
|
||||
func NextRotationIn(vs ...time.Time) predicate.Keys {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Keys(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(FieldNextRotation), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotationNotIn applies the NotIn predicate on the "next_rotation" field.
|
||||
func NextRotationNotIn(vs ...time.Time) predicate.Keys {
|
||||
v := make([]interface{}, len(vs))
|
||||
for i := range v {
|
||||
v[i] = vs[i]
|
||||
}
|
||||
return predicate.Keys(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(FieldNextRotation), v...))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotationGT applies the GT predicate on the "next_rotation" field.
|
||||
func NextRotationGT(v time.Time) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.GT(s.C(FieldNextRotation), v))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotationGTE applies the GTE predicate on the "next_rotation" field.
|
||||
func NextRotationGTE(v time.Time) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.GTE(s.C(FieldNextRotation), v))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotationLT applies the LT predicate on the "next_rotation" field.
|
||||
func NextRotationLT(v time.Time) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.LT(s.C(FieldNextRotation), v))
|
||||
})
|
||||
}
|
||||
|
||||
// NextRotationLTE applies the LTE predicate on the "next_rotation" field.
|
||||
func NextRotationLTE(v time.Time) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
s.Where(sql.LTE(s.C(FieldNextRotation), v))
|
||||
})
|
||||
}
|
||||
|
||||
// And groups predicates with the AND operator between them.
|
||||
func And(predicates ...predicate.Keys) predicate.Keys {
|
||||
return predicate.Keys(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.Keys) predicate.Keys {
|
||||
return predicate.Keys(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.Keys) predicate.Keys {
|
||||
return predicate.Keys(func(s *sql.Selector) {
|
||||
p(s.Not())
|
||||
})
|
||||
}
|
Reference in New Issue
Block a user