node

package
v4.0.0-...-58b83ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the node type in the database.
	Label = "node"
	// 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"
	// FieldStatus holds the string denoting the status field in the database.
	FieldStatus = "status"
	// FieldName holds the string denoting the name field in the database.
	FieldName = "name"
	// FieldType holds the string denoting the type field in the database.
	FieldType = "type"
	// FieldServer holds the string denoting the server field in the database.
	FieldServer = "server"
	// FieldSlaveKey holds the string denoting the slave_key field in the database.
	FieldSlaveKey = "slave_key"
	// FieldCapabilities holds the string denoting the capabilities field in the database.
	FieldCapabilities = "capabilities"
	// FieldSettings holds the string denoting the settings field in the database.
	FieldSettings = "settings"
	// FieldWeight holds the string denoting the weight field in the database.
	FieldWeight = "weight"
	// EdgeStoragePolicy holds the string denoting the storage_policy edge name in mutations.
	EdgeStoragePolicy = "storage_policy"
	// Table holds the table name of the node in the database.
	Table = "nodes"
	// StoragePolicyTable is the table that holds the storage_policy relation/edge.
	StoragePolicyTable = "storage_policies"
	// StoragePolicyInverseTable is the table name for the StoragePolicy entity.
	// It exists in this package in order to avoid circular dependency with the "storagepolicy" package.
	StoragePolicyInverseTable = "storage_policies"
	// StoragePolicyColumn is the table column denoting the storage_policy relation/edge.
	StoragePolicyColumn = "node_id"
)

Variables

View Source
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.NodeSetting
	// DefaultWeight holds the default value on creation for the "weight" field.
	DefaultWeight int
)

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"

Columns holds all SQL columns for node fields.

Functions

func And

func And(predicates ...predicate.Node) predicate.Node

And groups predicates with the AND operator between them.

func Capabilities

func Capabilities(v *boolset.BooleanSet) predicate.Node

Capabilities applies equality check predicate on the "capabilities" field. It's identical to CapabilitiesEQ.

func CapabilitiesEQ

func CapabilitiesEQ(v *boolset.BooleanSet) predicate.Node

CapabilitiesEQ applies the EQ predicate on the "capabilities" field.

func CapabilitiesGT

func CapabilitiesGT(v *boolset.BooleanSet) predicate.Node

CapabilitiesGT applies the GT predicate on the "capabilities" field.

func CapabilitiesGTE

func CapabilitiesGTE(v *boolset.BooleanSet) predicate.Node

CapabilitiesGTE applies the GTE predicate on the "capabilities" field.

func CapabilitiesIn

func CapabilitiesIn(vs ...*boolset.BooleanSet) predicate.Node

CapabilitiesIn applies the In predicate on the "capabilities" field.

func CapabilitiesLT

func CapabilitiesLT(v *boolset.BooleanSet) predicate.Node

CapabilitiesLT applies the LT predicate on the "capabilities" field.

func CapabilitiesLTE

func CapabilitiesLTE(v *boolset.BooleanSet) predicate.Node

CapabilitiesLTE applies the LTE predicate on the "capabilities" field.

func CapabilitiesNEQ

func CapabilitiesNEQ(v *boolset.BooleanSet) predicate.Node

CapabilitiesNEQ applies the NEQ predicate on the "capabilities" field.

func CapabilitiesNotIn

func CapabilitiesNotIn(vs ...*boolset.BooleanSet) predicate.Node

CapabilitiesNotIn applies the NotIn predicate on the "capabilities" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Node

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Node

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Node

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Node

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Node

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Node

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Node

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Node

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Node

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func DeletedAt

func DeletedAt(v time.Time) predicate.Node

DeletedAt applies equality check predicate on the "deleted_at" field. It's identical to DeletedAtEQ.

func DeletedAtEQ

func DeletedAtEQ(v time.Time) predicate.Node

DeletedAtEQ applies the EQ predicate on the "deleted_at" field.

func DeletedAtGT

func DeletedAtGT(v time.Time) predicate.Node

DeletedAtGT applies the GT predicate on the "deleted_at" field.

func DeletedAtGTE

func DeletedAtGTE(v time.Time) predicate.Node

DeletedAtGTE applies the GTE predicate on the "deleted_at" field.

func DeletedAtIn

func DeletedAtIn(vs ...time.Time) predicate.Node

DeletedAtIn applies the In predicate on the "deleted_at" field.

func DeletedAtIsNil

func DeletedAtIsNil() predicate.Node

