share

package
v4.0.0-...-5b82330 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the share type in the database.
	Label = "share"
	// 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"
	// FieldPassword holds the string denoting the password field in the database.
	FieldPassword = "password"
	// FieldViews holds the string denoting the views field in the database.
	FieldViews = "views"
	// FieldDownloads holds the string denoting the downloads field in the database.
	FieldDownloads = "downloads"
	// FieldExpires holds the string denoting the expires field in the database.
	FieldExpires = "expires"
	// FieldRemainDownloads holds the string denoting the remain_downloads field in the database.
	FieldRemainDownloads = "remain_downloads"
	// FieldProps holds the string denoting the props field in the database.
	FieldProps = "props"
	// EdgeUser holds the string denoting the user edge name in mutations.
	EdgeUser = "user"
	// EdgeFile holds the string denoting the file edge name in mutations.
	EdgeFile = "file"
	// Table holds the table name of the share in the database.
	Table = "shares"
	// UserTable is the table that holds the user relation/edge.
	UserTable = "shares"
	// UserInverseTable is the table name for the User entity.
	// It exists in this package in order to avoid circular dependency with the "user" package.
	UserInverseTable = "users"
	// UserColumn is the table column denoting the user relation/edge.
	UserColumn = "user_shares"
	// FileTable is the table that holds the file relation/edge.
	FileTable = "shares"
	// FileInverseTable is the table name for the File entity.
	// It exists in this package in order to avoid circular dependency with the "file" package.
	FileInverseTable = "files"
	// FileColumn is the table column denoting the file relation/edge.
	FileColumn = "file_shares"
)

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
	// DefaultViews holds the default value on creation for the "views" field.
	DefaultViews int
	// DefaultDownloads holds the default value on creation for the "downloads" field.
	DefaultDownloads 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 share fields.

View Source
var ForeignKeys = []string{
	"file_shares",
	"user_shares",
}

ForeignKeys holds the SQL foreign-keys that are owned by the "shares" table and are not defined as standalone fields in the schema.

Functions

func And

func And(predicates ...predicate.Share) predicate.Share

And groups predicates with the AND operator between them.

func CreatedAt

func CreatedAt(v time.Time) predicate.Share

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

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Share

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

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Share

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

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Share

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

func CreatedAtIn

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

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

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Share

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

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Share

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

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Share

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

func CreatedAtNotIn

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

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

func DeletedAt

func DeletedAt(v time.Time) predicate.Share

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

func DeletedAtEQ

func DeletedAtEQ(v time.Time) predicate.Share

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

func DeletedAtGT

func DeletedAtGT(v time.Time) predicate.Share

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

func DeletedAtGTE

func DeletedAtGTE(v time.Time) predicate.Share

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

func DeletedAtIn

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

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

func DeletedAtIsNil

func DeletedAtIsNil() predicate.Share

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

func DeletedAtLT

func DeletedAtLT(v time.Time) predicate.Share

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

func DeletedAtLTE

func DeletedAtLTE(v time.Time) predicate.Share

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

func DeletedAtNEQ

func DeletedAtNEQ(v time.Time) predicate.Share

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

func DeletedAtNotIn

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

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

func DeletedAtNotNil

func DeletedAtNotNil() predicate.Share

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

func Downloads

func Downloads(v int) predicate.Share

Downloads applies equality check predicate on the "downloads" field. It's identical to DownloadsEQ.

func DownloadsEQ

func DownloadsEQ(v int) predicate.Share

DownloadsEQ applies the EQ predicate on the "downloads" field.

func DownloadsGT

func DownloadsGT(v int) predicate.Share

DownloadsGT applies the GT predicate on the "downloads" field.

func DownloadsGTE

func DownloadsGTE(v int) predicate.Share

DownloadsGTE applies the GTE predicate on the "downloads" field.

func DownloadsIn

func DownloadsIn(vs ...int) predicate.Share

DownloadsIn applies the In predicate on the "downloads" field.

func DownloadsLT

func DownloadsLT(v int) predicate.Share

DownloadsLT applies the LT predicate on the "downloads" field.

func DownloadsLTE

func DownloadsLTE(v int) predicate.Share

DownloadsLTE applies the LTE predicate on the "downloads" field.

func DownloadsNEQ

func DownloadsNEQ(v int) predicate.Share

DownloadsNEQ applies the NEQ predicate on the "downloads" field.

func DownloadsNotIn

func DownloadsNotIn(vs ...int) predicate.Share

DownloadsNotIn applies the NotIn predicate on the "downloads" field.

func Expires

func Expires(v time.Time) predicate.Share

Expires applies equality check predicate on the "expires" field. It's identical to ExpiresEQ.

