Init V4 community edition (#2265)

* Init V4 community edition

* Init V4 community edition
This commit is contained in:
AaronLiu
2025-04-20 17:31:25 +08:00
committed by GitHub
parent da4e44b77a
commit 21d158db07
597 changed files with 119415 additions and 41692 deletions

177
ent/group/group.go Normal file
View File

@@ -0,0 +1,177 @@
// Code generated by ent, DO NOT EDIT.
package group
import (
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/cloudreve/Cloudreve/v4/inventory/types"
)
const (
// Label holds the string label denoting the group type in the database.
Label = "group"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// FieldDeletedAt holds the string denoting the deleted_at field in the database.
FieldDeletedAt = "deleted_at"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldMaxStorage holds the string denoting the max_storage field in the database.
FieldMaxStorage = "max_storage"
// FieldSpeedLimit holds the string denoting the speed_limit field in the database.
FieldSpeedLimit = "speed_limit"
// FieldPermissions holds the string denoting the permissions field in the database.
FieldPermissions = "permissions"
// FieldSettings holds the string denoting the settings field in the database.
FieldSettings = "settings"
// FieldStoragePolicyID holds the string denoting the storage_policy_id field in the database.
FieldStoragePolicyID = "storage_policy_id"
// EdgeUsers holds the string denoting the users edge name in mutations.
EdgeUsers = "users"
// EdgeStoragePolicies holds the string denoting the storage_policies edge name in mutations.
EdgeStoragePolicies = "storage_policies"
// Table holds the table name of the group in the database.
Table = "groups"
// UsersTable is the table that holds the users relation/edge.
UsersTable = "users"
// UsersInverseTable is the table name for the User entity.
// It exists in this package in order to avoid circular dependency with the "user" package.
UsersInverseTable = "users"
// UsersColumn is the table column denoting the users relation/edge.
UsersColumn = "group_users"
// StoragePoliciesTable is the table that holds the storage_policies relation/edge.
StoragePoliciesTable = "groups"
// StoragePoliciesInverseTable is the table name for the StoragePolicy entity.
// It exists in this package in order to avoid circular dependency with the "storagepolicy" package.
StoragePoliciesInverseTable = "storage_policies"
// StoragePoliciesColumn is the table column denoting the storage_policies relation/edge.
StoragePoliciesColumn = "storage_policy_id"
)
// Columns holds all SQL columns for group fields.
var Columns = []string{
FieldID,
FieldCreatedAt,
FieldUpdatedAt,
FieldDeletedAt,
FieldName,
FieldMaxStorage,
FieldSpeedLimit,
FieldPermissions,
FieldSettings,
FieldStoragePolicyID,
}
// 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
}
// Note that the variables below are initialized by the runtime
// package on the initialization of the application. Therefore,
// it should be imported in the main as follows:
//
// import _ "github.com/cloudreve/Cloudreve/v4/ent/runtime"
var (
Hooks [1]ent.Hook
Interceptors [1]ent.Interceptor
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() time.Time
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
DefaultUpdatedAt func() time.Time
// UpdateDefaultUpdatedAt holds the default value on update for the "updated_at" field.
UpdateDefaultUpdatedAt func() time.Time
// DefaultSettings holds the default value on creation for the "settings" field.
DefaultSettings *types.GroupSetting
)
// OrderOption defines the ordering options for the Group 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()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}
// ByDeletedAt orders the results by the deleted_at field.
func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDeletedAt, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByMaxStorage orders the results by the max_storage field.
func ByMaxStorage(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldMaxStorage, opts...).ToFunc()
}
// BySpeedLimit orders the results by the speed_limit field.
func BySpeedLimit(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSpeedLimit, opts...).ToFunc()
}
// ByStoragePolicyID orders the results by the storage_policy_id field.
func ByStoragePolicyID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStoragePolicyID, opts...).ToFunc()
}
// ByUsersCount orders the results by users count.
func ByUsersCount(opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborsCount(s, newUsersStep(), opts...)
}
}
// ByUsers orders the results by users terms.
func ByUsers(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newUsersStep(), append([]sql.OrderTerm{term}, terms...)...)
}
}
// ByStoragePoliciesField orders the results by storage_policies field.
func ByStoragePoliciesField(field string, opts ...sql.OrderTermOption) OrderOption {
return func(s *sql.Selector) {
sqlgraph.OrderByNeighborTerms(s, newStoragePoliciesStep(), sql.OrderByField(field, opts...))
}
}
func newUsersStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(UsersInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, UsersTable, UsersColumn),
)
}
func newStoragePoliciesStep() *sqlgraph.Step {
return sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.To(StoragePoliciesInverseTable, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, StoragePoliciesTable, StoragePoliciesColumn),
)
}

