This commit is contained in:
2023-12-01 23:02:33 +01:00
commit 7634b181de
48 changed files with 8610 additions and 0 deletions

97
ent/logentry/logentry.go Normal file
View File

@ -0,0 +1,97 @@
// Code generated by ent, DO NOT EDIT.
package logentry
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the logentry type in the database.
Label = "logentry"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldDate holds the string denoting the date field in the database.
FieldDate = "date"
// FieldContent holds the string denoting the content field in the database.
FieldContent = "content"
// EdgeProject holds the string denoting the project edge name in mutations.
EdgeProject = "project"
// Table holds the table name of the logentry in the database.
Table = "logentries"
// ProjectTable is the table that holds the project relation/edge.
ProjectTable = "logentries"
// ProjectInverseTable is the table name for the Project entity.
// It exists in this package in order to avoid circular dependency with the "project" package.
ProjectInverseTable = "projects"
// ProjectColumn is the table column denoting the project relation/edge.
ProjectColumn = "project_logentries"
)
// Columns holds all SQL columns for logentry fields.
var Columns = []string{
FieldID,
FieldDate,
FieldContent,
}
// ForeignKeys holds the SQL foreign-keys that are owned by the "logentries"
// table and are not defined as standalone fields in the schema.
var ForeignKeys = []string{
"project_logentries",
}
// 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
}
}
for i := range ForeignKeys {
if column == ForeignKeys[i] {
return true
}
}
return false
}
var (
// DefaultDate holds the default value on creation for the "date" field.
DefaultDate func() time.Time
)
// OrderOption defines the ordering options for the Logentry queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByDate orders the results by the date field.
func ByDate(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDate, opts...).ToFunc()
}
// ByContent orders the results by the content field.
func ByContent(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldContent, opts...).ToFunc()
}
// ByProjectField orders the results by project field.
func ByProjectField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newProjectStep(), sql.OrderByField(field, opts...))
}
}
func newProjectStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(ProjectInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, ProjectTable, ProjectColumn),
)
}

209
ent/logentry/where.go Normal file
View File

@ -0,0 +1,209 @@
// Code generated by ent, DO NOT EDIT.
package logentry
import (
"time"
"code.icod.de/dalu/gomanager/ent/predicate"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
// ID filters vertices based on their ID field.
func ID(id int) predicate.Logentry {
return predicate.Logentry(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int) predicate.Logentry {
return predicate.Logentry(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int) predicate.Logentry {
return predicate.Logentry(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int) predicate.Logentry {
return predicate.Logentry(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.Logentry {
return predicate.Logentry(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.Logentry {
return predicate.Logentry(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int) predicate.Logentry {
return predicate.Logentry(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int) predicate.Logentry {
return predicate.Logentry(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int) predicate.Logentry {
return predicate.Logentry(sql.FieldLTE(FieldID, id))
}
// Date applies equality check predicate on the "date" field. It's identical to DateEQ.
func Date(v time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldEQ(FieldDate, v))
}
// Content applies equality check predicate on the "content" field. It's identical to ContentEQ.
func Content(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldEQ(FieldContent, v))
}
// DateEQ applies the EQ predicate on the "date" field.
func DateEQ(v time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldEQ(FieldDate, v))
}
// DateNEQ applies the NEQ predicate on the "date" field.
func DateNEQ(v time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldNEQ(FieldDate, v))
}
// DateIn applies the In predicate on the "date" field.
func DateIn(vs ...time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldIn(FieldDate, vs...))
}
// DateNotIn applies the NotIn predicate on the "date" field.
func DateNotIn(vs ...time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldNotIn(FieldDate, vs...))
}
// DateGT applies the GT predicate on the "date" field.
func DateGT(v time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldGT(FieldDate, v))
}
// DateGTE applies the GTE predicate on the "date" field.
func DateGTE(v time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldGTE(FieldDate, v))
}
// DateLT applies the LT predicate on the "date" field.
func DateLT(v time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldLT(FieldDate, v))
}
// DateLTE applies the LTE predicate on the "date" field.
func DateLTE(v time.Time) predicate.Logentry {
return predicate.Logentry(sql.FieldLTE(FieldDate, v))
}
// ContentEQ applies the EQ predicate on the "content" field.
func ContentEQ(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldEQ(FieldContent, v))
}
// ContentNEQ applies the NEQ predicate on the "content" field.
func ContentNEQ(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldNEQ(FieldContent, v))
}
// ContentIn applies the In predicate on the "content" field.
func ContentIn(vs ...string) predicate.Logentry {
return predicate.Logentry(sql.FieldIn(FieldContent, vs...))
}
// ContentNotIn applies the NotIn predicate on the "content" field.
func ContentNotIn(vs ...string) predicate.Logentry {
return predicate.Logentry(sql.FieldNotIn(FieldContent, vs...))
}
// ContentGT applies the GT predicate on the "content" field.
func ContentGT(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldGT(FieldContent, v))
}
// ContentGTE applies the GTE predicate on the "content" field.
func ContentGTE(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldGTE(FieldContent, v))
}
// ContentLT applies the LT predicate on the "content" field.
func ContentLT(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldLT(FieldContent, v))
}
// ContentLTE applies the LTE predicate on the "content" field.
func ContentLTE(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldLTE(FieldContent, v))
}
// ContentContains applies the Contains predicate on the "content" field.
func ContentContains(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldContains(FieldContent, v))
}
// ContentHasPrefix applies the HasPrefix predicate on the "content" field.
func ContentHasPrefix(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldHasPrefix(FieldContent, v))
}
// ContentHasSuffix applies the HasSuffix predicate on the "content" field.
func ContentHasSuffix(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldHasSuffix(FieldContent, v))
}
// ContentEqualFold applies the EqualFold predicate on the "content" field.
func ContentEqualFold(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldEqualFold(FieldContent, v))
}
// ContentContainsFold applies the ContainsFold predicate on the "content" field.
func ContentContainsFold(v string) predicate.Logentry {
return predicate.Logentry(sql.FieldContainsFold(FieldContent, v))
}
// HasProject applies the HasEdge predicate on the "project" edge.
func HasProject() predicate.Logentry {
return predicate.Logentry(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, ProjectTable, ProjectColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasProjectWith applies the HasEdge predicate on the "project" edge with a given conditions (other predicates).
func HasProjectWith(preds ...predicate.Project) predicate.Logentry {
return predicate.Logentry(func(s *sql.Selector) {
step := newProjectStep()
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.Logentry) predicate.Logentry {
return predicate.Logentry(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Logentry) predicate.Logentry {
return predicate.Logentry(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.Logentry) predicate.Logentry {
return predicate.Logentry(sql.NotPredicates(p))
}