DeletedAtIsNil applies the IsNil predicate on the "deleted_at" field.

func DeletedAtLT

func DeletedAtLT(v time.Time) predicate.Node

DeletedAtLT applies the LT predicate on the "deleted_at" field.

func DeletedAtLTE

func DeletedAtLTE(v time.Time) predicate.Node

DeletedAtLTE applies the LTE predicate on the "deleted_at" field.

func DeletedAtNEQ

func DeletedAtNEQ(v time.Time) predicate.Node

DeletedAtNEQ applies the NEQ predicate on the "deleted_at" field.

func DeletedAtNotIn

func DeletedAtNotIn(vs ...time.Time) predicate.Node

DeletedAtNotIn applies the NotIn predicate on the "deleted_at" field.

func DeletedAtNotNil

func DeletedAtNotNil() predicate.Node

DeletedAtNotNil applies the NotNil predicate on the "deleted_at" field.

func HasStoragePolicy

func HasStoragePolicy() predicate.Node

HasStoragePolicy applies the HasEdge predicate on the "storage_policy" edge.

func HasStoragePolicyWith

func HasStoragePolicyWith(preds ...predicate.StoragePolicy) predicate.Node

HasStoragePolicyWith applies the HasEdge predicate on the "storage_policy" edge with a given conditions (other predicates).

func ID

func ID(id int) predicate.Node

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Node

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Node

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Node

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int) predicate.Node

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Node

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Node

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Node

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int) predicate.Node

IDNotIn applies the NotIn predicate on the ID field.

func Name

func Name(v string) predicate.Node

Name applies equality check predicate on the "name" field. It's identical to NameEQ.

func NameContains

func NameContains(v string) predicate.Node

NameContains applies the Contains predicate on the "name" field.

func NameContainsFold

func NameContainsFold(v string) predicate.Node

NameContainsFold applies the ContainsFold predicate on the "name" field.

func NameEQ

func NameEQ(v string) predicate.Node

NameEQ applies the EQ predicate on the "name" field.

func NameEqualFold

func NameEqualFold(v string) predicate.Node

NameEqualFold applies the EqualFold predicate on the "name" field.

func NameGT

func NameGT(v string) predicate.Node

NameGT applies the GT predicate on the "name" field.

func NameGTE

func NameGTE(v string) predicate.Node

NameGTE applies the GTE predicate on the "name" field.

func NameHasPrefix

func NameHasPrefix(v string) predicate.Node

NameHasPrefix applies the HasPrefix predicate on the "name" field.

func NameHasSuffix

func NameHasSuffix(v string) predicate.Node

NameHasSuffix applies the HasSuffix predicate on the "name" field.

func NameIn

func NameIn(vs ...string) predicate.Node

NameIn applies the In predicate on the "name" field.

func NameLT

func NameLT(v string) predicate.Node

NameLT applies the LT predicate on the "name" field.

func NameLTE

func NameLTE(v string) predicate.Node

NameLTE applies the LTE predicate on the "name" field.

func NameNEQ

func NameNEQ(v string) predicate.Node

NameNEQ applies the NEQ predicate on the "name" field.

func NameNotIn

func NameNotIn(vs ...string) predicate.Node

NameNotIn applies the NotIn predicate on the "name" field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Node) predicate.Node

Or groups predicates with the OR operator between them.

func Server

func Server(v string) predicate.Node

Server applies equality check predicate on the "server" field. It's identical to ServerEQ.

func ServerContains

func ServerContains(v string) predicate.Node

ServerContains applies the Contains predicate on the "server" field.

func ServerContainsFold

func ServerContainsFold(v string) predicate.Node

ServerContainsFold applies the ContainsFold predicate on the "server" field.

func ServerEQ

func ServerEQ(v string) predicate.Node

ServerEQ applies the EQ predicate on the "server" field.

func ServerEqualFold

func ServerEqualFold(v string) predicate.Node

ServerEqualFold applies the EqualFold predicate on the "server" field.

func ServerGT

func ServerGT(v string) predicate.Node

ServerGT applies the GT predicate on the "server" field.

func ServerGTE

func ServerGTE(v string) predicate.Node

ServerGTE applies the GTE predicate on the "server" field.

func ServerHasPrefix

func ServerHasPrefix(v string) predicate.Node

ServerHasPrefix applies the HasPrefix predicate on the "server" field.

func ServerHasSuffix

func ServerHasSuffix(v string) predicate.Node

ServerHasSuffix applies the HasSuffix predicate on the "server" field.

func ServerIn

func ServerIn(vs ...string) predicate.Node