func ExpiresEQ

func ExpiresEQ(v time.Time) predicate.Share

ExpiresEQ applies the EQ predicate on the "expires" field.

func ExpiresGT

func ExpiresGT(v time.Time) predicate.Share

ExpiresGT applies the GT predicate on the "expires" field.

func ExpiresGTE

func ExpiresGTE(v time.Time) predicate.Share

ExpiresGTE applies the GTE predicate on the "expires" field.

func ExpiresIn

func ExpiresIn(vs ...time.Time) predicate.Share

ExpiresIn applies the In predicate on the "expires" field.

func ExpiresIsNil

func ExpiresIsNil() predicate.Share

ExpiresIsNil applies the IsNil predicate on the "expires" field.

func ExpiresLT

func ExpiresLT(v time.Time) predicate.Share

ExpiresLT applies the LT predicate on the "expires" field.

func ExpiresLTE

func ExpiresLTE(v time.Time) predicate.Share

ExpiresLTE applies the LTE predicate on the "expires" field.

func ExpiresNEQ

func ExpiresNEQ(v time.Time) predicate.Share

ExpiresNEQ applies the NEQ predicate on the "expires" field.

func ExpiresNotIn

func ExpiresNotIn(vs ...time.Time) predicate.Share

ExpiresNotIn applies the NotIn predicate on the "expires" field.

func ExpiresNotNil

func ExpiresNotNil() predicate.Share

ExpiresNotNil applies the NotNil predicate on the "expires" field.

func HasFile

func HasFile() predicate.Share

HasFile applies the HasEdge predicate on the "file" edge.

func HasFileWith

func HasFileWith(preds ...predicate.File) predicate.Share

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

func HasUser

func HasUser() predicate.Share

HasUser applies the HasEdge predicate on the "user" edge.

func HasUserWith

func HasUserWith(preds ...predicate.User) predicate.Share

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

func ID

func ID(id int) predicate.Share

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Share

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Share

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Share

IDGTE applies the GTE predicate on the ID field.

func IDIn

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

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Share

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Share

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Share

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

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

IDNotIn applies the NotIn predicate on the ID field.

func Not

Not applies the not operator on the given predicate.

func Or

func Or(predicates ...predicate.Share) predicate.Share

Or groups predicates with the OR operator between them.

func Password

func Password(v string) predicate.Share

Password applies equality check predicate on the "password" field. It's identical to PasswordEQ.

func PasswordContains

func PasswordContains(v string) predicate.Share

PasswordContains applies the Contains predicate on the "password" field.

func PasswordContainsFold

func PasswordContainsFold(v string) predicate.Share

PasswordContainsFold applies the ContainsFold predicate on the "password" field.

func PasswordEQ

func PasswordEQ(v string) predicate.Share

PasswordEQ applies the EQ predicate on the "password" field.

func PasswordEqualFold

func PasswordEqualFold(v string) predicate.Share

PasswordEqualFold applies the EqualFold predicate on the "password" field.

func PasswordGT

func PasswordGT(v string) predicate.Share

PasswordGT applies the GT predicate on the "password" field.

func PasswordGTE

func PasswordGTE(v string) predicate.Share

PasswordGTE applies the GTE predicate on the "password" field.

func PasswordHasPrefix

func PasswordHasPrefix(v string) predicate.Share

PasswordHasPrefix applies the HasPrefix predicate on the "password" field.

func PasswordHasSuffix

func PasswordHasSuffix(v string) predicate.Share

PasswordHasSuffix applies the HasSuffix predicate on the "password" field.

func PasswordIn

func PasswordIn(vs ...string) predicate.Share

PasswordIn applies the In predicate on the "password" field.

func PasswordIsNil

func PasswordIsNil() predicate.Share

PasswordIsNil applies the IsNil predicate on the "password" field.

func PasswordLT

func PasswordLT(v string) predicate.Share

PasswordLT applies the LT predicate on the "password" field.

func PasswordLTE

func PasswordLTE(v string) predicate.Share

PasswordLTE applies the LTE predicate on the "password" field.

func PasswordNEQ

func PasswordNEQ(v string) predicate.Share

PasswordNEQ applies the NEQ predicate on the "password" field.

func PasswordNotIn

func PasswordNotIn(vs ...string) predicate.Share

PasswordNotIn applies the NotIn predicate on the "password" field.

func PasswordNotNil

func PasswordNotNil() predicate.Share

PasswordNotNil applies the NotNil predicate on the "password" field.

func PropsIsNil

func PropsIsNil() predicate.Share

PropsIsNil applies the IsNil predicate on the "props" field.

func PropsNotNil

func PropsNotNil() predicate.Share