533
ent/group/where.go Normal file
View File

@@ -0,0 +1,533 @@
// Code generated by ent, DO NOT EDIT.
package group
import (
"time"
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"github.com/cloudreve/Cloudreve/v4/ent/predicate"
"github.com/cloudreve/Cloudreve/v4/pkg/boolset"
)
// ID filters vertices based on their ID field.
func ID(id int) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldID, id))
}
// IDEQ applies the EQ predicate on the ID field.
func IDEQ(id int) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldID, id))
}
// IDNEQ applies the NEQ predicate on the ID field.
func IDNEQ(id int) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldID, id))
}
// IDIn applies the In predicate on the ID field.
func IDIn(ids ...int) predicate.Group {
return predicate.Group(sql.FieldIn(FieldID, ids...))
}
// IDNotIn applies the NotIn predicate on the ID field.
func IDNotIn(ids ...int) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldID, ids...))
}
// IDGT applies the GT predicate on the ID field.
func IDGT(id int) predicate.Group {
return predicate.Group(sql.FieldGT(FieldID, id))
}
// IDGTE applies the GTE predicate on the ID field.
func IDGTE(id int) predicate.Group {
return predicate.Group(sql.FieldGTE(FieldID, id))
}
// IDLT applies the LT predicate on the ID field.
func IDLT(id int) predicate.Group {
return predicate.Group(sql.FieldLT(FieldID, id))
}
// IDLTE applies the LTE predicate on the ID field.
func IDLTE(id int) predicate.Group {
return predicate.Group(sql.FieldLTE(FieldID, id))
}
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldCreatedAt, v))
}
// UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.
func UpdatedAt(v time.Time) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldUpdatedAt, v))
}
// DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ.
func DeletedAt(v time.Time) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldDeletedAt, v))
}
// Name applies equality check predicate on the "name" field. It's identical to NameEQ.
func Name(v string) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldName, v))
}
// MaxStorage applies equality check predicate on the "max_storage" field. It's identical to MaxStorageEQ.
func MaxStorage(v int64) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldMaxStorage, v))
}
// SpeedLimit applies equality check predicate on the "speed_limit" field. It's identical to SpeedLimitEQ.
func SpeedLimit(v int) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldSpeedLimit, v))
}
// Permissions applies equality check predicate on the "permissions" field. It's identical to PermissionsEQ.
func Permissions(v *boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldPermissions, v))
}
// StoragePolicyID applies equality check predicate on the "storage_policy_id" field. It's identical to StoragePolicyIDEQ.
func StoragePolicyID(v int) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldStoragePolicyID, v))
}
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
func CreatedAtEQ(v time.Time) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldCreatedAt, v))
}
// CreatedAtNEQ applies the NEQ predicate on the "created_at" field.
func CreatedAtNEQ(v time.Time) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldCreatedAt, v))
}
// CreatedAtIn applies the In predicate on the "created_at" field.
func CreatedAtIn(vs ...time.Time) predicate.Group {
return predicate.Group(sql.FieldIn(FieldCreatedAt, vs...))
}
// CreatedAtNotIn applies the NotIn predicate on the "created_at" field.
func CreatedAtNotIn(vs ...time.Time) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldCreatedAt, vs...))
}
// CreatedAtGT applies the GT predicate on the "created_at" field.
func CreatedAtGT(v time.Time) predicate.Group {
return predicate.Group(sql.FieldGT(FieldCreatedAt, v))
}
// CreatedAtGTE applies the GTE predicate on the "created_at" field.
func CreatedAtGTE(v time.Time) predicate.Group {
return predicate.Group(sql.FieldGTE(FieldCreatedAt, v))
}
// CreatedAtLT applies the LT predicate on the "created_at" field.
func CreatedAtLT(v time.Time) predicate.Group {
return predicate.Group(sql.FieldLT(FieldCreatedAt, v))
}
// CreatedAtLTE applies the LTE predicate on the "created_at" field.
func CreatedAtLTE(v time.Time) predicate.Group {
return predicate.Group(sql.FieldLTE(FieldCreatedAt, v))
}
// UpdatedAtEQ applies the EQ predicate on the "updated_at" field.
func UpdatedAtEQ(v time.Time) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldUpdatedAt, v))
}
// UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.
func UpdatedAtNEQ(v time.Time) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldUpdatedAt, v))
}
// UpdatedAtIn applies the In predicate on the "updated_at" field.
func UpdatedAtIn(vs ...time.Time) predicate.Group {
return predicate.Group(sql.FieldIn(FieldUpdatedAt, vs...))
}
// UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.
func UpdatedAtNotIn(vs ...time.Time) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldUpdatedAt, vs...))
}
// UpdatedAtGT applies the GT predicate on the "updated_at" field.
func UpdatedAtGT(v time.Time) predicate.Group {
return predicate.Group(sql.FieldGT(FieldUpdatedAt, v))
}
// UpdatedAtGTE applies the GTE predicate on the "updated_at" field.
func UpdatedAtGTE(v time.Time) predicate.Group {
return predicate.Group(sql.FieldGTE(FieldUpdatedAt, v))
}
// UpdatedAtLT applies the LT predicate on the "updated_at" field.
func UpdatedAtLT(v time.Time) predicate.Group {
return predicate.Group(sql.FieldLT(FieldUpdatedAt, v))
}
// UpdatedAtLTE applies the LTE predicate on the "updated_at" field.
func UpdatedAtLTE(v time.Time) predicate.Group {
return predicate.Group(sql.FieldLTE(FieldUpdatedAt, v))
}
// DeletedAtEQ applies the EQ predicate on the "deleted_at" field.
func DeletedAtEQ(v time.Time) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldDeletedAt, v))
}
// DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field.
func DeletedAtNEQ(v time.Time) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldDeletedAt, v))
}
// DeletedAtIn applies the In predicate on the "deleted_at" field.
func DeletedAtIn(vs ...time.Time) predicate.Group {
return predicate.Group(sql.FieldIn(FieldDeletedAt, vs...))
}
// DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field.
func DeletedAtNotIn(vs ...time.Time) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldDeletedAt, vs...))
}
// DeletedAtGT applies the GT predicate on the "deleted_at" field.
func DeletedAtGT(v time.Time) predicate.Group {
return predicate.Group(sql.FieldGT(FieldDeletedAt, v))
}
// DeletedAtGTE applies the GTE predicate on the "deleted_at" field.
func DeletedAtGTE(v time.Time) predicate.Group {
return predicate.Group(sql.FieldGTE(FieldDeletedAt, v))
}
// DeletedAtLT applies the LT predicate on the "deleted_at" field.
func DeletedAtLT(v time.Time) predicate.Group {
return predicate.Group(sql.FieldLT(FieldDeletedAt, v))
}
// DeletedAtLTE applies the LTE predicate on the "deleted_at" field.
func DeletedAtLTE(v time.Time) predicate.Group {
return predicate.Group(sql.FieldLTE(FieldDeletedAt, v))
}
// DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field.
func DeletedAtIsNil() predicate.Group {
return predicate.Group(sql.FieldIsNull(FieldDeletedAt))
}
// DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field.
func DeletedAtNotNil() predicate.Group {
return predicate.Group(sql.FieldNotNull(FieldDeletedAt))
}
// NameEQ applies the EQ predicate on the "name" field.
func NameEQ(v string) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldName, v))
}
// NameNEQ applies the NEQ predicate on the "name" field.
func NameNEQ(v string) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldName, v))
}
// NameIn applies the In predicate on the "name" field.
func NameIn(vs ...string) predicate.Group {
return predicate.Group(sql.FieldIn(FieldName, vs...))
}
// NameNotIn applies the NotIn predicate on the "name" field.
func NameNotIn(vs ...string) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldName, vs...))
}
// NameGT applies the GT predicate on the "name" field.
func NameGT(v string) predicate.Group {
return predicate.Group(sql.FieldGT(FieldName, v))
}
// NameGTE applies the GTE predicate on the "name" field.
func NameGTE(v string) predicate.Group {
return predicate.Group(sql.FieldGTE(FieldName, v))
}
// NameLT applies the LT predicate on the "name" field.
func NameLT(v string) predicate.Group {
return predicate.Group(sql.FieldLT(FieldName, v))
}
// NameLTE applies the LTE predicate on the "name" field.
func NameLTE(v string) predicate.Group {
return predicate.Group(sql.FieldLTE(FieldName, v))
}
// NameContains applies the Contains predicate on the "name" field.
func NameContains(v string) predicate.Group {
return predicate.Group(sql.FieldContains(FieldName, v))
}
// NameHasPrefix applies the HasPrefix predicate on the "name" field.
func NameHasPrefix(v string) predicate.Group {
return predicate.Group(sql.FieldHasPrefix(FieldName, v))
}
// NameHasSuffix applies the HasSuffix predicate on the "name" field.
func NameHasSuffix(v string) predicate.Group {
return predicate.Group(sql.FieldHasSuffix(FieldName, v))
}
// NameEqualFold applies the EqualFold predicate on the "name" field.
func NameEqualFold(v string) predicate.Group {
return predicate.Group(sql.FieldEqualFold(FieldName, v))
}
// NameContainsFold applies the ContainsFold predicate on the "name" field.
func NameContainsFold(v string) predicate.Group {
return predicate.Group(sql.FieldContainsFold(FieldName, v))
}
// MaxStorageEQ applies the EQ predicate on the "max_storage" field.
func MaxStorageEQ(v int64) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldMaxStorage, v))
}
// MaxStorageNEQ applies the NEQ predicate on the "max_storage" field.
func MaxStorageNEQ(v int64) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldMaxStorage, v))
}
// MaxStorageIn applies the In predicate on the "max_storage" field.
func MaxStorageIn(vs ...int64) predicate.Group {
return predicate.Group(sql.FieldIn(FieldMaxStorage, vs...))
}
// MaxStorageNotIn applies the NotIn predicate on the "max_storage" field.
func MaxStorageNotIn(vs ...int64) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldMaxStorage, vs...))
}
// MaxStorageGT applies the GT predicate on the "max_storage" field.
func MaxStorageGT(v int64) predicate.Group {
return predicate.Group(sql.FieldGT(FieldMaxStorage, v))
}
// MaxStorageGTE applies the GTE predicate on the "max_storage" field.
func MaxStorageGTE(v int64) predicate.Group {
return predicate.Group(sql.FieldGTE(FieldMaxStorage, v))
}
// MaxStorageLT applies the LT predicate on the "max_storage" field.
func MaxStorageLT(v int64) predicate.Group {
return predicate.Group(sql.FieldLT(FieldMaxStorage, v))
}
// MaxStorageLTE applies the LTE predicate on the "max_storage" field.
func MaxStorageLTE(v int64) predicate.Group {
return predicate.Group(sql.FieldLTE(FieldMaxStorage, v))
}
// MaxStorageIsNil applies the IsNil predicate on the "max_storage" field.
func MaxStorageIsNil() predicate.Group {
return predicate.Group(sql.FieldIsNull(FieldMaxStorage))
}
// MaxStorageNotNil applies the NotNil predicate on the "max_storage" field.
func MaxStorageNotNil() predicate.Group {
return predicate.Group(sql.FieldNotNull(FieldMaxStorage))
}
// SpeedLimitEQ applies the EQ predicate on the "speed_limit" field.
func SpeedLimitEQ(v int) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldSpeedLimit, v))
}
// SpeedLimitNEQ applies the NEQ predicate on the "speed_limit" field.
func SpeedLimitNEQ(v int) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldSpeedLimit, v))
}
// SpeedLimitIn applies the In predicate on the "speed_limit" field.
func SpeedLimitIn(vs ...int) predicate.Group {
return predicate.Group(sql.FieldIn(FieldSpeedLimit, vs...))
}
// SpeedLimitNotIn applies the NotIn predicate on the "speed_limit" field.
func SpeedLimitNotIn(vs ...int) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldSpeedLimit, vs...))
}
// SpeedLimitGT applies the GT predicate on the "speed_limit" field.
func SpeedLimitGT(v int) predicate.Group {
return predicate.Group(sql.FieldGT(FieldSpeedLimit, v))
}
// SpeedLimitGTE applies the GTE predicate on the "speed_limit" field.
func SpeedLimitGTE(v int) predicate.Group {
return predicate.Group(sql.FieldGTE(FieldSpeedLimit, v))
}
// SpeedLimitLT applies the LT predicate on the "speed_limit" field.
func SpeedLimitLT(v int) predicate.Group {
return predicate.Group(sql.FieldLT(FieldSpeedLimit, v))
}
// SpeedLimitLTE applies the LTE predicate on the "speed_limit" field.
func SpeedLimitLTE(v int) predicate.Group {
return predicate.Group(sql.FieldLTE(FieldSpeedLimit, v))
}
// SpeedLimitIsNil applies the IsNil predicate on the "speed_limit" field.
func SpeedLimitIsNil() predicate.Group {
return predicate.Group(sql.FieldIsNull(FieldSpeedLimit))
}
// SpeedLimitNotNil applies the NotNil predicate on the "speed_limit" field.
func SpeedLimitNotNil() predicate.Group {
return predicate.Group(sql.FieldNotNull(FieldSpeedLimit))
}
// PermissionsEQ applies the EQ predicate on the "permissions" field.
func PermissionsEQ(v *boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldPermissions, v))
}
// PermissionsNEQ applies the NEQ predicate on the "permissions" field.
func PermissionsNEQ(v *boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldPermissions, v))
}
// PermissionsIn applies the In predicate on the "permissions" field.
func PermissionsIn(vs ...*boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldIn(FieldPermissions, vs...))
}
// PermissionsNotIn applies the NotIn predicate on the "permissions" field.
func PermissionsNotIn(vs ...*boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldPermissions, vs...))
}
// PermissionsGT applies the GT predicate on the "permissions" field.
func PermissionsGT(v *boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldGT(FieldPermissions, v))
}
// PermissionsGTE applies the GTE predicate on the "permissions" field.
func PermissionsGTE(v *boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldGTE(FieldPermissions, v))
}
// PermissionsLT applies the LT predicate on the "permissions" field.
func PermissionsLT(v *boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldLT(FieldPermissions, v))
}
// PermissionsLTE applies the LTE predicate on the "permissions" field.
func PermissionsLTE(v *boolset.BooleanSet) predicate.Group {
return predicate.Group(sql.FieldLTE(FieldPermissions, v))
}
// SettingsIsNil applies the IsNil predicate on the "settings" field.
func SettingsIsNil() predicate.Group {
return predicate.Group(sql.FieldIsNull(FieldSettings))
}
// SettingsNotNil applies the NotNil predicate on the "settings" field.
func SettingsNotNil() predicate.Group {
return predicate.Group(sql.FieldNotNull(FieldSettings))
}
// StoragePolicyIDEQ applies the EQ predicate on the "storage_policy_id" field.
func StoragePolicyIDEQ(v int) predicate.Group {
return predicate.Group(sql.FieldEQ(FieldStoragePolicyID, v))
}
// StoragePolicyIDNEQ applies the NEQ predicate on the "storage_policy_id" field.
func StoragePolicyIDNEQ(v int) predicate.Group {
return predicate.Group(sql.FieldNEQ(FieldStoragePolicyID, v))
}
// StoragePolicyIDIn applies the In predicate on the "storage_policy_id" field.
func StoragePolicyIDIn(vs ...int) predicate.Group {
return predicate.Group(sql.FieldIn(FieldStoragePolicyID, vs...))
}
// StoragePolicyIDNotIn applies the NotIn predicate on the "storage_policy_id" field.
func StoragePolicyIDNotIn(vs ...int) predicate.Group {
return predicate.Group(sql.FieldNotIn(FieldStoragePolicyID, vs...))
}
// StoragePolicyIDIsNil applies the IsNil predicate on the "storage_policy_id" field.
func StoragePolicyIDIsNil() predicate.Group {
return predicate.Group(sql.FieldIsNull(FieldStoragePolicyID))
}
// StoragePolicyIDNotNil applies the NotNil predicate on the "storage_policy_id" field.
func StoragePolicyIDNotNil() predicate.Group {
return predicate.Group(sql.FieldNotNull(FieldStoragePolicyID))
}
// HasUsers applies the HasEdge predicate on the "users" edge.
func HasUsers() predicate.Group {
return predicate.Group(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.O2M, false, UsersTable, UsersColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasUsersWith applies the HasEdge predicate on the "users" edge with a given conditions (other predicates).
func HasUsersWith(preds ...predicate.User) predicate.Group {
return predicate.Group(func(s *sql.Selector) {
step := newUsersStep()
sqlgraph.HasNeighborsWith(s, step, func(s *sql.Selector) {
for _, p := range preds {
p(s)
}
})
})
}
// HasStoragePolicies applies the HasEdge predicate on the "storage_policies" edge.
func HasStoragePolicies() predicate.Group {
return predicate.Group(func(s *sql.Selector) {
step := sqlgraph.NewStep(
sqlgraph.From(Table, FieldID),
sqlgraph.Edge(sqlgraph.M2O, true, StoragePoliciesTable, StoragePoliciesColumn),
)
sqlgraph.HasNeighbors(s, step)
})
}
// HasStoragePoliciesWith applies the HasEdge predicate on the "storage_policies" edge with a given conditions (other predicates).
func HasStoragePoliciesWith(preds ...predicate.StoragePolicy) predicate.Group {
return predicate.Group(func(s *sql.Selector) {
step := newStoragePoliciesStep()
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.Group) predicate.Group {
return predicate.Group(sql.AndPredicates(predicates...))
}
// Or groups predicates with the OR operator between them.
func Or(predicates ...predicate.Group) predicate.Group {
return predicate.Group(sql.OrPredicates(predicates...))
}
// Not applies the not operator on the given predicate.
func Not(p predicate.Group) predicate.Group {
return predicate.Group(sql.NotPredicates(p))
}