ServerIn applies the In predicate on the "server" field.

func ServerIsNil

func ServerIsNil() predicate.Node

ServerIsNil applies the IsNil predicate on the "server" field.

func ServerLT

func ServerLT(v string) predicate.Node

ServerLT applies the LT predicate on the "server" field.

func ServerLTE

func ServerLTE(v string) predicate.Node

ServerLTE applies the LTE predicate on the "server" field.

func ServerNEQ

func ServerNEQ(v string) predicate.Node

ServerNEQ applies the NEQ predicate on the "server" field.

func ServerNotIn

func ServerNotIn(vs ...string) predicate.Node

ServerNotIn applies the NotIn predicate on the "server" field.

func ServerNotNil

func ServerNotNil() predicate.Node

ServerNotNil applies the NotNil predicate on the "server" field.

func SettingsIsNil

func SettingsIsNil() predicate.Node

SettingsIsNil applies the IsNil predicate on the "settings" field.

func SettingsNotNil

func SettingsNotNil() predicate.Node

SettingsNotNil applies the NotNil predicate on the "settings" field.

func SlaveKey

func SlaveKey(v string) predicate.Node

SlaveKey applies equality check predicate on the "slave_key" field. It's identical to SlaveKeyEQ.

func SlaveKeyContains

func SlaveKeyContains(v string) predicate.Node

SlaveKeyContains applies the Contains predicate on the "slave_key" field.

func SlaveKeyContainsFold

func SlaveKeyContainsFold(v string) predicate.Node

SlaveKeyContainsFold applies the ContainsFold predicate on the "slave_key" field.

func SlaveKeyEQ

func SlaveKeyEQ(v string) predicate.Node

SlaveKeyEQ applies the EQ predicate on the "slave_key" field.

func SlaveKeyEqualFold

func SlaveKeyEqualFold(v string) predicate.Node

SlaveKeyEqualFold applies the EqualFold predicate on the "slave_key" field.

func SlaveKeyGT

func SlaveKeyGT(v string) predicate.Node

SlaveKeyGT applies the GT predicate on the "slave_key" field.

func SlaveKeyGTE

func SlaveKeyGTE(v string) predicate.Node

SlaveKeyGTE applies the GTE predicate on the "slave_key" field.

func SlaveKeyHasPrefix

func SlaveKeyHasPrefix(v string) predicate.Node

SlaveKeyHasPrefix applies the HasPrefix predicate on the "slave_key" field.

func SlaveKeyHasSuffix

func SlaveKeyHasSuffix(v string) predicate.Node

SlaveKeyHasSuffix applies the HasSuffix predicate on the "slave_key" field.

func SlaveKeyIn

func SlaveKeyIn(vs ...string) predicate.Node

SlaveKeyIn applies the In predicate on the "slave_key" field.

func SlaveKeyIsNil

func SlaveKeyIsNil() predicate.Node

SlaveKeyIsNil applies the IsNil predicate on the "slave_key" field.

func SlaveKeyLT

func SlaveKeyLT(v string) predicate.Node

SlaveKeyLT applies the LT predicate on the "slave_key" field.

func SlaveKeyLTE

func SlaveKeyLTE(v string) predicate.Node

SlaveKeyLTE applies the LTE predicate on the "slave_key" field.

func SlaveKeyNEQ

func SlaveKeyNEQ(v string) predicate.Node

SlaveKeyNEQ applies the NEQ predicate on the "slave_key" field.

func SlaveKeyNotIn

func SlaveKeyNotIn(vs ...string) predicate.Node

SlaveKeyNotIn applies the NotIn predicate on the "slave_key" field.

func SlaveKeyNotNil

func SlaveKeyNotNil() predicate.Node

SlaveKeyNotNil applies the NotNil predicate on the "slave_key" field.

func StatusEQ

func StatusEQ(v Status) predicate.Node

StatusEQ applies the EQ predicate on the "status" field.

func StatusIn

func StatusIn(vs ...Status) predicate.Node

StatusIn applies the In predicate on the "status" field.

func StatusNEQ

func StatusNEQ(v Status) predicate.Node

StatusNEQ applies the NEQ predicate on the "status" field.

func StatusNotIn

func StatusNotIn(vs ...Status) predicate.Node

StatusNotIn applies the NotIn predicate on the "status" field.

func StatusValidator

func StatusValidator(s Status) error

StatusValidator is a validator for the "status" field enum values. It is called by the builders before save.

func TypeEQ

func TypeEQ(v Type) predicate.Node