PropsNotNil applies the NotNil predicate on the "props" field.

func RemainDownloads

func RemainDownloads(v int) predicate.Share

RemainDownloads applies equality check predicate on the "remain_downloads" field. It's identical to RemainDownloadsEQ.

func RemainDownloadsEQ

func RemainDownloadsEQ(v int) predicate.Share

RemainDownloadsEQ applies the EQ predicate on the "remain_downloads" field.

func RemainDownloadsGT

func RemainDownloadsGT(v int) predicate.Share

RemainDownloadsGT applies the GT predicate on the "remain_downloads" field.

func RemainDownloadsGTE

func RemainDownloadsGTE(v int) predicate.Share

RemainDownloadsGTE applies the GTE predicate on the "remain_downloads" field.

func RemainDownloadsIn

func RemainDownloadsIn(vs ...int) predicate.Share

RemainDownloadsIn applies the In predicate on the "remain_downloads" field.

func RemainDownloadsIsNil

func RemainDownloadsIsNil() predicate.Share

RemainDownloadsIsNil applies the IsNil predicate on the "remain_downloads" field.

func RemainDownloadsLT

func RemainDownloadsLT(v int) predicate.Share

RemainDownloadsLT applies the LT predicate on the "remain_downloads" field.

func RemainDownloadsLTE

func RemainDownloadsLTE(v int) predicate.Share

RemainDownloadsLTE applies the LTE predicate on the "remain_downloads" field.

func RemainDownloadsNEQ

func RemainDownloadsNEQ(v int) predicate.Share

RemainDownloadsNEQ applies the NEQ predicate on the "remain_downloads" field.

func RemainDownloadsNotIn

func RemainDownloadsNotIn(vs ...int) predicate.Share

RemainDownloadsNotIn applies the NotIn predicate on the "remain_downloads" field.

func RemainDownloadsNotNil

func RemainDownloadsNotNil() predicate.Share

RemainDownloadsNotNil applies the NotNil predicate on the "remain_downloads" field.

func UpdatedAt

func UpdatedAt(v time.Time) predicate.Share

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

func UpdatedAtEQ

func UpdatedAtEQ(v time.Time) predicate.Share

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

func UpdatedAtGT

func UpdatedAtGT(v time.Time) predicate.Share

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

func UpdatedAtGTE

func UpdatedAtGTE(v time.Time) predicate.Share

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

func UpdatedAtIn

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

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

func UpdatedAtLT

func UpdatedAtLT(v time.Time) predicate.Share

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

func UpdatedAtLTE

func UpdatedAtLTE(v time.Time) predicate.Share

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

func UpdatedAtNEQ

func UpdatedAtNEQ(v time.Time) predicate.Share

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

func UpdatedAtNotIn

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

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 Views

func Views(v int) predicate.Share

Views applies equality check predicate on the "views" field. It's identical to ViewsEQ.

func ViewsEQ

func ViewsEQ(v int) predicate.Share

ViewsEQ applies the EQ predicate on the "views" field.

func ViewsGT

func ViewsGT(v int) predicate.Share

ViewsGT applies the GT predicate on the "views" field.

func ViewsGTE

func ViewsGTE(v int) predicate.Share

ViewsGTE applies the GTE predicate on the "views" field.

func ViewsIn

func ViewsIn(vs ...int) predicate.Share

ViewsIn applies the In predicate on the "views" field.

func ViewsLT

func ViewsLT(v int) predicate.Share

ViewsLT applies the LT predicate on the "views" field.

func ViewsLTE

func ViewsLTE(v int) predicate.Share

ViewsLTE applies the LTE predicate on the "views" field.

func ViewsNEQ

func ViewsNEQ(v int) predicate.Share

ViewsNEQ applies the NEQ predicate on the "views" field.

func ViewsNotIn

func ViewsNotIn(vs ...int) predicate.Share

ViewsNotIn applies the NotIn predicate on the "views" field.

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Share 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 ByDownloads

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

ByDownloads orders the results by the downloads field.

func ByExpires

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

ByExpires orders the results by the expires field.

func ByFileField

func ByFileField(field string, opts ...sql.OrderTermOption) OrderOption

ByFileField orders the results by file field.

func ByID

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

ByID orders the results by the id field.

func ByPassword

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

ByPassword orders the results by the password field.

func ByRemainDownloads

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

ByRemainDownloads orders the results by the remain_downloads field.

func ByUpdatedAt

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

ByUpdatedAt orders the results by the updated_at field.

func ByUserField

func ByUserField(field string, opts ...sql.OrderTermOption) OrderOption

ByUserField orders the results by user field.

func ByViews

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

ByViews orders the results by the views field.

Jump to

Keyboard shortcuts

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