manager/ent/mailbox/mailbox.go

174 lines
5.7 KiB
Go

// Code generated by ent, DO NOT EDIT.
package mailbox
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
)
const (
// Label holds the string label denoting the mailbox type in the database.
Label = "mailbox"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldActive holds the string denoting the active field in the database.
FieldActive = "active"
// FieldCreated holds the string denoting the created field in the database.
FieldCreated = "created"
// FieldModified holds the string denoting the modified field in the database.
FieldModified = "modified"
// FieldDomainID holds the string denoting the domain_id field in the database.
FieldDomainID = "domain_id"
// FieldUsername holds the string denoting the username field in the database.
FieldUsername = "username"
// FieldPassword holds the string denoting the password field in the database.
FieldPassword = "password"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldQuota holds the string denoting the quota field in the database.
FieldQuota = "quota"
// FieldLocalPart holds the string denoting the local_part field in the database.
FieldLocalPart = "local_part"
// FieldHomedir holds the string denoting the homedir field in the database.
FieldHomedir = "homedir"
// FieldMaildir holds the string denoting the maildir field in the database.
FieldMaildir = "maildir"
// FieldUID holds the string denoting the uid field in the database.
FieldUID = "uid"
// FieldGid holds the string denoting the gid field in the database.
FieldGid = "gid"
// EdgeDomain holds the string denoting the domain edge name in mutations.
EdgeDomain = "domain"
// Table holds the table name of the mailbox in the database.
Table = "mailboxes"
// DomainTable is the table that holds the domain relation/edge.
DomainTable = "mailboxes"
// DomainInverseTable is the table name for the Domain entity.
// It exists in this package in order to avoid circular dependency with the "domain" package.
DomainInverseTable = "domains"
// DomainColumn is the table column denoting the domain relation/edge.
DomainColumn = "domain_id"
)
// Columns holds all SQL columns for mailbox fields.
var Columns = []string{
FieldID,
FieldActive,
FieldCreated,
FieldModified,
FieldDomainID,
FieldUsername,
FieldPassword,
FieldName,
FieldQuota,
FieldLocalPart,
FieldHomedir,
FieldMaildir,
FieldUID,
FieldGid,
}
// 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 (
// DefaultCreated holds the default value on creation for the "created" field.
DefaultCreated func() time.Time
// DefaultModified holds the default value on creation for the "modified" field.
DefaultModified func() time.Time
// UpdateDefaultModified holds the default value on update for the "modified" field.
UpdateDefaultModified func() time.Time
)
// OrderOption defines the ordering options for the Mailbox 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()
}
// ByActive orders the results by the active field.
func ByActive(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldActive, opts...).ToFunc()
}
// ByCreated orders the results by the created field.
func ByCreated(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreated, opts...).ToFunc()
}
// ByModified orders the results by the modified field.
func ByModified(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldModified, opts...).ToFunc()
}
// ByDomainID orders the results by the domain_id field.
func ByDomainID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDomainID, opts...).ToFunc()
}
// ByUsername orders the results by the username field.
func ByUsername(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUsername, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByQuota orders the results by the quota field.
func ByQuota(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldQuota, opts...).ToFunc()
}
// ByLocalPart orders the results by the local_part field.
func ByLocalPart(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldLocalPart, opts...).ToFunc()
}
// ByHomedir orders the results by the homedir field.
func ByHomedir(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldHomedir, opts...).ToFunc()
}
// ByMaildir orders the results by the maildir field.
func ByMaildir(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMaildir, opts...).ToFunc()
}
// ByUID orders the results by the uid field.
func ByUID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUID, opts...).ToFunc()
}
// ByGid orders the results by the gid field.
func ByGid(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldGid, opts...).ToFunc()
}
// ByDomainField orders the results by domain field.
func ByDomainField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newDomainStep(), sql.OrderByField(field, opts...))
}
}
func newDomainStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(DomainInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, DomainTable, DomainColumn),
)
}