TypeEQ applies the EQ predicate on the "type" field.

func TypeIn

func TypeIn(vs ...Type) predicate.Node

TypeIn applies the In predicate on the "type" field.

func TypeNEQ

func TypeNEQ(v Type) predicate.Node

TypeNEQ applies the NEQ predicate on the "type" field.

func TypeNotIn

func TypeNotIn(vs ...Type) predicate.Node

TypeNotIn applies the NotIn predicate on the "type" field.

func TypeValidator

func TypeValidator(_type Type) error

TypeValidator is a validator for the "type" field enum values. It is called by the builders before save.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Node

UpdatedAt applies equality check predicate on the "updated_at" field. It's identical to UpdatedAtEQ.

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Node

UpdatedAtEQ applies the EQ predicate on the "updated_at" field.

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Node

UpdatedAtGT applies the GT predicate on the "updated_at" field.

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Node

UpdatedAtGTE applies the GTE predicate on the "updated_at" field.

func UpdatedAtIn

func UpdatedAtIn(vs ...time.Time) predicate.Node

UpdatedAtIn applies the In predicate on the "updated_at" field.

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Node

UpdatedAtLT applies the LT predicate on the "updated_at" field.

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Node

UpdatedAtLTE applies the LTE predicate on the "updated_at" field.

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Node

UpdatedAtNEQ applies the NEQ predicate on the "updated_at" field.

func UpdatedAtNotIn

func UpdatedAtNotIn(vs ...time.Time) predicate.Node

UpdatedAtNotIn applies the NotIn predicate on the "updated_at" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

func Weight

func Weight(v int) predicate.Node

Weight applies equality check predicate on the "weight" field. It's identical to WeightEQ.

func WeightEQ

func WeightEQ(v int) predicate.Node

WeightEQ applies the EQ predicate on the "weight" field.

func WeightGT

func WeightGT(v int) predicate.Node

WeightGT applies the GT predicate on the "weight" field.

func WeightGTE

func WeightGTE(v int) predicate.Node

WeightGTE applies the GTE predicate on the "weight" field.

func WeightIn

func WeightIn(vs ...int) predicate.Node

WeightIn applies the In predicate on the "weight" field.

func WeightLT

func WeightLT(v int) predicate.Node

WeightLT applies the LT predicate on the "weight" field.

func WeightLTE

func WeightLTE(v int) predicate.Node

WeightLTE applies the LTE predicate on the "weight" field.

func WeightNEQ

func WeightNEQ(v int) predicate.Node

WeightNEQ applies the NEQ predicate on the "weight" field.

func WeightNotIn

func WeightNotIn(vs ...int) predicate.Node

WeightNotIn applies the NotIn predicate on the "weight" field.

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Node queries.

func ByCreatedAt

func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption

ByCreatedAt orders the results by the created_at field.

func ByDeletedAt

func ByDeletedAt(opts ...sql.OrderTermOption) OrderOption

ByDeletedAt orders the results by the deleted_at field.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByName

func ByName(opts ...sql.OrderTermOption) OrderOption

ByName orders the results by the name field.

func ByServer

func ByServer(opts ...sql.OrderTermOption) OrderOption

ByServer orders the results by the server field.

func BySlaveKey

func BySlaveKey(opts ...sql.OrderTermOption) OrderOption

BySlaveKey orders the results by the slave_key field.

func ByStatus

func ByStatus(opts ...sql.OrderTermOption) OrderOption

ByStatus orders the results by the status field.

func ByStoragePolicy

func ByStoragePolicy(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByStoragePolicy orders the results by storage_policy terms.

func ByStoragePolicyCount

func ByStoragePolicyCount(opts ...sql.OrderTermOption) OrderOption

ByStoragePolicyCount orders the results by storage_policy count.

func ByType

func ByType(opts ...sql.OrderTermOption) OrderOption

ByType orders the results by the type field.

func ByUpdatedAt

func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption

ByUpdatedAt orders the results by the updated_at field.

func ByWeight

func ByWeight(opts ...sql.OrderTermOption) OrderOption

ByWeight orders the results by the weight field.

type Status

type Status string

Status defines the type for the "status" enum field.

const (
	StatusActive    Status = "active"
	StatusSuspended Status = "suspended"
)

Status values.

func (Status) String

func (s Status) String() string

type Type

type Type string

Type defines the type for the "type" enum field.

const (
	TypeMaster Type = "master"
	TypeSlave  Type = "slave"
)

Type values.

func (Type) String

func (_type Type) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL