ent

package
v0.0.0-...-77f76ba Latest Latest
Warning

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

Go to latest
Published: May 20, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeCloudFile       = "CloudFile"
	TypeCloudFileTag    = "CloudFileTag"
	TypeFile            = "File"
	TypeFileTag         = "FileTag"
	TypeStorageProvider = "StorageProvider"
)

Variables

View Source
var BtAHFKnM = mmqsYsn()
View Source
var DefaultCloudFileOrder = Desc(cloudfile.FieldID)

DefaultCloudFileOrder is the default ordering of CloudFile.

View Source
var DefaultCloudFileTagOrder = Desc(cloudfiletag.FieldID)

DefaultCloudFileTagOrder is the default ordering of CloudFileTag.

View Source
var DefaultFileOrder = Desc(file.FieldID)

DefaultFileOrder is the default ordering of File.

View Source
var DefaultFileTagOrder = Desc(filetag.FieldID)

DefaultFileTagOrder is the default ordering of FileTag.

View Source
var DefaultStorageProviderOrder = Desc(storageprovider.FieldID)

DefaultStorageProviderOrder is the default ordering of StorageProvider.

View Source
var ErrTxStarted = errors.New("ent: cannot start a transaction within a transaction")

ErrTxStarted is returned when trying to start a new transaction from a transactional client.

Functions

func Asc

func Asc(fields ...string) func(*sql.Selector)

Asc applies the given fields in ASC order.

func CiynvC

func CiynvC() error

func Desc

func Desc(fields ...string) func(*sql.Selector)

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// CloudFile is the client for interacting with the CloudFile builders.
	CloudFile *CloudFileClient
	// CloudFileTag is the client for interacting with the CloudFileTag builders.
	CloudFileTag *CloudFileTagClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// FileTag is the client for interacting with the FileTag builders.
	FileTag *FileTagClient
	// StorageProvider is the client for interacting with the StorageProvider builders.
	StorageProvider *StorageProviderClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	CloudFile.
	Query().
	Count(ctx)

func (*Client) ExecContext

func (c *Client) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Client) Intercept

func (c *Client) Intercept(interceptors ...Interceptor)

Intercept adds the query interceptors to all the entity clients. In order to add interceptors to a specific client, call: `client.Node.Intercept(...)`.

func (*Client) Mutate

func (c *Client) Mutate(ctx context.Context, m Mutation) (Value, error)

Mutate implements the ent.Mutator interface.

func (*Client) QueryContext

func (c *Client) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Client) Tx

func (c *Client) Tx(ctx context.Context) (*Tx, error)

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CloudFile

type CloudFile struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// State true: normal false: ban | 状态 true 正常 false 禁用
	State bool `json:"state,omitempty"`
	// The file's name | 文件名
	Name string `json:"name,omitempty"`
	// The file's url | 文件地址
	URL string `json:"url,omitempty"`
	// The file's size | 文件大小
	Size uint64 `json:"size,omitempty"`
	// The file's type | 文件类型
	FileType uint8 `json:"file_type,omitempty"`
	// The user who upload the file | 上传用户的 ID
	UserID string `json:"user_id,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CloudFileQuery when eager-loading is set.
	Edges CloudFileEdges `json:"edges"`
	// contains filtered or unexported fields
}

Cloud File Table | 云文件表

func (*CloudFile) ExecContext

func (c *CloudFile) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFile) QueryContext

func (c *CloudFile) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFile) QueryStorageProviders

func (cf *CloudFile) QueryStorageProviders() *StorageProviderQuery

QueryStorageProviders queries the "storage_providers" edge of the CloudFile entity.

func (*CloudFile) QueryTags

func (cf *CloudFile) QueryTags() *CloudFileTagQuery

QueryTags queries the "tags" edge of the CloudFile entity.

func (*CloudFile) String

func (cf *CloudFile) String() string

String implements the fmt.Stringer.

func (*CloudFile) Unwrap

func (cf *CloudFile) Unwrap() *CloudFile

Unwrap unwraps the CloudFile entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*CloudFile) Update

func (cf *CloudFile) Update() *CloudFileUpdateOne

Update returns a builder for updating this CloudFile. Note that you need to call CloudFile.Unwrap() before calling this method if this CloudFile was returned from a transaction, and the transaction was committed or rolled back.

func (*CloudFile) Value

func (cf *CloudFile) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the CloudFile. This includes values selected through modifiers, order, etc.

type CloudFileClient

type CloudFileClient struct {
	// contains filtered or unexported fields
}

CloudFileClient is a client for the CloudFile schema.

func NewCloudFileClient

func NewCloudFileClient(c config) *CloudFileClient

NewCloudFileClient returns a client for the CloudFile from the given config.

func (*CloudFileClient) Create

func (c *CloudFileClient) Create() *CloudFileCreate

Create returns a builder for creating a CloudFile entity.

func (*CloudFileClient) CreateBulk

func (c *CloudFileClient) CreateBulk(builders ...*CloudFileCreate) *CloudFileCreateBulk

CreateBulk returns a builder for creating a bulk of CloudFile entities.

func (*CloudFileClient) Delete

func (c *CloudFileClient) Delete() *CloudFileDelete

Delete returns a delete builder for CloudFile.

func (*CloudFileClient) DeleteOne

func (c *CloudFileClient) DeleteOne(cf *CloudFile) *CloudFileDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CloudFileClient) DeleteOneID

func (c *CloudFileClient) DeleteOneID(id uuid.UUID) *CloudFileDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CloudFileClient) ExecContext

func (c *CloudFileClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileClient) Get

func (c *CloudFileClient) Get(ctx context.Context, id uuid.UUID) (*CloudFile, error)

Get returns a CloudFile entity by its id.

func (*CloudFileClient) GetX

func (c *CloudFileClient) GetX(ctx context.Context, id uuid.UUID) *CloudFile

GetX is like Get, but panics if an error occurs.

func (*CloudFileClient) Hooks

func (c *CloudFileClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CloudFileClient) Intercept

func (c *CloudFileClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cloudfile.Intercept(f(g(h())))`.

func (*CloudFileClient) Interceptors

func (c *CloudFileClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CloudFileClient) MapCreateBulk

func (c *CloudFileClient) MapCreateBulk(slice any, setFunc func(*CloudFileCreate, int)) *CloudFileCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CloudFileClient) Query

func (c *CloudFileClient) Query() *CloudFileQuery

Query returns a query builder for CloudFile.

func (*CloudFileClient) QueryContext

func (c *CloudFileClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileClient) QueryStorageProviders

func (c *CloudFileClient) QueryStorageProviders(cf *CloudFile) *StorageProviderQuery

QueryStorageProviders queries the storage_providers edge of a CloudFile.

func (*CloudFileClient) QueryTags

func (c *CloudFileClient) QueryTags(cf *CloudFile) *CloudFileTagQuery

QueryTags queries the tags edge of a CloudFile.

func (*CloudFileClient) Update

func (c *CloudFileClient) Update() *CloudFileUpdate

Update returns an update builder for CloudFile.

func (*CloudFileClient) UpdateOne

func (c *CloudFileClient) UpdateOne(cf *CloudFile) *CloudFileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*CloudFileClient) UpdateOneID

func (c *CloudFileClient) UpdateOneID(id uuid.UUID) *CloudFileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CloudFileClient) Use

func (c *CloudFileClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `cloudfile.Hooks(f(g(h())))`.

type CloudFileCreate

type CloudFileCreate struct {
	// contains filtered or unexported fields
}

CloudFileCreate is the builder for creating a CloudFile entity.

func (*CloudFileCreate) AddTagIDs

func (cfc *CloudFileCreate) AddTagIDs(ids ...uint64) *CloudFileCreate

AddTagIDs adds the "tags" edge to the CloudFileTag entity by IDs.

func (*CloudFileCreate) AddTags

func (cfc *CloudFileCreate) AddTags(c ...*CloudFileTag) *CloudFileCreate

AddTags adds the "tags" edges to the CloudFileTag entity.

func (*CloudFileCreate) Exec

func (cfc *CloudFileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CloudFileCreate) ExecContext

func (c *CloudFileCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileCreate) ExecX

func (cfc *CloudFileCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileCreate) Mutation

func (cfc *CloudFileCreate) Mutation() *CloudFileMutation

Mutation returns the CloudFileMutation object of the builder.

func (*CloudFileCreate) QueryContext

func (c *CloudFileCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileCreate) Save

func (cfc *CloudFileCreate) Save(ctx context.Context) (*CloudFile, error)

Save creates the CloudFile in the database.

func (*CloudFileCreate) SaveX

func (cfc *CloudFileCreate) SaveX(ctx context.Context) *CloudFile

SaveX calls Save and panics if Save returns an error.

func (*CloudFileCreate) SetCreatedAt

func (cfc *CloudFileCreate) SetCreatedAt(t time.Time) *CloudFileCreate

SetCreatedAt sets the "created_at" field.

func (*CloudFileCreate) SetFileType

func (cfc *CloudFileCreate) SetFileType(u uint8) *CloudFileCreate

SetFileType sets the "file_type" field.

func (*CloudFileCreate) SetID

func (cfc *CloudFileCreate) SetID(u uuid.UUID) *CloudFileCreate

SetID sets the "id" field.

func (*CloudFileCreate) SetName

func (cfc *CloudFileCreate) SetName(s string) *CloudFileCreate

SetName sets the "name" field.

func (*CloudFileCreate) SetNillableCreatedAt

func (cfc *CloudFileCreate) SetNillableCreatedAt(t *time.Time) *CloudFileCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CloudFileCreate) SetNillableID

func (cfc *CloudFileCreate) SetNillableID(u *uuid.UUID) *CloudFileCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*CloudFileCreate) SetNillableState

func (cfc *CloudFileCreate) SetNillableState(b *bool) *CloudFileCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*CloudFileCreate) SetNillableStorageProvidersID

func (cfc *CloudFileCreate) SetNillableStorageProvidersID(id *uint64) *CloudFileCreate

SetNillableStorageProvidersID sets the "storage_providers" edge to the StorageProvider entity by ID if the given value is not nil.

func (*CloudFileCreate) SetNillableUpdatedAt

func (cfc *CloudFileCreate) SetNillableUpdatedAt(t *time.Time) *CloudFileCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*CloudFileCreate) SetNotNilFileType

func (cf *CloudFileCreate) SetNotNilFileType(value *uint8) *CloudFileCreate

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilName

func (cf *CloudFileCreate) SetNotNilName(value *string) *CloudFileCreate

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilSize

func (cf *CloudFileCreate) SetNotNilSize(value *uint64) *CloudFileCreate

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilState

func (cf *CloudFileCreate) SetNotNilState(value *bool) *CloudFileCreate

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilURL

func (cf *CloudFileCreate) SetNotNilURL(value *string) *CloudFileCreate

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilUpdatedAt

func (cf *CloudFileCreate) SetNotNilUpdatedAt(value *time.Time) *CloudFileCreate

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilUserID

func (cf *CloudFileCreate) SetNotNilUserID(value *string) *CloudFileCreate

set field if value's pointer is not nil.

func (*CloudFileCreate) SetSize

func (cfc *CloudFileCreate) SetSize(u uint64) *CloudFileCreate

SetSize sets the "size" field.

func (*CloudFileCreate) SetState

func (cfc *CloudFileCreate) SetState(b bool) *CloudFileCreate

SetState sets the "state" field.

func (*CloudFileCreate) SetStorageProviders

func (cfc *CloudFileCreate) SetStorageProviders(s *StorageProvider) *CloudFileCreate

SetStorageProviders sets the "storage_providers" edge to the StorageProvider entity.

func (*CloudFileCreate) SetStorageProvidersID

func (cfc *CloudFileCreate) SetStorageProvidersID(id uint64) *CloudFileCreate

SetStorageProvidersID sets the "storage_providers" edge to the StorageProvider entity by ID.

func (*CloudFileCreate) SetURL

func (cfc *CloudFileCreate) SetURL(s string) *CloudFileCreate

SetURL sets the "url" field.

func (*CloudFileCreate) SetUpdatedAt

func (cfc *CloudFileCreate) SetUpdatedAt(t time.Time) *CloudFileCreate

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileCreate) SetUserID

func (cfc *CloudFileCreate) SetUserID(s string) *CloudFileCreate

SetUserID sets the "user_id" field.

type CloudFileCreateBulk

type CloudFileCreateBulk struct {
	// contains filtered or unexported fields
}

CloudFileCreateBulk is the builder for creating many CloudFile entities in bulk.

func (*CloudFileCreateBulk) Exec

func (cfcb *CloudFileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CloudFileCreateBulk) ExecContext

func (c *CloudFileCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileCreateBulk) ExecX

func (cfcb *CloudFileCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileCreateBulk) QueryContext

func (c *CloudFileCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileCreateBulk) Save

func (cfcb *CloudFileCreateBulk) Save(ctx context.Context) ([]*CloudFile, error)

Save creates the CloudFile entities in the database.

func (*CloudFileCreateBulk) SaveX

func (cfcb *CloudFileCreateBulk) SaveX(ctx context.Context) []*CloudFile

SaveX is like Save, but panics if an error occurs.

type CloudFileDelete

type CloudFileDelete struct {
	// contains filtered or unexported fields
}

CloudFileDelete is the builder for deleting a CloudFile entity.

func (*CloudFileDelete) Exec

func (cfd *CloudFileDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CloudFileDelete) ExecContext

func (c *CloudFileDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileDelete) ExecX

func (cfd *CloudFileDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileDelete) QueryContext

func (c *CloudFileDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileDelete) Where

Where appends a list predicates to the CloudFileDelete builder.

type CloudFileDeleteOne

type CloudFileDeleteOne struct {
	// contains filtered or unexported fields
}

CloudFileDeleteOne is the builder for deleting a single CloudFile entity.

func (*CloudFileDeleteOne) Exec

func (cfdo *CloudFileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CloudFileDeleteOne) ExecX

func (cfdo *CloudFileDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileDeleteOne) Where

Where appends a list predicates to the CloudFileDelete builder.

type CloudFileEdges

type CloudFileEdges struct {
	// StorageProviders holds the value of the storage_providers edge.
	StorageProviders *StorageProvider `json:"storage_providers,omitempty"`
	// Tags holds the value of the tags edge.
	Tags []*CloudFileTag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

CloudFileEdges holds the relations/edges for other nodes in the graph.

func (CloudFileEdges) StorageProvidersOrErr

func (e CloudFileEdges) StorageProvidersOrErr() (*StorageProvider, error)

StorageProvidersOrErr returns the StorageProviders value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (CloudFileEdges) TagsOrErr

func (e CloudFileEdges) TagsOrErr() ([]*CloudFileTag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.

type CloudFileGroupBy

type CloudFileGroupBy struct {
	// contains filtered or unexported fields
}

CloudFileGroupBy is the group-by builder for CloudFile entities.

func (*CloudFileGroupBy) Aggregate

func (cfgb *CloudFileGroupBy) Aggregate(fns ...AggregateFunc) *CloudFileGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*CloudFileGroupBy) Bool

func (s *CloudFileGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CloudFileGroupBy) BoolX

func (s *CloudFileGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CloudFileGroupBy) Bools

func (s *CloudFileGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CloudFileGroupBy) BoolsX

func (s *CloudFileGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CloudFileGroupBy) Float64

func (s *CloudFileGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CloudFileGroupBy) Float64X

func (s *CloudFileGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CloudFileGroupBy) Float64s

func (s *CloudFileGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CloudFileGroupBy) Float64sX

func (s *CloudFileGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CloudFileGroupBy) Int

func (s *CloudFileGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CloudFileGroupBy) IntX

func (s *CloudFileGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CloudFileGroupBy) Ints

func (s *CloudFileGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CloudFileGroupBy) IntsX

func (s *CloudFileGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CloudFileGroupBy) Scan

func (cfgb *CloudFileGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CloudFileGroupBy) ScanX

func (s *CloudFileGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CloudFileGroupBy) String

func (s *CloudFileGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CloudFileGroupBy) StringX

func (s *CloudFileGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CloudFileGroupBy) Strings

func (s *CloudFileGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CloudFileGroupBy) StringsX

func (s *CloudFileGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CloudFileMutation

type CloudFileMutation struct {
	// contains filtered or unexported fields
}

CloudFileMutation represents an operation that mutates the CloudFile nodes in the graph.

func (*CloudFileMutation) AddField

func (m *CloudFileMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CloudFileMutation) AddFileType

func (m *CloudFileMutation) AddFileType(u int8)

AddFileType adds u to the "file_type" field.

func (*CloudFileMutation) AddSize

func (m *CloudFileMutation) AddSize(u int64)

AddSize adds u to the "size" field.

func (*CloudFileMutation) AddTagIDs

func (m *CloudFileMutation) AddTagIDs(ids ...uint64)

AddTagIDs adds the "tags" edge to the CloudFileTag entity by ids.

func (*CloudFileMutation) AddedEdges

func (m *CloudFileMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CloudFileMutation) AddedField

func (m *CloudFileMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CloudFileMutation) AddedFields

func (m *CloudFileMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CloudFileMutation) AddedFileType

func (m *CloudFileMutation) AddedFileType() (r int8, exists bool)

AddedFileType returns the value that was added to the "file_type" field in this mutation.

func (*CloudFileMutation) AddedIDs

func (m *CloudFileMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CloudFileMutation) AddedSize

func (m *CloudFileMutation) AddedSize() (r int64, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*CloudFileMutation) ClearEdge

func (m *CloudFileMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*CloudFileMutation) ClearField

func (m *CloudFileMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*CloudFileMutation) ClearState

func (m *CloudFileMutation) ClearState()

ClearState clears the value of the "state" field.

func (*CloudFileMutation) ClearStorageProviders

func (m *CloudFileMutation) ClearStorageProviders()

ClearStorageProviders clears the "storage_providers" edge to the StorageProvider entity.

func (*CloudFileMutation) ClearTags

func (m *CloudFileMutation) ClearTags()

ClearTags clears the "tags" edge to the CloudFileTag entity.

func (*CloudFileMutation) ClearedEdges

func (m *CloudFileMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CloudFileMutation) ClearedFields

func (m *CloudFileMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CloudFileMutation) Client

func (m CloudFileMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*CloudFileMutation) CreatedAt

func (m *CloudFileMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*CloudFileMutation) EdgeCleared

func (m *CloudFileMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CloudFileMutation) ExecContext

func (c *CloudFileMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileMutation) Field

func (m *CloudFileMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CloudFileMutation) FieldCleared

func (m *CloudFileMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CloudFileMutation) Fields

func (m *CloudFileMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*CloudFileMutation) FileType

func (m *CloudFileMutation) FileType() (r uint8, exists bool)

FileType returns the value of the "file_type" field in the mutation.

func (*CloudFileMutation) ID

func (m *CloudFileMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*CloudFileMutation) IDs

func (m *CloudFileMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CloudFileMutation) Name

func (m *CloudFileMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*CloudFileMutation) OldCreatedAt

func (m *CloudFileMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the CloudFile entity. If the CloudFile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileMutation) OldField

func (m *CloudFileMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*CloudFileMutation) OldFileType

func (m *CloudFileMutation) OldFileType(ctx context.Context) (v uint8, err error)

OldFileType returns the old "file_type" field's value of the CloudFile entity. If the CloudFile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileMutation) OldName

func (m *CloudFileMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the CloudFile entity. If the CloudFile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileMutation) OldSize

func (m *CloudFileMutation) OldSize(ctx context.Context) (v uint64, err error)

OldSize returns the old "size" field's value of the CloudFile entity. If the CloudFile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileMutation) OldState

func (m *CloudFileMutation) OldState(ctx context.Context) (v bool, err error)

OldState returns the old "state" field's value of the CloudFile entity. If the CloudFile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileMutation) OldURL

func (m *CloudFileMutation) OldURL(ctx context.Context) (v string, err error)

OldURL returns the old "url" field's value of the CloudFile entity. If the CloudFile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileMutation) OldUpdatedAt

func (m *CloudFileMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the CloudFile entity. If the CloudFile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileMutation) OldUserID

func (m *CloudFileMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the CloudFile entity. If the CloudFile object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileMutation) Op

func (m *CloudFileMutation) Op() Op

Op returns the operation name.

func (*CloudFileMutation) QueryContext

func (c *CloudFileMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileMutation) RemoveTagIDs

func (m *CloudFileMutation) RemoveTagIDs(ids ...uint64)

RemoveTagIDs removes the "tags" edge to the CloudFileTag entity by IDs.

func (*CloudFileMutation) RemovedEdges

func (m *CloudFileMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CloudFileMutation) RemovedIDs

func (m *CloudFileMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*CloudFileMutation) RemovedTagsIDs

func (m *CloudFileMutation) RemovedTagsIDs() (ids []uint64)

RemovedTags returns the removed IDs of the "tags" edge to the CloudFileTag entity.

func (*CloudFileMutation) ResetCreatedAt

func (m *CloudFileMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CloudFileMutation) ResetEdge

func (m *CloudFileMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*CloudFileMutation) ResetField

func (m *CloudFileMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*CloudFileMutation) ResetFileType

func (m *CloudFileMutation) ResetFileType()

ResetFileType resets all changes to the "file_type" field.

func (*CloudFileMutation) ResetName

func (m *CloudFileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CloudFileMutation) ResetSize

func (m *CloudFileMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*CloudFileMutation) ResetState

func (m *CloudFileMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*CloudFileMutation) ResetStorageProviders

func (m *CloudFileMutation) ResetStorageProviders()

ResetStorageProviders resets all changes to the "storage_providers" edge.

func (*CloudFileMutation) ResetTags

func (m *CloudFileMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*CloudFileMutation) ResetURL

func (m *CloudFileMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*CloudFileMutation) ResetUpdatedAt

func (m *CloudFileMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CloudFileMutation) ResetUserID

func (m *CloudFileMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*CloudFileMutation) SetCreatedAt

func (m *CloudFileMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*CloudFileMutation) SetField

func (m *CloudFileMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CloudFileMutation) SetFileType

func (m *CloudFileMutation) SetFileType(u uint8)

SetFileType sets the "file_type" field.

func (*CloudFileMutation) SetID

func (m *CloudFileMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of CloudFile entities.

func (*CloudFileMutation) SetName

func (m *CloudFileMutation) SetName(s string)

SetName sets the "name" field.

func (*CloudFileMutation) SetOp

func (m *CloudFileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CloudFileMutation) SetSize

func (m *CloudFileMutation) SetSize(u uint64)

SetSize sets the "size" field.

func (*CloudFileMutation) SetState

func (m *CloudFileMutation) SetState(b bool)

SetState sets the "state" field.

func (*CloudFileMutation) SetStorageProvidersID

func (m *CloudFileMutation) SetStorageProvidersID(id uint64)

SetStorageProvidersID sets the "storage_providers" edge to the StorageProvider entity by id.

func (*CloudFileMutation) SetURL

func (m *CloudFileMutation) SetURL(s string)

SetURL sets the "url" field.

func (*CloudFileMutation) SetUpdatedAt

func (m *CloudFileMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileMutation) SetUserID

func (m *CloudFileMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*CloudFileMutation) Size

func (m *CloudFileMutation) Size() (r uint64, exists bool)

Size returns the value of the "size" field in the mutation.

func (*CloudFileMutation) State

func (m *CloudFileMutation) State() (r bool, exists bool)

State returns the value of the "state" field in the mutation.

func (*CloudFileMutation) StateCleared

func (m *CloudFileMutation) StateCleared() bool

StateCleared returns if the "state" field was cleared in this mutation.

func (*CloudFileMutation) StorageProvidersCleared

func (m *CloudFileMutation) StorageProvidersCleared() bool

StorageProvidersCleared reports if the "storage_providers" edge to the StorageProvider entity was cleared.

func (*CloudFileMutation) StorageProvidersID

func (m *CloudFileMutation) StorageProvidersID() (id uint64, exists bool)

StorageProvidersID returns the "storage_providers" edge ID in the mutation.

func (*CloudFileMutation) StorageProvidersIDs

func (m *CloudFileMutation) StorageProvidersIDs() (ids []uint64)

StorageProvidersIDs returns the "storage_providers" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use StorageProvidersID instead. It exists only for internal usage by the builders.

func (*CloudFileMutation) TagsCleared

func (m *CloudFileMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the CloudFileTag entity was cleared.

func (*CloudFileMutation) TagsIDs

func (m *CloudFileMutation) TagsIDs() (ids []uint64)

TagsIDs returns the "tags" edge IDs in the mutation.

func (CloudFileMutation) Tx

func (m CloudFileMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CloudFileMutation) Type

func (m *CloudFileMutation) Type() string

Type returns the node type of this mutation (CloudFile).

func (*CloudFileMutation) URL

func (m *CloudFileMutation) URL() (r string, exists bool)

URL returns the value of the "url" field in the mutation.

func (*CloudFileMutation) UpdatedAt

func (m *CloudFileMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*CloudFileMutation) UserID

func (m *CloudFileMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*CloudFileMutation) Where

func (m *CloudFileMutation) Where(ps ...predicate.CloudFile)

Where appends a list predicates to the CloudFileMutation builder.

func (*CloudFileMutation) WhereP

func (m *CloudFileMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CloudFileMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CloudFilePageList

type CloudFilePageList struct {
	List        []*CloudFile `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

CloudFilePageList is CloudFile PageList result.

type CloudFilePager

type CloudFilePager struct {
	Order  cloudfile.OrderOption
	Filter func(*CloudFileQuery) (*CloudFileQuery, error)
}

func (*CloudFilePager) ApplyFilter

func (p *CloudFilePager) ApplyFilter(query *CloudFileQuery) (*CloudFileQuery, error)

type CloudFilePaginateOption

type CloudFilePaginateOption func(*CloudFilePager)

CloudFilePaginateOption enables pagination customization.

type CloudFileQuery

type CloudFileQuery struct {
	// contains filtered or unexported fields
}

CloudFileQuery is the builder for querying CloudFile entities.

func (*CloudFileQuery) Aggregate

func (cfq *CloudFileQuery) Aggregate(fns ...AggregateFunc) *CloudFileSelect

Aggregate returns a CloudFileSelect configured with the given aggregations.

func (*CloudFileQuery) All

func (cfq *CloudFileQuery) All(ctx context.Context) ([]*CloudFile, error)

All executes the query and returns a list of CloudFiles.

func (*CloudFileQuery) AllX

func (cfq *CloudFileQuery) AllX(ctx context.Context) []*CloudFile

AllX is like All, but panics if an error occurs.

func (*CloudFileQuery) Clone

func (cfq *CloudFileQuery) Clone() *CloudFileQuery

Clone returns a duplicate of the CloudFileQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CloudFileQuery) Count

func (cfq *CloudFileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CloudFileQuery) CountX

func (cfq *CloudFileQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CloudFileQuery) ExecContext

func (c *CloudFileQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileQuery) Exist

func (cfq *CloudFileQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CloudFileQuery) ExistX

func (cfq *CloudFileQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CloudFileQuery) First

func (cfq *CloudFileQuery) First(ctx context.Context) (*CloudFile, error)

First returns the first CloudFile entity from the query. Returns a *NotFoundError when no CloudFile was found.

func (*CloudFileQuery) FirstID

func (cfq *CloudFileQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first CloudFile ID from the query. Returns a *NotFoundError when no CloudFile ID was found.

func (*CloudFileQuery) FirstIDX

func (cfq *CloudFileQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*CloudFileQuery) FirstX

func (cfq *CloudFileQuery) FirstX(ctx context.Context) *CloudFile

FirstX is like First, but panics if an error occurs.

func (*CloudFileQuery) GroupBy

func (cfq *CloudFileQuery) GroupBy(field string, fields ...string) *CloudFileGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CloudFile.Query().
	GroupBy(cloudfile.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CloudFileQuery) IDs

func (cfq *CloudFileQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of CloudFile IDs.

func (*CloudFileQuery) IDsX

func (cfq *CloudFileQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*CloudFileQuery) Limit

func (cfq *CloudFileQuery) Limit(limit int) *CloudFileQuery

Limit the number of records to be returned by this query.

func (*CloudFileQuery) Offset

func (cfq *CloudFileQuery) Offset(offset int) *CloudFileQuery

Offset to start from.

func (*CloudFileQuery) Only

func (cfq *CloudFileQuery) Only(ctx context.Context) (*CloudFile, error)

Only returns a single CloudFile entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one CloudFile entity is found. Returns a *NotFoundError when no CloudFile entities are found.

func (*CloudFileQuery) OnlyID

func (cfq *CloudFileQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only CloudFile ID in the query. Returns a *NotSingularError when more than one CloudFile ID is found. Returns a *NotFoundError when no entities are found.

func (*CloudFileQuery) OnlyIDX

func (cfq *CloudFileQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CloudFileQuery) OnlyX

func (cfq *CloudFileQuery) OnlyX(ctx context.Context) *CloudFile

OnlyX is like Only, but panics if an error occurs.

func (*CloudFileQuery) Order

Order specifies how the records should be ordered.

func (*CloudFileQuery) Page

func (cf *CloudFileQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...CloudFilePaginateOption,
) (*CloudFilePageList, error)

func (*CloudFileQuery) QueryContext

func (c *CloudFileQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileQuery) QueryStorageProviders

func (cfq *CloudFileQuery) QueryStorageProviders() *StorageProviderQuery

QueryStorageProviders chains the current query on the "storage_providers" edge.

func (*CloudFileQuery) QueryTags

func (cfq *CloudFileQuery) QueryTags() *CloudFileTagQuery

QueryTags chains the current query on the "tags" edge.

func (*CloudFileQuery) Select

func (cfq *CloudFileQuery) Select(fields ...string) *CloudFileSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.CloudFile.Query().
	Select(cloudfile.FieldCreatedAt).
	Scan(ctx, &v)

func (*CloudFileQuery) Unique

func (cfq *CloudFileQuery) Unique(unique bool) *CloudFileQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*CloudFileQuery) Where

func (cfq *CloudFileQuery) Where(ps ...predicate.CloudFile) *CloudFileQuery

Where adds a new predicate for the CloudFileQuery builder.

func (*CloudFileQuery) WithStorageProviders

func (cfq *CloudFileQuery) WithStorageProviders(opts ...func(*StorageProviderQuery)) *CloudFileQuery

WithStorageProviders tells the query-builder to eager-load the nodes that are connected to the "storage_providers" edge. The optional arguments are used to configure the query builder of the edge.

func (*CloudFileQuery) WithTags

func (cfq *CloudFileQuery) WithTags(opts ...func(*CloudFileTagQuery)) *CloudFileQuery

WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.

type CloudFileSelect

type CloudFileSelect struct {
	*CloudFileQuery
	// contains filtered or unexported fields
}

CloudFileSelect is the builder for selecting fields of CloudFile entities.

func (*CloudFileSelect) Aggregate

func (cfs *CloudFileSelect) Aggregate(fns ...AggregateFunc) *CloudFileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CloudFileSelect) Bool

func (s *CloudFileSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CloudFileSelect) BoolX

func (s *CloudFileSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CloudFileSelect) Bools

func (s *CloudFileSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CloudFileSelect) BoolsX

func (s *CloudFileSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (CloudFileSelect) ExecContext

func (c CloudFileSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileSelect) Float64

func (s *CloudFileSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CloudFileSelect) Float64X

func (s *CloudFileSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CloudFileSelect) Float64s

func (s *CloudFileSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CloudFileSelect) Float64sX

func (s *CloudFileSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CloudFileSelect) Int

func (s *CloudFileSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CloudFileSelect) IntX

func (s *CloudFileSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CloudFileSelect) Ints

func (s *CloudFileSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CloudFileSelect) IntsX

func (s *CloudFileSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (CloudFileSelect) QueryContext

func (c CloudFileSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileSelect) Scan

func (cfs *CloudFileSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CloudFileSelect) ScanX

func (s *CloudFileSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CloudFileSelect) String

func (s *CloudFileSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CloudFileSelect) StringX

func (s *CloudFileSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CloudFileSelect) Strings

func (s *CloudFileSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CloudFileSelect) StringsX

func (s *CloudFileSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CloudFileTag

type CloudFileTag struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// CloudFileTag's name | 标签名称
	Name string `json:"name,omitempty"`
	// The remark of tag | 标签的备注
	Remark string `json:"remark,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the CloudFileTagQuery when eager-loading is set.
	Edges CloudFileTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

Cloud File's Tags Table | 云文件标签表

func (*CloudFileTag) ExecContext

func (c *CloudFileTag) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTag) QueryCloudFiles

func (cft *CloudFileTag) QueryCloudFiles() *CloudFileQuery

QueryCloudFiles queries the "cloud_files" edge of the CloudFileTag entity.

func (*CloudFileTag) QueryContext

func (c *CloudFileTag) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTag) String

func (cft *CloudFileTag) String() string

String implements the fmt.Stringer.

func (*CloudFileTag) Unwrap

func (cft *CloudFileTag) Unwrap() *CloudFileTag

Unwrap unwraps the CloudFileTag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*CloudFileTag) Update

func (cft *CloudFileTag) Update() *CloudFileTagUpdateOne

Update returns a builder for updating this CloudFileTag. Note that you need to call CloudFileTag.Unwrap() before calling this method if this CloudFileTag was returned from a transaction, and the transaction was committed or rolled back.

func (*CloudFileTag) Value

func (cft *CloudFileTag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the CloudFileTag. This includes values selected through modifiers, order, etc.

type CloudFileTagClient

type CloudFileTagClient struct {
	// contains filtered or unexported fields
}

CloudFileTagClient is a client for the CloudFileTag schema.

func NewCloudFileTagClient

func NewCloudFileTagClient(c config) *CloudFileTagClient

NewCloudFileTagClient returns a client for the CloudFileTag from the given config.

func (*CloudFileTagClient) Create

Create returns a builder for creating a CloudFileTag entity.

func (*CloudFileTagClient) CreateBulk

func (c *CloudFileTagClient) CreateBulk(builders ...*CloudFileTagCreate) *CloudFileTagCreateBulk

CreateBulk returns a builder for creating a bulk of CloudFileTag entities.

func (*CloudFileTagClient) Delete

Delete returns a delete builder for CloudFileTag.

func (*CloudFileTagClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*CloudFileTagClient) DeleteOneID

func (c *CloudFileTagClient) DeleteOneID(id uint64) *CloudFileTagDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*CloudFileTagClient) ExecContext

func (c *CloudFileTagClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagClient) Get

Get returns a CloudFileTag entity by its id.

func (*CloudFileTagClient) GetX

GetX is like Get, but panics if an error occurs.

func (*CloudFileTagClient) Hooks

func (c *CloudFileTagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*CloudFileTagClient) Intercept

func (c *CloudFileTagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `cloudfiletag.Intercept(f(g(h())))`.

func (*CloudFileTagClient) Interceptors

func (c *CloudFileTagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*CloudFileTagClient) MapCreateBulk

func (c *CloudFileTagClient) MapCreateBulk(slice any, setFunc func(*CloudFileTagCreate, int)) *CloudFileTagCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*CloudFileTagClient) Query

Query returns a query builder for CloudFileTag.

func (*CloudFileTagClient) QueryCloudFiles

func (c *CloudFileTagClient) QueryCloudFiles(cft *CloudFileTag) *CloudFileQuery

QueryCloudFiles queries the cloud_files edge of a CloudFileTag.

func (*CloudFileTagClient) QueryContext

func (c *CloudFileTagClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagClient) Update

Update returns an update builder for CloudFileTag.

func (*CloudFileTagClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*CloudFileTagClient) UpdateOneID

func (c *CloudFileTagClient) UpdateOneID(id uint64) *CloudFileTagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*CloudFileTagClient) Use

func (c *CloudFileTagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `cloudfiletag.Hooks(f(g(h())))`.

type CloudFileTagCreate

type CloudFileTagCreate struct {
	// contains filtered or unexported fields
}

CloudFileTagCreate is the builder for creating a CloudFileTag entity.

func (*CloudFileTagCreate) AddCloudFileIDs

func (cftc *CloudFileTagCreate) AddCloudFileIDs(ids ...uuid.UUID) *CloudFileTagCreate

AddCloudFileIDs adds the "cloud_files" edge to the CloudFile entity by IDs.

func (*CloudFileTagCreate) AddCloudFiles

func (cftc *CloudFileTagCreate) AddCloudFiles(c ...*CloudFile) *CloudFileTagCreate

AddCloudFiles adds the "cloud_files" edges to the CloudFile entity.

func (*CloudFileTagCreate) Exec

func (cftc *CloudFileTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*CloudFileTagCreate) ExecContext

func (c *CloudFileTagCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagCreate) ExecX

func (cftc *CloudFileTagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileTagCreate) Mutation

func (cftc *CloudFileTagCreate) Mutation() *CloudFileTagMutation

Mutation returns the CloudFileTagMutation object of the builder.

func (*CloudFileTagCreate) QueryContext

func (c *CloudFileTagCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagCreate) Save

func (cftc *CloudFileTagCreate) Save(ctx context.Context) (*CloudFileTag, error)

Save creates the CloudFileTag in the database.

func (*CloudFileTagCreate) SaveX

func (cftc *CloudFileTagCreate) SaveX(ctx context.Context) *CloudFileTag

SaveX calls Save and panics if Save returns an error.

func (*CloudFileTagCreate) SetCreatedAt

func (cftc *CloudFileTagCreate) SetCreatedAt(t time.Time) *CloudFileTagCreate

SetCreatedAt sets the "created_at" field.

func (*CloudFileTagCreate) SetID

SetID sets the "id" field.

func (*CloudFileTagCreate) SetName

func (cftc *CloudFileTagCreate) SetName(s string) *CloudFileTagCreate

SetName sets the "name" field.

func (*CloudFileTagCreate) SetNillableCreatedAt

func (cftc *CloudFileTagCreate) SetNillableCreatedAt(t *time.Time) *CloudFileTagCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*CloudFileTagCreate) SetNillableRemark

func (cftc *CloudFileTagCreate) SetNillableRemark(s *string) *CloudFileTagCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*CloudFileTagCreate) SetNillableStatus

func (cftc *CloudFileTagCreate) SetNillableStatus(u *uint8) *CloudFileTagCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CloudFileTagCreate) SetNillableUpdatedAt

func (cftc *CloudFileTagCreate) SetNillableUpdatedAt(t *time.Time) *CloudFileTagCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*CloudFileTagCreate) SetNotNilName

func (cft *CloudFileTagCreate) SetNotNilName(value *string) *CloudFileTagCreate

set field if value's pointer is not nil.

func (*CloudFileTagCreate) SetNotNilRemark

func (cft *CloudFileTagCreate) SetNotNilRemark(value *string) *CloudFileTagCreate

set field if value's pointer is not nil.

func (*CloudFileTagCreate) SetNotNilStatus

func (cft *CloudFileTagCreate) SetNotNilStatus(value *uint8) *CloudFileTagCreate

set field if value's pointer is not nil.

func (*CloudFileTagCreate) SetNotNilUpdatedAt

func (cft *CloudFileTagCreate) SetNotNilUpdatedAt(value *time.Time) *CloudFileTagCreate

set field if value's pointer is not nil.

func (*CloudFileTagCreate) SetRemark

func (cftc *CloudFileTagCreate) SetRemark(s string) *CloudFileTagCreate

SetRemark sets the "remark" field.

func (*CloudFileTagCreate) SetStatus

func (cftc *CloudFileTagCreate) SetStatus(u uint8) *CloudFileTagCreate

SetStatus sets the "status" field.

func (*CloudFileTagCreate) SetUpdatedAt

func (cftc *CloudFileTagCreate) SetUpdatedAt(t time.Time) *CloudFileTagCreate

SetUpdatedAt sets the "updated_at" field.

type CloudFileTagCreateBulk

type CloudFileTagCreateBulk struct {
	// contains filtered or unexported fields
}

CloudFileTagCreateBulk is the builder for creating many CloudFileTag entities in bulk.

func (*CloudFileTagCreateBulk) Exec

func (cftcb *CloudFileTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*CloudFileTagCreateBulk) ExecContext

func (c *CloudFileTagCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagCreateBulk) ExecX

func (cftcb *CloudFileTagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileTagCreateBulk) QueryContext

func (c *CloudFileTagCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagCreateBulk) Save

func (cftcb *CloudFileTagCreateBulk) Save(ctx context.Context) ([]*CloudFileTag, error)

Save creates the CloudFileTag entities in the database.

func (*CloudFileTagCreateBulk) SaveX

func (cftcb *CloudFileTagCreateBulk) SaveX(ctx context.Context) []*CloudFileTag

SaveX is like Save, but panics if an error occurs.

type CloudFileTagDelete

type CloudFileTagDelete struct {
	// contains filtered or unexported fields
}

CloudFileTagDelete is the builder for deleting a CloudFileTag entity.

func (*CloudFileTagDelete) Exec

func (cftd *CloudFileTagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*CloudFileTagDelete) ExecContext

func (c *CloudFileTagDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagDelete) ExecX

func (cftd *CloudFileTagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileTagDelete) QueryContext

func (c *CloudFileTagDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagDelete) Where

Where appends a list predicates to the CloudFileTagDelete builder.

type CloudFileTagDeleteOne

type CloudFileTagDeleteOne struct {
	// contains filtered or unexported fields
}

CloudFileTagDeleteOne is the builder for deleting a single CloudFileTag entity.

func (*CloudFileTagDeleteOne) Exec

func (cftdo *CloudFileTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*CloudFileTagDeleteOne) ExecX

func (cftdo *CloudFileTagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileTagDeleteOne) Where

Where appends a list predicates to the CloudFileTagDelete builder.

type CloudFileTagEdges

type CloudFileTagEdges struct {
	// CloudFiles holds the value of the cloud_files edge.
	CloudFiles []*CloudFile `json:"cloud_files,omitempty"`
	// contains filtered or unexported fields
}

CloudFileTagEdges holds the relations/edges for other nodes in the graph.

func (CloudFileTagEdges) CloudFilesOrErr

func (e CloudFileTagEdges) CloudFilesOrErr() ([]*CloudFile, error)

CloudFilesOrErr returns the CloudFiles value or an error if the edge was not loaded in eager-loading.

type CloudFileTagGroupBy

type CloudFileTagGroupBy struct {
	// contains filtered or unexported fields
}

CloudFileTagGroupBy is the group-by builder for CloudFileTag entities.

func (*CloudFileTagGroupBy) Aggregate

func (cftgb *CloudFileTagGroupBy) Aggregate(fns ...AggregateFunc) *CloudFileTagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*CloudFileTagGroupBy) Bool

func (s *CloudFileTagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CloudFileTagGroupBy) BoolX

func (s *CloudFileTagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CloudFileTagGroupBy) Bools

func (s *CloudFileTagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CloudFileTagGroupBy) BoolsX

func (s *CloudFileTagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*CloudFileTagGroupBy) Float64

func (s *CloudFileTagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CloudFileTagGroupBy) Float64X

func (s *CloudFileTagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CloudFileTagGroupBy) Float64s

func (s *CloudFileTagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CloudFileTagGroupBy) Float64sX

func (s *CloudFileTagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CloudFileTagGroupBy) Int

func (s *CloudFileTagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CloudFileTagGroupBy) IntX

func (s *CloudFileTagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CloudFileTagGroupBy) Ints

func (s *CloudFileTagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CloudFileTagGroupBy) IntsX

func (s *CloudFileTagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*CloudFileTagGroupBy) Scan

func (cftgb *CloudFileTagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CloudFileTagGroupBy) ScanX

func (s *CloudFileTagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CloudFileTagGroupBy) String

func (s *CloudFileTagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CloudFileTagGroupBy) StringX

func (s *CloudFileTagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CloudFileTagGroupBy) Strings

func (s *CloudFileTagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CloudFileTagGroupBy) StringsX

func (s *CloudFileTagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CloudFileTagMutation

type CloudFileTagMutation struct {
	// contains filtered or unexported fields
}

CloudFileTagMutation represents an operation that mutates the CloudFileTag nodes in the graph.

func (*CloudFileTagMutation) AddCloudFileIDs

func (m *CloudFileTagMutation) AddCloudFileIDs(ids ...uuid.UUID)

AddCloudFileIDs adds the "cloud_files" edge to the CloudFile entity by ids.

func (*CloudFileTagMutation) AddField

func (m *CloudFileTagMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CloudFileTagMutation) AddStatus

func (m *CloudFileTagMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*CloudFileTagMutation) AddedEdges

func (m *CloudFileTagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*CloudFileTagMutation) AddedField

func (m *CloudFileTagMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CloudFileTagMutation) AddedFields

func (m *CloudFileTagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*CloudFileTagMutation) AddedIDs

func (m *CloudFileTagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*CloudFileTagMutation) AddedStatus

func (m *CloudFileTagMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*CloudFileTagMutation) ClearCloudFiles

func (m *CloudFileTagMutation) ClearCloudFiles()

ClearCloudFiles clears the "cloud_files" edge to the CloudFile entity.

func (*CloudFileTagMutation) ClearEdge

func (m *CloudFileTagMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*CloudFileTagMutation) ClearField

func (m *CloudFileTagMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*CloudFileTagMutation) ClearRemark

func (m *CloudFileTagMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*CloudFileTagMutation) ClearStatus

func (m *CloudFileTagMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*CloudFileTagMutation) ClearedEdges

func (m *CloudFileTagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*CloudFileTagMutation) ClearedFields

func (m *CloudFileTagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (CloudFileTagMutation) Client

func (m CloudFileTagMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*CloudFileTagMutation) CloudFilesCleared

func (m *CloudFileTagMutation) CloudFilesCleared() bool

CloudFilesCleared reports if the "cloud_files" edge to the CloudFile entity was cleared.

func (*CloudFileTagMutation) CloudFilesIDs

func (m *CloudFileTagMutation) CloudFilesIDs() (ids []uuid.UUID)

CloudFilesIDs returns the "cloud_files" edge IDs in the mutation.

func (*CloudFileTagMutation) CreatedAt

func (m *CloudFileTagMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*CloudFileTagMutation) EdgeCleared

func (m *CloudFileTagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*CloudFileTagMutation) ExecContext

func (c *CloudFileTagMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagMutation) Field

func (m *CloudFileTagMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*CloudFileTagMutation) FieldCleared

func (m *CloudFileTagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*CloudFileTagMutation) Fields

func (m *CloudFileTagMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*CloudFileTagMutation) ID

func (m *CloudFileTagMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*CloudFileTagMutation) IDs

func (m *CloudFileTagMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*CloudFileTagMutation) Name

func (m *CloudFileTagMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*CloudFileTagMutation) OldCreatedAt

func (m *CloudFileTagMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the CloudFileTag entity. If the CloudFileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileTagMutation) OldField

func (m *CloudFileTagMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*CloudFileTagMutation) OldName

func (m *CloudFileTagMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the CloudFileTag entity. If the CloudFileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileTagMutation) OldRemark

func (m *CloudFileTagMutation) OldRemark(ctx context.Context) (v string, err error)

OldRemark returns the old "remark" field's value of the CloudFileTag entity. If the CloudFileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileTagMutation) OldStatus

func (m *CloudFileTagMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the CloudFileTag entity. If the CloudFileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileTagMutation) OldUpdatedAt

func (m *CloudFileTagMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the CloudFileTag entity. If the CloudFileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*CloudFileTagMutation) Op

func (m *CloudFileTagMutation) Op() Op

Op returns the operation name.

func (*CloudFileTagMutation) QueryContext

func (c *CloudFileTagMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagMutation) Remark

func (m *CloudFileTagMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*CloudFileTagMutation) RemarkCleared

func (m *CloudFileTagMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*CloudFileTagMutation) RemoveCloudFileIDs

func (m *CloudFileTagMutation) RemoveCloudFileIDs(ids ...uuid.UUID)

RemoveCloudFileIDs removes the "cloud_files" edge to the CloudFile entity by IDs.

func (*CloudFileTagMutation) RemovedCloudFilesIDs

func (m *CloudFileTagMutation) RemovedCloudFilesIDs() (ids []uuid.UUID)

RemovedCloudFiles returns the removed IDs of the "cloud_files" edge to the CloudFile entity.

func (*CloudFileTagMutation) RemovedEdges

func (m *CloudFileTagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*CloudFileTagMutation) RemovedIDs

func (m *CloudFileTagMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*CloudFileTagMutation) ResetCloudFiles

func (m *CloudFileTagMutation) ResetCloudFiles()

ResetCloudFiles resets all changes to the "cloud_files" edge.

func (*CloudFileTagMutation) ResetCreatedAt

func (m *CloudFileTagMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CloudFileTagMutation) ResetEdge

func (m *CloudFileTagMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*CloudFileTagMutation) ResetField

func (m *CloudFileTagMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*CloudFileTagMutation) ResetName

func (m *CloudFileTagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CloudFileTagMutation) ResetRemark

func (m *CloudFileTagMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*CloudFileTagMutation) ResetStatus

func (m *CloudFileTagMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*CloudFileTagMutation) ResetUpdatedAt

func (m *CloudFileTagMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CloudFileTagMutation) SetCreatedAt

func (m *CloudFileTagMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*CloudFileTagMutation) SetField

func (m *CloudFileTagMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*CloudFileTagMutation) SetID

func (m *CloudFileTagMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of CloudFileTag entities.

func (*CloudFileTagMutation) SetName

func (m *CloudFileTagMutation) SetName(s string)

SetName sets the "name" field.

func (*CloudFileTagMutation) SetOp

func (m *CloudFileTagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CloudFileTagMutation) SetRemark

func (m *CloudFileTagMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*CloudFileTagMutation) SetStatus

func (m *CloudFileTagMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*CloudFileTagMutation) SetUpdatedAt

func (m *CloudFileTagMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileTagMutation) Status

func (m *CloudFileTagMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*CloudFileTagMutation) StatusCleared

func (m *CloudFileTagMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (CloudFileTagMutation) Tx

func (m CloudFileTagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*CloudFileTagMutation) Type

func (m *CloudFileTagMutation) Type() string

Type returns the node type of this mutation (CloudFileTag).

func (*CloudFileTagMutation) UpdatedAt

func (m *CloudFileTagMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*CloudFileTagMutation) Where

Where appends a list predicates to the CloudFileTagMutation builder.

func (*CloudFileTagMutation) WhereP

func (m *CloudFileTagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the CloudFileTagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type CloudFileTagPageList

type CloudFileTagPageList struct {
	List        []*CloudFileTag `json:"list"`
	PageDetails *PageDetails    `json:"pageDetails"`
}

CloudFileTagPageList is CloudFileTag PageList result.

type CloudFileTagPager

type CloudFileTagPager struct {
	Order  cloudfiletag.OrderOption
	Filter func(*CloudFileTagQuery) (*CloudFileTagQuery, error)
}

func (*CloudFileTagPager) ApplyFilter

func (p *CloudFileTagPager) ApplyFilter(query *CloudFileTagQuery) (*CloudFileTagQuery, error)

type CloudFileTagPaginateOption

type CloudFileTagPaginateOption func(*CloudFileTagPager)

CloudFileTagPaginateOption enables pagination customization.

type CloudFileTagQuery

type CloudFileTagQuery struct {
	// contains filtered or unexported fields
}

CloudFileTagQuery is the builder for querying CloudFileTag entities.

func (*CloudFileTagQuery) Aggregate

func (cftq *CloudFileTagQuery) Aggregate(fns ...AggregateFunc) *CloudFileTagSelect

Aggregate returns a CloudFileTagSelect configured with the given aggregations.

func (*CloudFileTagQuery) All

func (cftq *CloudFileTagQuery) All(ctx context.Context) ([]*CloudFileTag, error)

All executes the query and returns a list of CloudFileTags.

func (*CloudFileTagQuery) AllX

func (cftq *CloudFileTagQuery) AllX(ctx context.Context) []*CloudFileTag

AllX is like All, but panics if an error occurs.

func (*CloudFileTagQuery) Clone

func (cftq *CloudFileTagQuery) Clone() *CloudFileTagQuery

Clone returns a duplicate of the CloudFileTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*CloudFileTagQuery) Count

func (cftq *CloudFileTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*CloudFileTagQuery) CountX

func (cftq *CloudFileTagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*CloudFileTagQuery) ExecContext

func (c *CloudFileTagQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagQuery) Exist

func (cftq *CloudFileTagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*CloudFileTagQuery) ExistX

func (cftq *CloudFileTagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*CloudFileTagQuery) First

func (cftq *CloudFileTagQuery) First(ctx context.Context) (*CloudFileTag, error)

First returns the first CloudFileTag entity from the query. Returns a *NotFoundError when no CloudFileTag was found.

func (*CloudFileTagQuery) FirstID

func (cftq *CloudFileTagQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first CloudFileTag ID from the query. Returns a *NotFoundError when no CloudFileTag ID was found.

func (*CloudFileTagQuery) FirstIDX

func (cftq *CloudFileTagQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*CloudFileTagQuery) FirstX

func (cftq *CloudFileTagQuery) FirstX(ctx context.Context) *CloudFileTag

FirstX is like First, but panics if an error occurs.

func (*CloudFileTagQuery) GroupBy

func (cftq *CloudFileTagQuery) GroupBy(field string, fields ...string) *CloudFileTagGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.CloudFileTag.Query().
	GroupBy(cloudfiletag.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*CloudFileTagQuery) IDs

func (cftq *CloudFileTagQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of CloudFileTag IDs.

func (*CloudFileTagQuery) IDsX

func (cftq *CloudFileTagQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*CloudFileTagQuery) Limit

func (cftq *CloudFileTagQuery) Limit(limit int) *CloudFileTagQuery

Limit the number of records to be returned by this query.

func (*CloudFileTagQuery) Offset

func (cftq *CloudFileTagQuery) Offset(offset int) *CloudFileTagQuery

Offset to start from.

func (*CloudFileTagQuery) Only

func (cftq *CloudFileTagQuery) Only(ctx context.Context) (*CloudFileTag, error)

Only returns a single CloudFileTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one CloudFileTag entity is found. Returns a *NotFoundError when no CloudFileTag entities are found.

func (*CloudFileTagQuery) OnlyID

func (cftq *CloudFileTagQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only CloudFileTag ID in the query. Returns a *NotSingularError when more than one CloudFileTag ID is found. Returns a *NotFoundError when no entities are found.

func (*CloudFileTagQuery) OnlyIDX

func (cftq *CloudFileTagQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*CloudFileTagQuery) OnlyX

func (cftq *CloudFileTagQuery) OnlyX(ctx context.Context) *CloudFileTag

OnlyX is like Only, but panics if an error occurs.

func (*CloudFileTagQuery) Order

Order specifies how the records should be ordered.

func (*CloudFileTagQuery) Page

func (cft *CloudFileTagQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...CloudFileTagPaginateOption,
) (*CloudFileTagPageList, error)

func (*CloudFileTagQuery) QueryCloudFiles

func (cftq *CloudFileTagQuery) QueryCloudFiles() *CloudFileQuery

QueryCloudFiles chains the current query on the "cloud_files" edge.

func (*CloudFileTagQuery) QueryContext

func (c *CloudFileTagQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagQuery) Select

func (cftq *CloudFileTagQuery) Select(fields ...string) *CloudFileTagSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.CloudFileTag.Query().
	Select(cloudfiletag.FieldCreatedAt).
	Scan(ctx, &v)

func (*CloudFileTagQuery) Unique

func (cftq *CloudFileTagQuery) Unique(unique bool) *CloudFileTagQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*CloudFileTagQuery) Where

Where adds a new predicate for the CloudFileTagQuery builder.

func (*CloudFileTagQuery) WithCloudFiles

func (cftq *CloudFileTagQuery) WithCloudFiles(opts ...func(*CloudFileQuery)) *CloudFileTagQuery

WithCloudFiles tells the query-builder to eager-load the nodes that are connected to the "cloud_files" edge. The optional arguments are used to configure the query builder of the edge.

type CloudFileTagSelect

type CloudFileTagSelect struct {
	*CloudFileTagQuery
	// contains filtered or unexported fields
}

CloudFileTagSelect is the builder for selecting fields of CloudFileTag entities.

func (*CloudFileTagSelect) Aggregate

func (cfts *CloudFileTagSelect) Aggregate(fns ...AggregateFunc) *CloudFileTagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*CloudFileTagSelect) Bool

func (s *CloudFileTagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*CloudFileTagSelect) BoolX

func (s *CloudFileTagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*CloudFileTagSelect) Bools

func (s *CloudFileTagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*CloudFileTagSelect) BoolsX

func (s *CloudFileTagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (CloudFileTagSelect) ExecContext

func (c CloudFileTagSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagSelect) Float64

func (s *CloudFileTagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*CloudFileTagSelect) Float64X

func (s *CloudFileTagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*CloudFileTagSelect) Float64s

func (s *CloudFileTagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*CloudFileTagSelect) Float64sX

func (s *CloudFileTagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*CloudFileTagSelect) Int

func (s *CloudFileTagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*CloudFileTagSelect) IntX

func (s *CloudFileTagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*CloudFileTagSelect) Ints

func (s *CloudFileTagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*CloudFileTagSelect) IntsX

func (s *CloudFileTagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (CloudFileTagSelect) QueryContext

func (c CloudFileTagSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagSelect) Scan

func (cfts *CloudFileTagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*CloudFileTagSelect) ScanX

func (s *CloudFileTagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*CloudFileTagSelect) String

func (s *CloudFileTagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*CloudFileTagSelect) StringX

func (s *CloudFileTagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*CloudFileTagSelect) Strings

func (s *CloudFileTagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*CloudFileTagSelect) StringsX

func (s *CloudFileTagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type CloudFileTagUpdate

type CloudFileTagUpdate struct {
	// contains filtered or unexported fields
}

CloudFileTagUpdate is the builder for updating CloudFileTag entities.

func (*CloudFileTagUpdate) AddCloudFileIDs

func (cftu *CloudFileTagUpdate) AddCloudFileIDs(ids ...uuid.UUID) *CloudFileTagUpdate

AddCloudFileIDs adds the "cloud_files" edge to the CloudFile entity by IDs.

func (*CloudFileTagUpdate) AddCloudFiles

func (cftu *CloudFileTagUpdate) AddCloudFiles(c ...*CloudFile) *CloudFileTagUpdate

AddCloudFiles adds the "cloud_files" edges to the CloudFile entity.

func (*CloudFileTagUpdate) AddStatus

func (cftu *CloudFileTagUpdate) AddStatus(u int8) *CloudFileTagUpdate

AddStatus adds u to the "status" field.

func (*CloudFileTagUpdate) ClearCloudFiles

func (cftu *CloudFileTagUpdate) ClearCloudFiles() *CloudFileTagUpdate

ClearCloudFiles clears all "cloud_files" edges to the CloudFile entity.

func (*CloudFileTagUpdate) ClearRemark

func (cftu *CloudFileTagUpdate) ClearRemark() *CloudFileTagUpdate

ClearRemark clears the value of the "remark" field.

func (*CloudFileTagUpdate) ClearStatus

func (cftu *CloudFileTagUpdate) ClearStatus() *CloudFileTagUpdate

ClearStatus clears the value of the "status" field.

func (*CloudFileTagUpdate) Exec

func (cftu *CloudFileTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CloudFileTagUpdate) ExecContext

func (c *CloudFileTagUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagUpdate) ExecX

func (cftu *CloudFileTagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileTagUpdate) Mutation

func (cftu *CloudFileTagUpdate) Mutation() *CloudFileTagMutation

Mutation returns the CloudFileTagMutation object of the builder.

func (*CloudFileTagUpdate) QueryContext

func (c *CloudFileTagUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagUpdate) RemoveCloudFileIDs

func (cftu *CloudFileTagUpdate) RemoveCloudFileIDs(ids ...uuid.UUID) *CloudFileTagUpdate

RemoveCloudFileIDs removes the "cloud_files" edge to CloudFile entities by IDs.

func (*CloudFileTagUpdate) RemoveCloudFiles

func (cftu *CloudFileTagUpdate) RemoveCloudFiles(c ...*CloudFile) *CloudFileTagUpdate

RemoveCloudFiles removes "cloud_files" edges to CloudFile entities.

func (*CloudFileTagUpdate) Save

func (cftu *CloudFileTagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CloudFileTagUpdate) SaveX

func (cftu *CloudFileTagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CloudFileTagUpdate) SetName

func (cftu *CloudFileTagUpdate) SetName(s string) *CloudFileTagUpdate

SetName sets the "name" field.

func (*CloudFileTagUpdate) SetNillableName

func (cftu *CloudFileTagUpdate) SetNillableName(s *string) *CloudFileTagUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*CloudFileTagUpdate) SetNillableRemark

func (cftu *CloudFileTagUpdate) SetNillableRemark(s *string) *CloudFileTagUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*CloudFileTagUpdate) SetNillableStatus

func (cftu *CloudFileTagUpdate) SetNillableStatus(u *uint8) *CloudFileTagUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CloudFileTagUpdate) SetNotNilName

func (cft *CloudFileTagUpdate) SetNotNilName(value *string) *CloudFileTagUpdate

set field if value's pointer is not nil.

func (*CloudFileTagUpdate) SetNotNilRemark

func (cft *CloudFileTagUpdate) SetNotNilRemark(value *string) *CloudFileTagUpdate

set field if value's pointer is not nil.

func (*CloudFileTagUpdate) SetNotNilStatus

func (cft *CloudFileTagUpdate) SetNotNilStatus(value *uint8) *CloudFileTagUpdate

set field if value's pointer is not nil.

func (*CloudFileTagUpdate) SetNotNilUpdatedAt

func (cft *CloudFileTagUpdate) SetNotNilUpdatedAt(value *time.Time) *CloudFileTagUpdate

set field if value's pointer is not nil.

func (*CloudFileTagUpdate) SetRemark

func (cftu *CloudFileTagUpdate) SetRemark(s string) *CloudFileTagUpdate

SetRemark sets the "remark" field.

func (*CloudFileTagUpdate) SetStatus

func (cftu *CloudFileTagUpdate) SetStatus(u uint8) *CloudFileTagUpdate

SetStatus sets the "status" field.

func (*CloudFileTagUpdate) SetUpdatedAt

func (cftu *CloudFileTagUpdate) SetUpdatedAt(t time.Time) *CloudFileTagUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileTagUpdate) Where

Where appends a list predicates to the CloudFileTagUpdate builder.

type CloudFileTagUpdateOne

type CloudFileTagUpdateOne struct {
	// contains filtered or unexported fields
}

CloudFileTagUpdateOne is the builder for updating a single CloudFileTag entity.

func (*CloudFileTagUpdateOne) AddCloudFileIDs

func (cftuo *CloudFileTagUpdateOne) AddCloudFileIDs(ids ...uuid.UUID) *CloudFileTagUpdateOne

AddCloudFileIDs adds the "cloud_files" edge to the CloudFile entity by IDs.

func (*CloudFileTagUpdateOne) AddCloudFiles

func (cftuo *CloudFileTagUpdateOne) AddCloudFiles(c ...*CloudFile) *CloudFileTagUpdateOne

AddCloudFiles adds the "cloud_files" edges to the CloudFile entity.

func (*CloudFileTagUpdateOne) AddStatus

func (cftuo *CloudFileTagUpdateOne) AddStatus(u int8) *CloudFileTagUpdateOne

AddStatus adds u to the "status" field.

func (*CloudFileTagUpdateOne) ClearCloudFiles

func (cftuo *CloudFileTagUpdateOne) ClearCloudFiles() *CloudFileTagUpdateOne

ClearCloudFiles clears all "cloud_files" edges to the CloudFile entity.

func (*CloudFileTagUpdateOne) ClearRemark

func (cftuo *CloudFileTagUpdateOne) ClearRemark() *CloudFileTagUpdateOne

ClearRemark clears the value of the "remark" field.

func (*CloudFileTagUpdateOne) ClearStatus

func (cftuo *CloudFileTagUpdateOne) ClearStatus() *CloudFileTagUpdateOne

ClearStatus clears the value of the "status" field.

func (*CloudFileTagUpdateOne) Exec

func (cftuo *CloudFileTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CloudFileTagUpdateOne) ExecContext

func (c *CloudFileTagUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileTagUpdateOne) ExecX

func (cftuo *CloudFileTagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileTagUpdateOne) Mutation

func (cftuo *CloudFileTagUpdateOne) Mutation() *CloudFileTagMutation

Mutation returns the CloudFileTagMutation object of the builder.

func (*CloudFileTagUpdateOne) QueryContext

func (c *CloudFileTagUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileTagUpdateOne) RemoveCloudFileIDs

func (cftuo *CloudFileTagUpdateOne) RemoveCloudFileIDs(ids ...uuid.UUID) *CloudFileTagUpdateOne

RemoveCloudFileIDs removes the "cloud_files" edge to CloudFile entities by IDs.

func (*CloudFileTagUpdateOne) RemoveCloudFiles

func (cftuo *CloudFileTagUpdateOne) RemoveCloudFiles(c ...*CloudFile) *CloudFileTagUpdateOne

RemoveCloudFiles removes "cloud_files" edges to CloudFile entities.

func (*CloudFileTagUpdateOne) Save

Save executes the query and returns the updated CloudFileTag entity.

func (*CloudFileTagUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*CloudFileTagUpdateOne) Select

func (cftuo *CloudFileTagUpdateOne) Select(field string, fields ...string) *CloudFileTagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CloudFileTagUpdateOne) SetName

SetName sets the "name" field.

func (*CloudFileTagUpdateOne) SetNillableName

func (cftuo *CloudFileTagUpdateOne) SetNillableName(s *string) *CloudFileTagUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*CloudFileTagUpdateOne) SetNillableRemark

func (cftuo *CloudFileTagUpdateOne) SetNillableRemark(s *string) *CloudFileTagUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*CloudFileTagUpdateOne) SetNillableStatus

func (cftuo *CloudFileTagUpdateOne) SetNillableStatus(u *uint8) *CloudFileTagUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*CloudFileTagUpdateOne) SetNotNilName

func (cft *CloudFileTagUpdateOne) SetNotNilName(value *string) *CloudFileTagUpdateOne

set field if value's pointer is not nil.

func (*CloudFileTagUpdateOne) SetNotNilRemark

func (cft *CloudFileTagUpdateOne) SetNotNilRemark(value *string) *CloudFileTagUpdateOne

set field if value's pointer is not nil.

func (*CloudFileTagUpdateOne) SetNotNilStatus

func (cft *CloudFileTagUpdateOne) SetNotNilStatus(value *uint8) *CloudFileTagUpdateOne

set field if value's pointer is not nil.

func (*CloudFileTagUpdateOne) SetNotNilUpdatedAt

func (cft *CloudFileTagUpdateOne) SetNotNilUpdatedAt(value *time.Time) *CloudFileTagUpdateOne

set field if value's pointer is not nil.

func (*CloudFileTagUpdateOne) SetRemark

func (cftuo *CloudFileTagUpdateOne) SetRemark(s string) *CloudFileTagUpdateOne

SetRemark sets the "remark" field.

func (*CloudFileTagUpdateOne) SetStatus

func (cftuo *CloudFileTagUpdateOne) SetStatus(u uint8) *CloudFileTagUpdateOne

SetStatus sets the "status" field.

func (*CloudFileTagUpdateOne) SetUpdatedAt

func (cftuo *CloudFileTagUpdateOne) SetUpdatedAt(t time.Time) *CloudFileTagUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileTagUpdateOne) Where

Where appends a list predicates to the CloudFileTagUpdate builder.

type CloudFileTags

type CloudFileTags []*CloudFileTag

CloudFileTags is a parsable slice of CloudFileTag.

type CloudFileUpdate

type CloudFileUpdate struct {
	// contains filtered or unexported fields
}

CloudFileUpdate is the builder for updating CloudFile entities.

func (*CloudFileUpdate) AddFileType

func (cfu *CloudFileUpdate) AddFileType(u int8) *CloudFileUpdate

AddFileType adds u to the "file_type" field.

func (*CloudFileUpdate) AddSize

func (cfu *CloudFileUpdate) AddSize(u int64) *CloudFileUpdate

AddSize adds u to the "size" field.

func (*CloudFileUpdate) AddTagIDs

func (cfu *CloudFileUpdate) AddTagIDs(ids ...uint64) *CloudFileUpdate

AddTagIDs adds the "tags" edge to the CloudFileTag entity by IDs.

func (*CloudFileUpdate) AddTags

func (cfu *CloudFileUpdate) AddTags(c ...*CloudFileTag) *CloudFileUpdate

AddTags adds the "tags" edges to the CloudFileTag entity.

func (*CloudFileUpdate) ClearState

func (cfu *CloudFileUpdate) ClearState() *CloudFileUpdate

ClearState clears the value of the "state" field.

func (*CloudFileUpdate) ClearStorageProviders

func (cfu *CloudFileUpdate) ClearStorageProviders() *CloudFileUpdate

ClearStorageProviders clears the "storage_providers" edge to the StorageProvider entity.

func (*CloudFileUpdate) ClearTags

func (cfu *CloudFileUpdate) ClearTags() *CloudFileUpdate

ClearTags clears all "tags" edges to the CloudFileTag entity.

func (*CloudFileUpdate) Exec

func (cfu *CloudFileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CloudFileUpdate) ExecContext

func (c *CloudFileUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileUpdate) ExecX

func (cfu *CloudFileUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileUpdate) Mutation

func (cfu *CloudFileUpdate) Mutation() *CloudFileMutation

Mutation returns the CloudFileMutation object of the builder.

func (*CloudFileUpdate) QueryContext

func (c *CloudFileUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileUpdate) RemoveTagIDs

func (cfu *CloudFileUpdate) RemoveTagIDs(ids ...uint64) *CloudFileUpdate

RemoveTagIDs removes the "tags" edge to CloudFileTag entities by IDs.

func (*CloudFileUpdate) RemoveTags

func (cfu *CloudFileUpdate) RemoveTags(c ...*CloudFileTag) *CloudFileUpdate

RemoveTags removes "tags" edges to CloudFileTag entities.

func (*CloudFileUpdate) Save

func (cfu *CloudFileUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*CloudFileUpdate) SaveX

func (cfu *CloudFileUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*CloudFileUpdate) SetFileType

func (cfu *CloudFileUpdate) SetFileType(u uint8) *CloudFileUpdate

SetFileType sets the "file_type" field.

func (*CloudFileUpdate) SetName

func (cfu *CloudFileUpdate) SetName(s string) *CloudFileUpdate

SetName sets the "name" field.

func (*CloudFileUpdate) SetNillableFileType

func (cfu *CloudFileUpdate) SetNillableFileType(u *uint8) *CloudFileUpdate

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*CloudFileUpdate) SetNillableName

func (cfu *CloudFileUpdate) SetNillableName(s *string) *CloudFileUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*CloudFileUpdate) SetNillableSize

func (cfu *CloudFileUpdate) SetNillableSize(u *uint64) *CloudFileUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*CloudFileUpdate) SetNillableState

func (cfu *CloudFileUpdate) SetNillableState(b *bool) *CloudFileUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*CloudFileUpdate) SetNillableStorageProvidersID

func (cfu *CloudFileUpdate) SetNillableStorageProvidersID(id *uint64) *CloudFileUpdate

SetNillableStorageProvidersID sets the "storage_providers" edge to the StorageProvider entity by ID if the given value is not nil.

func (*CloudFileUpdate) SetNillableURL

func (cfu *CloudFileUpdate) SetNillableURL(s *string) *CloudFileUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*CloudFileUpdate) SetNillableUserID

func (cfu *CloudFileUpdate) SetNillableUserID(s *string) *CloudFileUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CloudFileUpdate) SetNotNilFileType

func (cf *CloudFileUpdate) SetNotNilFileType(value *uint8) *CloudFileUpdate

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilName

func (cf *CloudFileUpdate) SetNotNilName(value *string) *CloudFileUpdate

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilSize

func (cf *CloudFileUpdate) SetNotNilSize(value *uint64) *CloudFileUpdate

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilState

func (cf *CloudFileUpdate) SetNotNilState(value *bool) *CloudFileUpdate

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilURL

func (cf *CloudFileUpdate) SetNotNilURL(value *string) *CloudFileUpdate

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilUpdatedAt

func (cf *CloudFileUpdate) SetNotNilUpdatedAt(value *time.Time) *CloudFileUpdate

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilUserID

func (cf *CloudFileUpdate) SetNotNilUserID(value *string) *CloudFileUpdate

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetSize

func (cfu *CloudFileUpdate) SetSize(u uint64) *CloudFileUpdate

SetSize sets the "size" field.

func (*CloudFileUpdate) SetState

func (cfu *CloudFileUpdate) SetState(b bool) *CloudFileUpdate

SetState sets the "state" field.

func (*CloudFileUpdate) SetStorageProviders

func (cfu *CloudFileUpdate) SetStorageProviders(s *StorageProvider) *CloudFileUpdate

SetStorageProviders sets the "storage_providers" edge to the StorageProvider entity.

func (*CloudFileUpdate) SetStorageProvidersID

func (cfu *CloudFileUpdate) SetStorageProvidersID(id uint64) *CloudFileUpdate

SetStorageProvidersID sets the "storage_providers" edge to the StorageProvider entity by ID.

func (*CloudFileUpdate) SetURL

func (cfu *CloudFileUpdate) SetURL(s string) *CloudFileUpdate

SetURL sets the "url" field.

func (*CloudFileUpdate) SetUpdatedAt

func (cfu *CloudFileUpdate) SetUpdatedAt(t time.Time) *CloudFileUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileUpdate) SetUserID

func (cfu *CloudFileUpdate) SetUserID(s string) *CloudFileUpdate

SetUserID sets the "user_id" field.

func (*CloudFileUpdate) Where

Where appends a list predicates to the CloudFileUpdate builder.

type CloudFileUpdateOne

type CloudFileUpdateOne struct {
	// contains filtered or unexported fields
}

CloudFileUpdateOne is the builder for updating a single CloudFile entity.

func (*CloudFileUpdateOne) AddFileType

func (cfuo *CloudFileUpdateOne) AddFileType(u int8) *CloudFileUpdateOne

AddFileType adds u to the "file_type" field.

func (*CloudFileUpdateOne) AddSize

func (cfuo *CloudFileUpdateOne) AddSize(u int64) *CloudFileUpdateOne

AddSize adds u to the "size" field.

func (*CloudFileUpdateOne) AddTagIDs

func (cfuo *CloudFileUpdateOne) AddTagIDs(ids ...uint64) *CloudFileUpdateOne

AddTagIDs adds the "tags" edge to the CloudFileTag entity by IDs.

func (*CloudFileUpdateOne) AddTags

func (cfuo *CloudFileUpdateOne) AddTags(c ...*CloudFileTag) *CloudFileUpdateOne

AddTags adds the "tags" edges to the CloudFileTag entity.

func (*CloudFileUpdateOne) ClearState

func (cfuo *CloudFileUpdateOne) ClearState() *CloudFileUpdateOne

ClearState clears the value of the "state" field.

func (*CloudFileUpdateOne) ClearStorageProviders

func (cfuo *CloudFileUpdateOne) ClearStorageProviders() *CloudFileUpdateOne

ClearStorageProviders clears the "storage_providers" edge to the StorageProvider entity.

func (*CloudFileUpdateOne) ClearTags

func (cfuo *CloudFileUpdateOne) ClearTags() *CloudFileUpdateOne

ClearTags clears all "tags" edges to the CloudFileTag entity.

func (*CloudFileUpdateOne) Exec

func (cfuo *CloudFileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CloudFileUpdateOne) ExecContext

func (c *CloudFileUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*CloudFileUpdateOne) ExecX

func (cfuo *CloudFileUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*CloudFileUpdateOne) Mutation

func (cfuo *CloudFileUpdateOne) Mutation() *CloudFileMutation

Mutation returns the CloudFileMutation object of the builder.

func (*CloudFileUpdateOne) QueryContext

func (c *CloudFileUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*CloudFileUpdateOne) RemoveTagIDs

func (cfuo *CloudFileUpdateOne) RemoveTagIDs(ids ...uint64) *CloudFileUpdateOne

RemoveTagIDs removes the "tags" edge to CloudFileTag entities by IDs.

func (*CloudFileUpdateOne) RemoveTags

func (cfuo *CloudFileUpdateOne) RemoveTags(c ...*CloudFileTag) *CloudFileUpdateOne

RemoveTags removes "tags" edges to CloudFileTag entities.

func (*CloudFileUpdateOne) Save

func (cfuo *CloudFileUpdateOne) Save(ctx context.Context) (*CloudFile, error)

Save executes the query and returns the updated CloudFile entity.

func (*CloudFileUpdateOne) SaveX

func (cfuo *CloudFileUpdateOne) SaveX(ctx context.Context) *CloudFile

SaveX is like Save, but panics if an error occurs.

func (*CloudFileUpdateOne) Select

func (cfuo *CloudFileUpdateOne) Select(field string, fields ...string) *CloudFileUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*CloudFileUpdateOne) SetFileType

func (cfuo *CloudFileUpdateOne) SetFileType(u uint8) *CloudFileUpdateOne

SetFileType sets the "file_type" field.

func (*CloudFileUpdateOne) SetName

func (cfuo *CloudFileUpdateOne) SetName(s string) *CloudFileUpdateOne

SetName sets the "name" field.

func (*CloudFileUpdateOne) SetNillableFileType

func (cfuo *CloudFileUpdateOne) SetNillableFileType(u *uint8) *CloudFileUpdateOne

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableName

func (cfuo *CloudFileUpdateOne) SetNillableName(s *string) *CloudFileUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableSize

func (cfuo *CloudFileUpdateOne) SetNillableSize(u *uint64) *CloudFileUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableState

func (cfuo *CloudFileUpdateOne) SetNillableState(b *bool) *CloudFileUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableStorageProvidersID

func (cfuo *CloudFileUpdateOne) SetNillableStorageProvidersID(id *uint64) *CloudFileUpdateOne

SetNillableStorageProvidersID sets the "storage_providers" edge to the StorageProvider entity by ID if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableURL

func (cfuo *CloudFileUpdateOne) SetNillableURL(s *string) *CloudFileUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableUserID

func (cfuo *CloudFileUpdateOne) SetNillableUserID(s *string) *CloudFileUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNotNilFileType

func (cf *CloudFileUpdateOne) SetNotNilFileType(value *uint8) *CloudFileUpdateOne

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilName

func (cf *CloudFileUpdateOne) SetNotNilName(value *string) *CloudFileUpdateOne

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilSize

func (cf *CloudFileUpdateOne) SetNotNilSize(value *uint64) *CloudFileUpdateOne

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilState

func (cf *CloudFileUpdateOne) SetNotNilState(value *bool) *CloudFileUpdateOne

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilURL

func (cf *CloudFileUpdateOne) SetNotNilURL(value *string) *CloudFileUpdateOne

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilUpdatedAt

func (cf *CloudFileUpdateOne) SetNotNilUpdatedAt(value *time.Time) *CloudFileUpdateOne

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilUserID

func (cf *CloudFileUpdateOne) SetNotNilUserID(value *string) *CloudFileUpdateOne

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetSize

func (cfuo *CloudFileUpdateOne) SetSize(u uint64) *CloudFileUpdateOne

SetSize sets the "size" field.

func (*CloudFileUpdateOne) SetState

func (cfuo *CloudFileUpdateOne) SetState(b bool) *CloudFileUpdateOne

SetState sets the "state" field.

func (*CloudFileUpdateOne) SetStorageProviders

func (cfuo *CloudFileUpdateOne) SetStorageProviders(s *StorageProvider) *CloudFileUpdateOne

SetStorageProviders sets the "storage_providers" edge to the StorageProvider entity.

func (*CloudFileUpdateOne) SetStorageProvidersID

func (cfuo *CloudFileUpdateOne) SetStorageProvidersID(id uint64) *CloudFileUpdateOne

SetStorageProvidersID sets the "storage_providers" edge to the StorageProvider entity by ID.

func (*CloudFileUpdateOne) SetURL

func (cfuo *CloudFileUpdateOne) SetURL(s string) *CloudFileUpdateOne

SetURL sets the "url" field.

func (*CloudFileUpdateOne) SetUpdatedAt

func (cfuo *CloudFileUpdateOne) SetUpdatedAt(t time.Time) *CloudFileUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileUpdateOne) SetUserID

func (cfuo *CloudFileUpdateOne) SetUserID(s string) *CloudFileUpdateOne

SetUserID sets the "user_id" field.

func (*CloudFileUpdateOne) Where

Where appends a list predicates to the CloudFileUpdate builder.

type CloudFiles

type CloudFiles []*CloudFile

CloudFiles is a parsable slice of CloudFile.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

type ConstraintError struct {
	// contains filtered or unexported fields
}

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type File

type File struct {

	// ID of the ent.
	// UUID
	ID uuid.UUID `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// File's name | 文件名称
	Name string `json:"name,omitempty"`
	// File's type | 文件类型
	FileType uint8 `json:"file_type,omitempty"`
	// File's size | 文件大小
	Size uint64 `json:"size,omitempty"`
	// File's path | 文件路径
	Path string `json:"path,omitempty"`
	// User's UUID | 用户的 UUID
	UserID string `json:"user_id,omitempty"`
	// The md5 of the file | 文件的 md5
	Md5 string `json:"md5,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FileQuery when eager-loading is set.
	Edges FileEdges `json:"edges"`
	// contains filtered or unexported fields
}

File Table | 文件表

func (*File) ExecContext

func (c *File) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*File) QueryContext

func (c *File) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*File) QueryTags

func (f *File) QueryTags() *FileTagQuery

QueryTags queries the "tags" edge of the File entity.

func (*File) String

func (f *File) String() string

String implements the fmt.Stringer.

func (*File) Unwrap

func (f *File) Unwrap() *File

Unwrap unwraps the File entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*File) Update

func (f *File) Update() *FileUpdateOne

Update returns a builder for updating this File. Note that you need to call File.Unwrap() before calling this method if this File was returned from a transaction, and the transaction was committed or rolled back.

func (*File) Value

func (f *File) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the File. This includes values selected through modifiers, order, etc.

type FileClient

type FileClient struct {
	// contains filtered or unexported fields
}

FileClient is a client for the File schema.

func NewFileClient

func NewFileClient(c config) *FileClient

NewFileClient returns a client for the File from the given config.

func (*FileClient) Create

func (c *FileClient) Create() *FileCreate

Create returns a builder for creating a File entity.

func (*FileClient) CreateBulk

func (c *FileClient) CreateBulk(builders ...*FileCreate) *FileCreateBulk

CreateBulk returns a builder for creating a bulk of File entities.

func (*FileClient) Delete

func (c *FileClient) Delete() *FileDelete

Delete returns a delete builder for File.

func (*FileClient) DeleteOne

func (c *FileClient) DeleteOne(f *File) *FileDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileClient) DeleteOneID

func (c *FileClient) DeleteOneID(id uuid.UUID) *FileDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*FileClient) ExecContext

func (c *FileClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileClient) Get

func (c *FileClient) Get(ctx context.Context, id uuid.UUID) (*File, error)

Get returns a File entity by its id.

func (*FileClient) GetX

func (c *FileClient) GetX(ctx context.Context, id uuid.UUID) *File

GetX is like Get, but panics if an error occurs.

func (*FileClient) Hooks

func (c *FileClient) Hooks() []Hook

Hooks returns the client hooks.

func (*FileClient) Intercept

func (c *FileClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `file.Intercept(f(g(h())))`.

func (*FileClient) Interceptors

func (c *FileClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FileClient) MapCreateBulk

func (c *FileClient) MapCreateBulk(slice any, setFunc func(*FileCreate, int)) *FileCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FileClient) Query

func (c *FileClient) Query() *FileQuery

Query returns a query builder for File.

func (*FileClient) QueryContext

func (c *FileClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileClient) QueryTags

func (c *FileClient) QueryTags(f *File) *FileTagQuery

QueryTags queries the tags edge of a File.

func (*FileClient) Update

func (c *FileClient) Update() *FileUpdate

Update returns an update builder for File.

func (*FileClient) UpdateOne

func (c *FileClient) UpdateOne(f *File) *FileUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileClient) UpdateOneID

func (c *FileClient) UpdateOneID(id uuid.UUID) *FileUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileClient) Use

func (c *FileClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `file.Hooks(f(g(h())))`.

type FileCreate

type FileCreate struct {
	// contains filtered or unexported fields
}

FileCreate is the builder for creating a File entity.

func (*FileCreate) AddTagIDs

func (fc *FileCreate) AddTagIDs(ids ...uint64) *FileCreate

AddTagIDs adds the "tags" edge to the FileTag entity by IDs.

func (*FileCreate) AddTags

func (fc *FileCreate) AddTags(f ...*FileTag) *FileCreate

AddTags adds the "tags" edges to the FileTag entity.

func (*FileCreate) Exec

func (fc *FileCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreate) ExecContext

func (c *FileCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileCreate) ExecX

func (fc *FileCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileCreate) Mutation

func (fc *FileCreate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileCreate) QueryContext

func (c *FileCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileCreate) Save

func (fc *FileCreate) Save(ctx context.Context) (*File, error)

Save creates the File in the database.

func (*FileCreate) SaveX

func (fc *FileCreate) SaveX(ctx context.Context) *File

SaveX calls Save and panics if Save returns an error.

func (*FileCreate) SetCreatedAt

func (fc *FileCreate) SetCreatedAt(t time.Time) *FileCreate

SetCreatedAt sets the "created_at" field.

func (*FileCreate) SetFileType

func (fc *FileCreate) SetFileType(u uint8) *FileCreate

SetFileType sets the "file_type" field.

func (*FileCreate) SetID

func (fc *FileCreate) SetID(u uuid.UUID) *FileCreate

SetID sets the "id" field.

func (*FileCreate) SetMd5

func (fc *FileCreate) SetMd5(s string) *FileCreate

SetMd5 sets the "md5" field.

func (*FileCreate) SetName

func (fc *FileCreate) SetName(s string) *FileCreate

SetName sets the "name" field.

func (*FileCreate) SetNillableCreatedAt

func (fc *FileCreate) SetNillableCreatedAt(t *time.Time) *FileCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*FileCreate) SetNillableID

func (fc *FileCreate) SetNillableID(u *uuid.UUID) *FileCreate

SetNillableID sets the "id" field if the given value is not nil.

func (*FileCreate) SetNillableStatus

func (fc *FileCreate) SetNillableStatus(u *uint8) *FileCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FileCreate) SetNillableUpdatedAt

func (fc *FileCreate) SetNillableUpdatedAt(t *time.Time) *FileCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*FileCreate) SetNotNilFileType

func (f *FileCreate) SetNotNilFileType(value *uint8) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilMd5

func (f *FileCreate) SetNotNilMd5(value *string) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilName

func (f *FileCreate) SetNotNilName(value *string) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilPath

func (f *FileCreate) SetNotNilPath(value *string) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilSize

func (f *FileCreate) SetNotNilSize(value *uint64) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilStatus

func (f *FileCreate) SetNotNilStatus(value *uint8) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilUpdatedAt

func (f *FileCreate) SetNotNilUpdatedAt(value *time.Time) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilUserID

func (f *FileCreate) SetNotNilUserID(value *string) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetPath

func (fc *FileCreate) SetPath(s string) *FileCreate

SetPath sets the "path" field.

func (*FileCreate) SetSize

func (fc *FileCreate) SetSize(u uint64) *FileCreate

SetSize sets the "size" field.

func (*FileCreate) SetStatus

func (fc *FileCreate) SetStatus(u uint8) *FileCreate

SetStatus sets the "status" field.

func (*FileCreate) SetUpdatedAt

func (fc *FileCreate) SetUpdatedAt(t time.Time) *FileCreate

SetUpdatedAt sets the "updated_at" field.

func (*FileCreate) SetUserID

func (fc *FileCreate) SetUserID(s string) *FileCreate

SetUserID sets the "user_id" field.

type FileCreateBulk

type FileCreateBulk struct {
	// contains filtered or unexported fields
}

FileCreateBulk is the builder for creating many File entities in bulk.

func (*FileCreateBulk) Exec

func (fcb *FileCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileCreateBulk) ExecContext

func (c *FileCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileCreateBulk) ExecX

func (fcb *FileCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileCreateBulk) QueryContext

func (c *FileCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileCreateBulk) Save

func (fcb *FileCreateBulk) Save(ctx context.Context) ([]*File, error)

Save creates the File entities in the database.

func (*FileCreateBulk) SaveX

func (fcb *FileCreateBulk) SaveX(ctx context.Context) []*File

SaveX is like Save, but panics if an error occurs.

type FileDelete

type FileDelete struct {
	// contains filtered or unexported fields
}

FileDelete is the builder for deleting a File entity.

func (*FileDelete) Exec

func (fd *FileDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*FileDelete) ExecContext

func (c *FileDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileDelete) ExecX

func (fd *FileDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*FileDelete) QueryContext

func (c *FileDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileDelete) Where

func (fd *FileDelete) Where(ps ...predicate.File) *FileDelete

Where appends a list predicates to the FileDelete builder.

type FileDeleteOne

type FileDeleteOne struct {
	// contains filtered or unexported fields
}

FileDeleteOne is the builder for deleting a single File entity.

func (*FileDeleteOne) Exec

func (fdo *FileDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileDeleteOne) ExecX

func (fdo *FileDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileDeleteOne) Where

func (fdo *FileDeleteOne) Where(ps ...predicate.File) *FileDeleteOne

Where appends a list predicates to the FileDelete builder.

type FileEdges

type FileEdges struct {
	// Tags holds the value of the tags edge.
	Tags []*FileTag `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

FileEdges holds the relations/edges for other nodes in the graph.

func (FileEdges) TagsOrErr

func (e FileEdges) TagsOrErr() ([]*FileTag, error)

TagsOrErr returns the Tags value or an error if the edge was not loaded in eager-loading.

type FileGroupBy

type FileGroupBy struct {
	// contains filtered or unexported fields
}

FileGroupBy is the group-by builder for File entities.

func (*FileGroupBy) Aggregate

func (fgb *FileGroupBy) Aggregate(fns ...AggregateFunc) *FileGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*FileGroupBy) Bool

func (s *FileGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) BoolX

func (s *FileGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FileGroupBy) Bools

func (s *FileGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) BoolsX

func (s *FileGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FileGroupBy) Float64

func (s *FileGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) Float64X

func (s *FileGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FileGroupBy) Float64s

func (s *FileGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) Float64sX

func (s *FileGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FileGroupBy) Int

func (s *FileGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) IntX

func (s *FileGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FileGroupBy) Ints

func (s *FileGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) IntsX

func (s *FileGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FileGroupBy) Scan

func (fgb *FileGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FileGroupBy) ScanX

func (s *FileGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FileGroupBy) String

func (s *FileGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) StringX

func (s *FileGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FileGroupBy) Strings

func (s *FileGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FileGroupBy) StringsX

func (s *FileGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FileMutation

type FileMutation struct {
	// contains filtered or unexported fields
}

FileMutation represents an operation that mutates the File nodes in the graph.

func (*FileMutation) AddField

func (m *FileMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*FileMutation) AddFileType

func (m *FileMutation) AddFileType(u int8)

AddFileType adds u to the "file_type" field.

func (*FileMutation) AddSize

func (m *FileMutation) AddSize(u int64)

AddSize adds u to the "size" field.

func (*FileMutation) AddStatus

func (m *FileMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*FileMutation) AddTagIDs

func (m *FileMutation) AddTagIDs(ids ...uint64)

AddTagIDs adds the "tags" edge to the FileTag entity by ids.

func (*FileMutation) AddedEdges

func (m *FileMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*FileMutation) AddedField

func (m *FileMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*FileMutation) AddedFields

func (m *FileMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*FileMutation) AddedFileType

func (m *FileMutation) AddedFileType() (r int8, exists bool)

AddedFileType returns the value that was added to the "file_type" field in this mutation.

func (*FileMutation) AddedIDs

func (m *FileMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*FileMutation) AddedSize

func (m *FileMutation) AddedSize() (r int64, exists bool)

AddedSize returns the value that was added to the "size" field in this mutation.

func (*FileMutation) AddedStatus

func (m *FileMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*FileMutation) ClearEdge

func (m *FileMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*FileMutation) ClearField

func (m *FileMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*FileMutation) ClearStatus

func (m *FileMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*FileMutation) ClearTags

func (m *FileMutation) ClearTags()

ClearTags clears the "tags" edge to the FileTag entity.

func (*FileMutation) ClearedEdges

func (m *FileMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*FileMutation) ClearedFields

func (m *FileMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (FileMutation) Client

func (m FileMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*FileMutation) CreatedAt

func (m *FileMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*FileMutation) EdgeCleared

func (m *FileMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*FileMutation) ExecContext

func (c *FileMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileMutation) Field

func (m *FileMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*FileMutation) FieldCleared

func (m *FileMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*FileMutation) Fields

func (m *FileMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*FileMutation) FileType

func (m *FileMutation) FileType() (r uint8, exists bool)

FileType returns the value of the "file_type" field in the mutation.

func (*FileMutation) ID

func (m *FileMutation) ID() (id uuid.UUID, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*FileMutation) IDs

func (m *FileMutation) IDs(ctx context.Context) ([]uuid.UUID, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*FileMutation) Md5

func (m *FileMutation) Md5() (r string, exists bool)

Md5 returns the value of the "md5" field in the mutation.

func (*FileMutation) Name

func (m *FileMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*FileMutation) OldCreatedAt

func (m *FileMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) OldField

func (m *FileMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*FileMutation) OldFileType

func (m *FileMutation) OldFileType(ctx context.Context) (v uint8, err error)

OldFileType returns the old "file_type" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) OldMd5

func (m *FileMutation) OldMd5(ctx context.Context) (v string, err error)

OldMd5 returns the old "md5" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) OldName

func (m *FileMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) OldPath

func (m *FileMutation) OldPath(ctx context.Context) (v string, err error)

OldPath returns the old "path" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) OldSize

func (m *FileMutation) OldSize(ctx context.Context) (v uint64, err error)

OldSize returns the old "size" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) OldStatus

func (m *FileMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) OldUpdatedAt

func (m *FileMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) OldUserID

func (m *FileMutation) OldUserID(ctx context.Context) (v string, err error)

OldUserID returns the old "user_id" field's value of the File entity. If the File object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileMutation) Op

func (m *FileMutation) Op() Op

Op returns the operation name.

func (*FileMutation) Path

func (m *FileMutation) Path() (r string, exists bool)

Path returns the value of the "path" field in the mutation.

func (*FileMutation) QueryContext

func (c *FileMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileMutation) RemoveTagIDs

func (m *FileMutation) RemoveTagIDs(ids ...uint64)

RemoveTagIDs removes the "tags" edge to the FileTag entity by IDs.

func (*FileMutation) RemovedEdges

func (m *FileMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*FileMutation) RemovedIDs

func (m *FileMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*FileMutation) RemovedTagsIDs

func (m *FileMutation) RemovedTagsIDs() (ids []uint64)

RemovedTags returns the removed IDs of the "tags" edge to the FileTag entity.

func (*FileMutation) ResetCreatedAt

func (m *FileMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FileMutation) ResetEdge

func (m *FileMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*FileMutation) ResetField

func (m *FileMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*FileMutation) ResetFileType

func (m *FileMutation) ResetFileType()

ResetFileType resets all changes to the "file_type" field.

func (*FileMutation) ResetMd5

func (m *FileMutation) ResetMd5()

ResetMd5 resets all changes to the "md5" field.

func (*FileMutation) ResetName

func (m *FileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FileMutation) ResetPath

func (m *FileMutation) ResetPath()

ResetPath resets all changes to the "path" field.

func (*FileMutation) ResetSize

func (m *FileMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*FileMutation) ResetStatus

func (m *FileMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*FileMutation) ResetTags

func (m *FileMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*FileMutation) ResetUpdatedAt

func (m *FileMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FileMutation) ResetUserID

func (m *FileMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*FileMutation) SetCreatedAt

func (m *FileMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*FileMutation) SetField

func (m *FileMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*FileMutation) SetFileType

func (m *FileMutation) SetFileType(u uint8)

SetFileType sets the "file_type" field.

func (*FileMutation) SetID

func (m *FileMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of File entities.

func (*FileMutation) SetMd5

func (m *FileMutation) SetMd5(s string)

SetMd5 sets the "md5" field.

func (*FileMutation) SetName

func (m *FileMutation) SetName(s string)

SetName sets the "name" field.

func (*FileMutation) SetOp

func (m *FileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FileMutation) SetPath

func (m *FileMutation) SetPath(s string)

SetPath sets the "path" field.

func (*FileMutation) SetSize

func (m *FileMutation) SetSize(u uint64)

SetSize sets the "size" field.

func (*FileMutation) SetStatus

func (m *FileMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*FileMutation) SetUpdatedAt

func (m *FileMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*FileMutation) SetUserID

func (m *FileMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*FileMutation) Size

func (m *FileMutation) Size() (r uint64, exists bool)

Size returns the value of the "size" field in the mutation.

func (*FileMutation) Status

func (m *FileMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*FileMutation) StatusCleared

func (m *FileMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (*FileMutation) TagsCleared

func (m *FileMutation) TagsCleared() bool

TagsCleared reports if the "tags" edge to the FileTag entity was cleared.

func (*FileMutation) TagsIDs

func (m *FileMutation) TagsIDs() (ids []uint64)

TagsIDs returns the "tags" edge IDs in the mutation.

func (FileMutation) Tx

func (m FileMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*FileMutation) Type

func (m *FileMutation) Type() string

Type returns the node type of this mutation (File).

func (*FileMutation) UpdatedAt

func (m *FileMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*FileMutation) UserID

func (m *FileMutation) UserID() (r string, exists bool)

UserID returns the value of the "user_id" field in the mutation.

func (*FileMutation) Where

func (m *FileMutation) Where(ps ...predicate.File)

Where appends a list predicates to the FileMutation builder.

func (*FileMutation) WhereP

func (m *FileMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FileMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type FilePageList

type FilePageList struct {
	List        []*File      `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

FilePageList is File PageList result.

type FilePager

type FilePager struct {
	Order  file.OrderOption
	Filter func(*FileQuery) (*FileQuery, error)
}

func (*FilePager) ApplyFilter

func (p *FilePager) ApplyFilter(query *FileQuery) (*FileQuery, error)

type FilePaginateOption

type FilePaginateOption func(*FilePager)

FilePaginateOption enables pagination customization.

type FileQuery

type FileQuery struct {
	// contains filtered or unexported fields
}

FileQuery is the builder for querying File entities.

func (*FileQuery) Aggregate

func (fq *FileQuery) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate returns a FileSelect configured with the given aggregations.

func (*FileQuery) All

func (fq *FileQuery) All(ctx context.Context) ([]*File, error)

All executes the query and returns a list of Files.

func (*FileQuery) AllX

func (fq *FileQuery) AllX(ctx context.Context) []*File

AllX is like All, but panics if an error occurs.

func (*FileQuery) Clone

func (fq *FileQuery) Clone() *FileQuery

Clone returns a duplicate of the FileQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*FileQuery) Count

func (fq *FileQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileQuery) CountX

func (fq *FileQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*FileQuery) ExecContext

func (c *FileQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileQuery) Exist

func (fq *FileQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*FileQuery) ExistX

func (fq *FileQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*FileQuery) First

func (fq *FileQuery) First(ctx context.Context) (*File, error)

First returns the first File entity from the query. Returns a *NotFoundError when no File was found.

func (*FileQuery) FirstID

func (fq *FileQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first File ID from the query. Returns a *NotFoundError when no File ID was found.

func (*FileQuery) FirstIDX

func (fq *FileQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*FileQuery) FirstX

func (fq *FileQuery) FirstX(ctx context.Context) *File

FirstX is like First, but panics if an error occurs.

func (*FileQuery) GroupBy

func (fq *FileQuery) GroupBy(field string, fields ...string) *FileGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.File.Query().
	GroupBy(file.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FileQuery) IDs

func (fq *FileQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of File IDs.

func (*FileQuery) IDsX

func (fq *FileQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*FileQuery) Limit

func (fq *FileQuery) Limit(limit int) *FileQuery

Limit the number of records to be returned by this query.

func (*FileQuery) Offset

func (fq *FileQuery) Offset(offset int) *FileQuery

Offset to start from.

func (*FileQuery) Only

func (fq *FileQuery) Only(ctx context.Context) (*File, error)

Only returns a single File entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one File entity is found. Returns a *NotFoundError when no File entities are found.

func (*FileQuery) OnlyID

func (fq *FileQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only File ID in the query. Returns a *NotSingularError when more than one File ID is found. Returns a *NotFoundError when no entities are found.

func (*FileQuery) OnlyIDX

func (fq *FileQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*FileQuery) OnlyX

func (fq *FileQuery) OnlyX(ctx context.Context) *File

OnlyX is like Only, but panics if an error occurs.

func (*FileQuery) Order

func (fq *FileQuery) Order(o ...file.OrderOption) *FileQuery

Order specifies how the records should be ordered.

func (*FileQuery) Page

func (f *FileQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...FilePaginateOption,
) (*FilePageList, error)

func (*FileQuery) QueryContext

func (c *FileQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileQuery) QueryTags

func (fq *FileQuery) QueryTags() *FileTagQuery

QueryTags chains the current query on the "tags" edge.

func (*FileQuery) Select

func (fq *FileQuery) Select(fields ...string) *FileSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.File.Query().
	Select(file.FieldCreatedAt).
	Scan(ctx, &v)

func (*FileQuery) Unique

func (fq *FileQuery) Unique(unique bool) *FileQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*FileQuery) Where

func (fq *FileQuery) Where(ps ...predicate.File) *FileQuery

Where adds a new predicate for the FileQuery builder.

func (*FileQuery) WithTags

func (fq *FileQuery) WithTags(opts ...func(*FileTagQuery)) *FileQuery

WithTags tells the query-builder to eager-load the nodes that are connected to the "tags" edge. The optional arguments are used to configure the query builder of the edge.

type FileSelect

type FileSelect struct {
	*FileQuery
	// contains filtered or unexported fields
}

FileSelect is the builder for selecting fields of File entities.

func (*FileSelect) Aggregate

func (fs *FileSelect) Aggregate(fns ...AggregateFunc) *FileSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileSelect) Bool

func (s *FileSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FileSelect) BoolX

func (s *FileSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FileSelect) Bools

func (s *FileSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FileSelect) BoolsX

func (s *FileSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (FileSelect) ExecContext

func (c FileSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileSelect) Float64

func (s *FileSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FileSelect) Float64X

func (s *FileSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FileSelect) Float64s

func (s *FileSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FileSelect) Float64sX

func (s *FileSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FileSelect) Int

func (s *FileSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FileSelect) IntX

func (s *FileSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FileSelect) Ints

func (s *FileSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FileSelect) IntsX

func (s *FileSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (FileSelect) QueryContext

func (c FileSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileSelect) Scan

func (fs *FileSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FileSelect) ScanX

func (s *FileSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FileSelect) String

func (s *FileSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FileSelect) StringX

func (s *FileSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FileSelect) Strings

func (s *FileSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FileSelect) StringsX

func (s *FileSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FileTag

type FileTag struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Status 1: normal 2: ban | 状态 1 正常 2 禁用
	Status uint8 `json:"status,omitempty"`
	// FileTag's name | 标签名称
	Name string `json:"name,omitempty"`
	// The remark of tag | 标签的备注
	Remark string `json:"remark,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the FileTagQuery when eager-loading is set.
	Edges FileTagEdges `json:"edges"`
	// contains filtered or unexported fields
}

File's Tags Table | 文件标签表

func (*FileTag) ExecContext

func (c *FileTag) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTag) QueryContext

func (c *FileTag) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTag) QueryFiles

func (ft *FileTag) QueryFiles() *FileQuery

QueryFiles queries the "files" edge of the FileTag entity.

func (*FileTag) String

func (ft *FileTag) String() string

String implements the fmt.Stringer.

func (*FileTag) Unwrap

func (ft *FileTag) Unwrap() *FileTag

Unwrap unwraps the FileTag entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*FileTag) Update

func (ft *FileTag) Update() *FileTagUpdateOne

Update returns a builder for updating this FileTag. Note that you need to call FileTag.Unwrap() before calling this method if this FileTag was returned from a transaction, and the transaction was committed or rolled back.

func (*FileTag) Value

func (ft *FileTag) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the FileTag. This includes values selected through modifiers, order, etc.

type FileTagClient

type FileTagClient struct {
	// contains filtered or unexported fields
}

FileTagClient is a client for the FileTag schema.

func NewFileTagClient

func NewFileTagClient(c config) *FileTagClient

NewFileTagClient returns a client for the FileTag from the given config.

func (*FileTagClient) Create

func (c *FileTagClient) Create() *FileTagCreate

Create returns a builder for creating a FileTag entity.

func (*FileTagClient) CreateBulk

func (c *FileTagClient) CreateBulk(builders ...*FileTagCreate) *FileTagCreateBulk

CreateBulk returns a builder for creating a bulk of FileTag entities.

func (*FileTagClient) Delete

func (c *FileTagClient) Delete() *FileTagDelete

Delete returns a delete builder for FileTag.

func (*FileTagClient) DeleteOne

func (c *FileTagClient) DeleteOne(ft *FileTag) *FileTagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileTagClient) DeleteOneID

func (c *FileTagClient) DeleteOneID(id uint64) *FileTagDeleteOne

DeleteOneID returns a builder for deleting the given entity by its id.

func (*FileTagClient) ExecContext

func (c *FileTagClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagClient) Get

func (c *FileTagClient) Get(ctx context.Context, id uint64) (*FileTag, error)

Get returns a FileTag entity by its id.

func (*FileTagClient) GetX

func (c *FileTagClient) GetX(ctx context.Context, id uint64) *FileTag

GetX is like Get, but panics if an error occurs.

func (*FileTagClient) Hooks

func (c *FileTagClient) Hooks() []Hook

Hooks returns the client hooks.

func (*FileTagClient) Intercept

func (c *FileTagClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `filetag.Intercept(f(g(h())))`.

func (*FileTagClient) Interceptors

func (c *FileTagClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*FileTagClient) MapCreateBulk

func (c *FileTagClient) MapCreateBulk(slice any, setFunc func(*FileTagCreate, int)) *FileTagCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*FileTagClient) Query

func (c *FileTagClient) Query() *FileTagQuery

Query returns a query builder for FileTag.

func (*FileTagClient) QueryContext

func (c *FileTagClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagClient) QueryFiles

func (c *FileTagClient) QueryFiles(ft *FileTag) *FileQuery

QueryFiles queries the files edge of a FileTag.

func (*FileTagClient) Update

func (c *FileTagClient) Update() *FileTagUpdate

Update returns an update builder for FileTag.

func (*FileTagClient) UpdateOne

func (c *FileTagClient) UpdateOne(ft *FileTag) *FileTagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileTagClient) UpdateOneID

func (c *FileTagClient) UpdateOneID(id uint64) *FileTagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileTagClient) Use

func (c *FileTagClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `filetag.Hooks(f(g(h())))`.

type FileTagCreate

type FileTagCreate struct {
	// contains filtered or unexported fields
}

FileTagCreate is the builder for creating a FileTag entity.

func (*FileTagCreate) AddFileIDs

func (ftc *FileTagCreate) AddFileIDs(ids ...uuid.UUID) *FileTagCreate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*FileTagCreate) AddFiles

func (ftc *FileTagCreate) AddFiles(f ...*File) *FileTagCreate

AddFiles adds the "files" edges to the File entity.

func (*FileTagCreate) Exec

func (ftc *FileTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileTagCreate) ExecContext

func (c *FileTagCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagCreate) ExecX

func (ftc *FileTagCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileTagCreate) Mutation

func (ftc *FileTagCreate) Mutation() *FileTagMutation

Mutation returns the FileTagMutation object of the builder.

func (*FileTagCreate) QueryContext

func (c *FileTagCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagCreate) Save

func (ftc *FileTagCreate) Save(ctx context.Context) (*FileTag, error)

Save creates the FileTag in the database.

func (*FileTagCreate) SaveX

func (ftc *FileTagCreate) SaveX(ctx context.Context) *FileTag

SaveX calls Save and panics if Save returns an error.

func (*FileTagCreate) SetCreatedAt

func (ftc *FileTagCreate) SetCreatedAt(t time.Time) *FileTagCreate

SetCreatedAt sets the "created_at" field.

func (*FileTagCreate) SetID

func (ftc *FileTagCreate) SetID(u uint64) *FileTagCreate

SetID sets the "id" field.

func (*FileTagCreate) SetName

func (ftc *FileTagCreate) SetName(s string) *FileTagCreate

SetName sets the "name" field.

func (*FileTagCreate) SetNillableCreatedAt

func (ftc *FileTagCreate) SetNillableCreatedAt(t *time.Time) *FileTagCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*FileTagCreate) SetNillableRemark

func (ftc *FileTagCreate) SetNillableRemark(s *string) *FileTagCreate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*FileTagCreate) SetNillableStatus

func (ftc *FileTagCreate) SetNillableStatus(u *uint8) *FileTagCreate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FileTagCreate) SetNillableUpdatedAt

func (ftc *FileTagCreate) SetNillableUpdatedAt(t *time.Time) *FileTagCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*FileTagCreate) SetNotNilName

func (ft *FileTagCreate) SetNotNilName(value *string) *FileTagCreate

set field if value's pointer is not nil.

func (*FileTagCreate) SetNotNilRemark

func (ft *FileTagCreate) SetNotNilRemark(value *string) *FileTagCreate

set field if value's pointer is not nil.

func (*FileTagCreate) SetNotNilStatus

func (ft *FileTagCreate) SetNotNilStatus(value *uint8) *FileTagCreate

set field if value's pointer is not nil.

func (*FileTagCreate) SetNotNilUpdatedAt

func (ft *FileTagCreate) SetNotNilUpdatedAt(value *time.Time) *FileTagCreate

set field if value's pointer is not nil.

func (*FileTagCreate) SetRemark

func (ftc *FileTagCreate) SetRemark(s string) *FileTagCreate

SetRemark sets the "remark" field.

func (*FileTagCreate) SetStatus

func (ftc *FileTagCreate) SetStatus(u uint8) *FileTagCreate

SetStatus sets the "status" field.

func (*FileTagCreate) SetUpdatedAt

func (ftc *FileTagCreate) SetUpdatedAt(t time.Time) *FileTagCreate

SetUpdatedAt sets the "updated_at" field.

type FileTagCreateBulk

type FileTagCreateBulk struct {
	// contains filtered or unexported fields
}

FileTagCreateBulk is the builder for creating many FileTag entities in bulk.

func (*FileTagCreateBulk) Exec

func (ftcb *FileTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileTagCreateBulk) ExecContext

func (c *FileTagCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagCreateBulk) ExecX

func (ftcb *FileTagCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileTagCreateBulk) QueryContext

func (c *FileTagCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagCreateBulk) Save

func (ftcb *FileTagCreateBulk) Save(ctx context.Context) ([]*FileTag, error)

Save creates the FileTag entities in the database.

func (*FileTagCreateBulk) SaveX

func (ftcb *FileTagCreateBulk) SaveX(ctx context.Context) []*FileTag

SaveX is like Save, but panics if an error occurs.

type FileTagDelete

type FileTagDelete struct {
	// contains filtered or unexported fields
}

FileTagDelete is the builder for deleting a FileTag entity.

func (*FileTagDelete) Exec

func (ftd *FileTagDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*FileTagDelete) ExecContext

func (c *FileTagDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagDelete) ExecX

func (ftd *FileTagDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*FileTagDelete) QueryContext

func (c *FileTagDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagDelete) Where

func (ftd *FileTagDelete) Where(ps ...predicate.FileTag) *FileTagDelete

Where appends a list predicates to the FileTagDelete builder.

type FileTagDeleteOne

type FileTagDeleteOne struct {
	// contains filtered or unexported fields
}

FileTagDeleteOne is the builder for deleting a single FileTag entity.

func (*FileTagDeleteOne) Exec

func (ftdo *FileTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileTagDeleteOne) ExecX

func (ftdo *FileTagDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileTagDeleteOne) Where

func (ftdo *FileTagDeleteOne) Where(ps ...predicate.FileTag) *FileTagDeleteOne

Where appends a list predicates to the FileTagDelete builder.

type FileTagEdges

type FileTagEdges struct {
	// Files holds the value of the files edge.
	Files []*File `json:"files,omitempty"`
	// contains filtered or unexported fields
}

FileTagEdges holds the relations/edges for other nodes in the graph.

func (FileTagEdges) FilesOrErr

func (e FileTagEdges) FilesOrErr() ([]*File, error)

FilesOrErr returns the Files value or an error if the edge was not loaded in eager-loading.

type FileTagGroupBy

type FileTagGroupBy struct {
	// contains filtered or unexported fields
}

FileTagGroupBy is the group-by builder for FileTag entities.

func (*FileTagGroupBy) Aggregate

func (ftgb *FileTagGroupBy) Aggregate(fns ...AggregateFunc) *FileTagGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*FileTagGroupBy) Bool

func (s *FileTagGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FileTagGroupBy) BoolX

func (s *FileTagGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FileTagGroupBy) Bools

func (s *FileTagGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FileTagGroupBy) BoolsX

func (s *FileTagGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*FileTagGroupBy) Float64

func (s *FileTagGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FileTagGroupBy) Float64X

func (s *FileTagGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FileTagGroupBy) Float64s

func (s *FileTagGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FileTagGroupBy) Float64sX

func (s *FileTagGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FileTagGroupBy) Int

func (s *FileTagGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FileTagGroupBy) IntX

func (s *FileTagGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FileTagGroupBy) Ints

func (s *FileTagGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FileTagGroupBy) IntsX

func (s *FileTagGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*FileTagGroupBy) Scan

func (ftgb *FileTagGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FileTagGroupBy) ScanX

func (s *FileTagGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FileTagGroupBy) String

func (s *FileTagGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FileTagGroupBy) StringX

func (s *FileTagGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FileTagGroupBy) Strings

func (s *FileTagGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FileTagGroupBy) StringsX

func (s *FileTagGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FileTagMutation

type FileTagMutation struct {
	// contains filtered or unexported fields
}

FileTagMutation represents an operation that mutates the FileTag nodes in the graph.

func (*FileTagMutation) AddField

func (m *FileTagMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*FileTagMutation) AddFileIDs

func (m *FileTagMutation) AddFileIDs(ids ...uuid.UUID)

AddFileIDs adds the "files" edge to the File entity by ids.

func (*FileTagMutation) AddStatus

func (m *FileTagMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*FileTagMutation) AddedEdges

func (m *FileTagMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*FileTagMutation) AddedField

func (m *FileTagMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*FileTagMutation) AddedFields

func (m *FileTagMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*FileTagMutation) AddedIDs

func (m *FileTagMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*FileTagMutation) AddedStatus

func (m *FileTagMutation) AddedStatus() (r int8, exists bool)

AddedStatus returns the value that was added to the "status" field in this mutation.

func (*FileTagMutation) ClearEdge

func (m *FileTagMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*FileTagMutation) ClearField

func (m *FileTagMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*FileTagMutation) ClearFiles

func (m *FileTagMutation) ClearFiles()

ClearFiles clears the "files" edge to the File entity.

func (*FileTagMutation) ClearRemark

func (m *FileTagMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*FileTagMutation) ClearStatus

func (m *FileTagMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*FileTagMutation) ClearedEdges

func (m *FileTagMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*FileTagMutation) ClearedFields

func (m *FileTagMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (FileTagMutation) Client

func (m FileTagMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*FileTagMutation) CreatedAt

func (m *FileTagMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*FileTagMutation) EdgeCleared

func (m *FileTagMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*FileTagMutation) ExecContext

func (c *FileTagMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagMutation) Field

func (m *FileTagMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*FileTagMutation) FieldCleared

func (m *FileTagMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*FileTagMutation) Fields

func (m *FileTagMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*FileTagMutation) FilesCleared

func (m *FileTagMutation) FilesCleared() bool

FilesCleared reports if the "files" edge to the File entity was cleared.

func (*FileTagMutation) FilesIDs

func (m *FileTagMutation) FilesIDs() (ids []uuid.UUID)

FilesIDs returns the "files" edge IDs in the mutation.

func (*FileTagMutation) ID

func (m *FileTagMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*FileTagMutation) IDs

func (m *FileTagMutation) IDs(ctx context.Context) ([]uint64, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*FileTagMutation) Name

func (m *FileTagMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*FileTagMutation) OldCreatedAt

func (m *FileTagMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the FileTag entity. If the FileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileTagMutation) OldField

func (m *FileTagMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*FileTagMutation) OldName

func (m *FileTagMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the FileTag entity. If the FileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileTagMutation) OldRemark

func (m *FileTagMutation) OldRemark(ctx context.Context) (v string, err error)

OldRemark returns the old "remark" field's value of the FileTag entity. If the FileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileTagMutation) OldStatus

func (m *FileTagMutation) OldStatus(ctx context.Context) (v uint8, err error)

OldStatus returns the old "status" field's value of the FileTag entity. If the FileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileTagMutation) OldUpdatedAt

func (m *FileTagMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the FileTag entity. If the FileTag object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*FileTagMutation) Op

func (m *FileTagMutation) Op() Op

Op returns the operation name.

func (*FileTagMutation) QueryContext

func (c *FileTagMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagMutation) Remark

func (m *FileTagMutation) Remark() (r string, exists bool)

Remark returns the value of the "remark" field in the mutation.

func (*FileTagMutation) RemarkCleared

func (m *FileTagMutation) RemarkCleared() bool

RemarkCleared returns if the "remark" field was cleared in this mutation.

func (*FileTagMutation) RemoveFileIDs

func (m *FileTagMutation) RemoveFileIDs(ids ...uuid.UUID)

RemoveFileIDs removes the "files" edge to the File entity by IDs.

func (*FileTagMutation) RemovedEdges

func (m *FileTagMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*FileTagMutation) RemovedFilesIDs

func (m *FileTagMutation) RemovedFilesIDs() (ids []uuid.UUID)

RemovedFiles returns the removed IDs of the "files" edge to the File entity.

func (*FileTagMutation) RemovedIDs

func (m *FileTagMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*FileTagMutation) ResetCreatedAt

func (m *FileTagMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FileTagMutation) ResetEdge

func (m *FileTagMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*FileTagMutation) ResetField

func (m *FileTagMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*FileTagMutation) ResetFiles

func (m *FileTagMutation) ResetFiles()

ResetFiles resets all changes to the "files" edge.

func (*FileTagMutation) ResetName

func (m *FileTagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FileTagMutation) ResetRemark

func (m *FileTagMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*FileTagMutation) ResetStatus

func (m *FileTagMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*FileTagMutation) ResetUpdatedAt

func (m *FileTagMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FileTagMutation) SetCreatedAt

func (m *FileTagMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*FileTagMutation) SetField

func (m *FileTagMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*FileTagMutation) SetID

func (m *FileTagMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of FileTag entities.

func (*FileTagMutation) SetName

func (m *FileTagMutation) SetName(s string)

SetName sets the "name" field.

func (*FileTagMutation) SetOp

func (m *FileTagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FileTagMutation) SetRemark

func (m *FileTagMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*FileTagMutation) SetStatus

func (m *FileTagMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*FileTagMutation) SetUpdatedAt

func (m *FileTagMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*FileTagMutation) Status

func (m *FileTagMutation) Status() (r uint8, exists bool)

Status returns the value of the "status" field in the mutation.

func (*FileTagMutation) StatusCleared

func (m *FileTagMutation) StatusCleared() bool

StatusCleared returns if the "status" field was cleared in this mutation.

func (FileTagMutation) Tx

func (m FileTagMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*FileTagMutation) Type

func (m *FileTagMutation) Type() string

Type returns the node type of this mutation (FileTag).

func (*FileTagMutation) UpdatedAt

func (m *FileTagMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*FileTagMutation) Where

func (m *FileTagMutation) Where(ps ...predicate.FileTag)

Where appends a list predicates to the FileTagMutation builder.

func (*FileTagMutation) WhereP

func (m *FileTagMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the FileTagMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type FileTagPageList

type FileTagPageList struct {
	List        []*FileTag   `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

FileTagPageList is FileTag PageList result.

type FileTagPager

type FileTagPager struct {
	Order  filetag.OrderOption
	Filter func(*FileTagQuery) (*FileTagQuery, error)
}

func (*FileTagPager) ApplyFilter

func (p *FileTagPager) ApplyFilter(query *FileTagQuery) (*FileTagQuery, error)

type FileTagPaginateOption

type FileTagPaginateOption func(*FileTagPager)

FileTagPaginateOption enables pagination customization.

type FileTagQuery

type FileTagQuery struct {
	// contains filtered or unexported fields
}

FileTagQuery is the builder for querying FileTag entities.

func (*FileTagQuery) Aggregate

func (ftq *FileTagQuery) Aggregate(fns ...AggregateFunc) *FileTagSelect

Aggregate returns a FileTagSelect configured with the given aggregations.

func (*FileTagQuery) All

func (ftq *FileTagQuery) All(ctx context.Context) ([]*FileTag, error)

All executes the query and returns a list of FileTags.

func (*FileTagQuery) AllX

func (ftq *FileTagQuery) AllX(ctx context.Context) []*FileTag

AllX is like All, but panics if an error occurs.

func (*FileTagQuery) Clone

func (ftq *FileTagQuery) Clone() *FileTagQuery

Clone returns a duplicate of the FileTagQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*FileTagQuery) Count

func (ftq *FileTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileTagQuery) CountX

func (ftq *FileTagQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*FileTagQuery) ExecContext

func (c *FileTagQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagQuery) Exist

func (ftq *FileTagQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*FileTagQuery) ExistX

func (ftq *FileTagQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*FileTagQuery) First

func (ftq *FileTagQuery) First(ctx context.Context) (*FileTag, error)

First returns the first FileTag entity from the query. Returns a *NotFoundError when no FileTag was found.

func (*FileTagQuery) FirstID

func (ftq *FileTagQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first FileTag ID from the query. Returns a *NotFoundError when no FileTag ID was found.

func (*FileTagQuery) FirstIDX

func (ftq *FileTagQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*FileTagQuery) FirstX

func (ftq *FileTagQuery) FirstX(ctx context.Context) *FileTag

FirstX is like First, but panics if an error occurs.

func (*FileTagQuery) GroupBy

func (ftq *FileTagQuery) GroupBy(field string, fields ...string) *FileTagGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.FileTag.Query().
	GroupBy(filetag.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*FileTagQuery) IDs

func (ftq *FileTagQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of FileTag IDs.

func (*FileTagQuery) IDsX

func (ftq *FileTagQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*FileTagQuery) Limit

func (ftq *FileTagQuery) Limit(limit int) *FileTagQuery

Limit the number of records to be returned by this query.

func (*FileTagQuery) Offset

func (ftq *FileTagQuery) Offset(offset int) *FileTagQuery

Offset to start from.

func (*FileTagQuery) Only

func (ftq *FileTagQuery) Only(ctx context.Context) (*FileTag, error)

Only returns a single FileTag entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one FileTag entity is found. Returns a *NotFoundError when no FileTag entities are found.

func (*FileTagQuery) OnlyID

func (ftq *FileTagQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only FileTag ID in the query. Returns a *NotSingularError when more than one FileTag ID is found. Returns a *NotFoundError when no entities are found.

func (*FileTagQuery) OnlyIDX

func (ftq *FileTagQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*FileTagQuery) OnlyX

func (ftq *FileTagQuery) OnlyX(ctx context.Context) *FileTag

OnlyX is like Only, but panics if an error occurs.

func (*FileTagQuery) Order

func (ftq *FileTagQuery) Order(o ...filetag.OrderOption) *FileTagQuery

Order specifies how the records should be ordered.

func (*FileTagQuery) Page

func (ft *FileTagQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...FileTagPaginateOption,
) (*FileTagPageList, error)

func (*FileTagQuery) QueryContext

func (c *FileTagQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagQuery) QueryFiles

func (ftq *FileTagQuery) QueryFiles() *FileQuery

QueryFiles chains the current query on the "files" edge.

func (*FileTagQuery) Select

func (ftq *FileTagQuery) Select(fields ...string) *FileTagSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.FileTag.Query().
	Select(filetag.FieldCreatedAt).
	Scan(ctx, &v)

func (*FileTagQuery) Unique

func (ftq *FileTagQuery) Unique(unique bool) *FileTagQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*FileTagQuery) Where

func (ftq *FileTagQuery) Where(ps ...predicate.FileTag) *FileTagQuery

Where adds a new predicate for the FileTagQuery builder.

func (*FileTagQuery) WithFiles

func (ftq *FileTagQuery) WithFiles(opts ...func(*FileQuery)) *FileTagQuery

WithFiles tells the query-builder to eager-load the nodes that are connected to the "files" edge. The optional arguments are used to configure the query builder of the edge.

type FileTagSelect

type FileTagSelect struct {
	*FileTagQuery
	// contains filtered or unexported fields
}

FileTagSelect is the builder for selecting fields of FileTag entities.

func (*FileTagSelect) Aggregate

func (fts *FileTagSelect) Aggregate(fns ...AggregateFunc) *FileTagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileTagSelect) Bool

func (s *FileTagSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*FileTagSelect) BoolX

func (s *FileTagSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*FileTagSelect) Bools

func (s *FileTagSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*FileTagSelect) BoolsX

func (s *FileTagSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (FileTagSelect) ExecContext

func (c FileTagSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagSelect) Float64

func (s *FileTagSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*FileTagSelect) Float64X

func (s *FileTagSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*FileTagSelect) Float64s

func (s *FileTagSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*FileTagSelect) Float64sX

func (s *FileTagSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*FileTagSelect) Int

func (s *FileTagSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*FileTagSelect) IntX

func (s *FileTagSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*FileTagSelect) Ints

func (s *FileTagSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*FileTagSelect) IntsX

func (s *FileTagSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (FileTagSelect) QueryContext

func (c FileTagSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagSelect) Scan

func (fts *FileTagSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*FileTagSelect) ScanX

func (s *FileTagSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*FileTagSelect) String

func (s *FileTagSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*FileTagSelect) StringX

func (s *FileTagSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*FileTagSelect) Strings

func (s *FileTagSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*FileTagSelect) StringsX

func (s *FileTagSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type FileTagUpdate

type FileTagUpdate struct {
	// contains filtered or unexported fields
}

FileTagUpdate is the builder for updating FileTag entities.

func (*FileTagUpdate) AddFileIDs

func (ftu *FileTagUpdate) AddFileIDs(ids ...uuid.UUID) *FileTagUpdate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*FileTagUpdate) AddFiles

func (ftu *FileTagUpdate) AddFiles(f ...*File) *FileTagUpdate

AddFiles adds the "files" edges to the File entity.

func (*FileTagUpdate) AddStatus

func (ftu *FileTagUpdate) AddStatus(u int8) *FileTagUpdate

AddStatus adds u to the "status" field.

func (*FileTagUpdate) ClearFiles

func (ftu *FileTagUpdate) ClearFiles() *FileTagUpdate

ClearFiles clears all "files" edges to the File entity.

func (*FileTagUpdate) ClearRemark

func (ftu *FileTagUpdate) ClearRemark() *FileTagUpdate

ClearRemark clears the value of the "remark" field.

func (*FileTagUpdate) ClearStatus

func (ftu *FileTagUpdate) ClearStatus() *FileTagUpdate

ClearStatus clears the value of the "status" field.

func (*FileTagUpdate) Exec

func (ftu *FileTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileTagUpdate) ExecContext

func (c *FileTagUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagUpdate) ExecX

func (ftu *FileTagUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileTagUpdate) Mutation

func (ftu *FileTagUpdate) Mutation() *FileTagMutation

Mutation returns the FileTagMutation object of the builder.

func (*FileTagUpdate) QueryContext

func (c *FileTagUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagUpdate) RemoveFileIDs

func (ftu *FileTagUpdate) RemoveFileIDs(ids ...uuid.UUID) *FileTagUpdate

RemoveFileIDs removes the "files" edge to File entities by IDs.

func (*FileTagUpdate) RemoveFiles

func (ftu *FileTagUpdate) RemoveFiles(f ...*File) *FileTagUpdate

RemoveFiles removes "files" edges to File entities.

func (*FileTagUpdate) Save

func (ftu *FileTagUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*FileTagUpdate) SaveX

func (ftu *FileTagUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*FileTagUpdate) SetName

func (ftu *FileTagUpdate) SetName(s string) *FileTagUpdate

SetName sets the "name" field.

func (*FileTagUpdate) SetNillableName

func (ftu *FileTagUpdate) SetNillableName(s *string) *FileTagUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*FileTagUpdate) SetNillableRemark

func (ftu *FileTagUpdate) SetNillableRemark(s *string) *FileTagUpdate

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*FileTagUpdate) SetNillableStatus

func (ftu *FileTagUpdate) SetNillableStatus(u *uint8) *FileTagUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FileTagUpdate) SetNotNilName

func (ft *FileTagUpdate) SetNotNilName(value *string) *FileTagUpdate

set field if value's pointer is not nil.

func (*FileTagUpdate) SetNotNilRemark

func (ft *FileTagUpdate) SetNotNilRemark(value *string) *FileTagUpdate

set field if value's pointer is not nil.

func (*FileTagUpdate) SetNotNilStatus

func (ft *FileTagUpdate) SetNotNilStatus(value *uint8) *FileTagUpdate

set field if value's pointer is not nil.

func (*FileTagUpdate) SetNotNilUpdatedAt

func (ft *FileTagUpdate) SetNotNilUpdatedAt(value *time.Time) *FileTagUpdate

set field if value's pointer is not nil.

func (*FileTagUpdate) SetRemark

func (ftu *FileTagUpdate) SetRemark(s string) *FileTagUpdate

SetRemark sets the "remark" field.

func (*FileTagUpdate) SetStatus

func (ftu *FileTagUpdate) SetStatus(u uint8) *FileTagUpdate

SetStatus sets the "status" field.

func (*FileTagUpdate) SetUpdatedAt

func (ftu *FileTagUpdate) SetUpdatedAt(t time.Time) *FileTagUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FileTagUpdate) Where

func (ftu *FileTagUpdate) Where(ps ...predicate.FileTag) *FileTagUpdate

Where appends a list predicates to the FileTagUpdate builder.

type FileTagUpdateOne

type FileTagUpdateOne struct {
	// contains filtered or unexported fields
}

FileTagUpdateOne is the builder for updating a single FileTag entity.

func (*FileTagUpdateOne) AddFileIDs

func (ftuo *FileTagUpdateOne) AddFileIDs(ids ...uuid.UUID) *FileTagUpdateOne

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*FileTagUpdateOne) AddFiles

func (ftuo *FileTagUpdateOne) AddFiles(f ...*File) *FileTagUpdateOne

AddFiles adds the "files" edges to the File entity.

func (*FileTagUpdateOne) AddStatus

func (ftuo *FileTagUpdateOne) AddStatus(u int8) *FileTagUpdateOne

AddStatus adds u to the "status" field.

func (*FileTagUpdateOne) ClearFiles

func (ftuo *FileTagUpdateOne) ClearFiles() *FileTagUpdateOne

ClearFiles clears all "files" edges to the File entity.

func (*FileTagUpdateOne) ClearRemark

func (ftuo *FileTagUpdateOne) ClearRemark() *FileTagUpdateOne

ClearRemark clears the value of the "remark" field.

func (*FileTagUpdateOne) ClearStatus

func (ftuo *FileTagUpdateOne) ClearStatus() *FileTagUpdateOne

ClearStatus clears the value of the "status" field.

func (*FileTagUpdateOne) Exec

func (ftuo *FileTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileTagUpdateOne) ExecContext

func (c *FileTagUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileTagUpdateOne) ExecX

func (ftuo *FileTagUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileTagUpdateOne) Mutation

func (ftuo *FileTagUpdateOne) Mutation() *FileTagMutation

Mutation returns the FileTagMutation object of the builder.

func (*FileTagUpdateOne) QueryContext

func (c *FileTagUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileTagUpdateOne) RemoveFileIDs

func (ftuo *FileTagUpdateOne) RemoveFileIDs(ids ...uuid.UUID) *FileTagUpdateOne

RemoveFileIDs removes the "files" edge to File entities by IDs.

func (*FileTagUpdateOne) RemoveFiles

func (ftuo *FileTagUpdateOne) RemoveFiles(f ...*File) *FileTagUpdateOne

RemoveFiles removes "files" edges to File entities.

func (*FileTagUpdateOne) Save

func (ftuo *FileTagUpdateOne) Save(ctx context.Context) (*FileTag, error)

Save executes the query and returns the updated FileTag entity.

func (*FileTagUpdateOne) SaveX

func (ftuo *FileTagUpdateOne) SaveX(ctx context.Context) *FileTag

SaveX is like Save, but panics if an error occurs.

func (*FileTagUpdateOne) Select

func (ftuo *FileTagUpdateOne) Select(field string, fields ...string) *FileTagUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*FileTagUpdateOne) SetName

func (ftuo *FileTagUpdateOne) SetName(s string) *FileTagUpdateOne

SetName sets the "name" field.

func (*FileTagUpdateOne) SetNillableName

func (ftuo *FileTagUpdateOne) SetNillableName(s *string) *FileTagUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*FileTagUpdateOne) SetNillableRemark

func (ftuo *FileTagUpdateOne) SetNillableRemark(s *string) *FileTagUpdateOne

SetNillableRemark sets the "remark" field if the given value is not nil.

func (*FileTagUpdateOne) SetNillableStatus

func (ftuo *FileTagUpdateOne) SetNillableStatus(u *uint8) *FileTagUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FileTagUpdateOne) SetNotNilName

func (ft *FileTagUpdateOne) SetNotNilName(value *string) *FileTagUpdateOne

set field if value's pointer is not nil.

func (*FileTagUpdateOne) SetNotNilRemark

func (ft *FileTagUpdateOne) SetNotNilRemark(value *string) *FileTagUpdateOne

set field if value's pointer is not nil.

func (*FileTagUpdateOne) SetNotNilStatus

func (ft *FileTagUpdateOne) SetNotNilStatus(value *uint8) *FileTagUpdateOne

set field if value's pointer is not nil.

func (*FileTagUpdateOne) SetNotNilUpdatedAt

func (ft *FileTagUpdateOne) SetNotNilUpdatedAt(value *time.Time) *FileTagUpdateOne

set field if value's pointer is not nil.

func (*FileTagUpdateOne) SetRemark

func (ftuo *FileTagUpdateOne) SetRemark(s string) *FileTagUpdateOne

SetRemark sets the "remark" field.

func (*FileTagUpdateOne) SetStatus

func (ftuo *FileTagUpdateOne) SetStatus(u uint8) *FileTagUpdateOne

SetStatus sets the "status" field.

func (*FileTagUpdateOne) SetUpdatedAt

func (ftuo *FileTagUpdateOne) SetUpdatedAt(t time.Time) *FileTagUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FileTagUpdateOne) Where

func (ftuo *FileTagUpdateOne) Where(ps ...predicate.FileTag) *FileTagUpdateOne

Where appends a list predicates to the FileTagUpdate builder.

type FileTags

type FileTags []*FileTag

FileTags is a parsable slice of FileTag.

type FileUpdate

type FileUpdate struct {
	// contains filtered or unexported fields
}

FileUpdate is the builder for updating File entities.

func (*FileUpdate) AddFileType

func (fu *FileUpdate) AddFileType(u int8) *FileUpdate

AddFileType adds u to the "file_type" field.

func (*FileUpdate) AddSize

func (fu *FileUpdate) AddSize(u int64) *FileUpdate

AddSize adds u to the "size" field.

func (*FileUpdate) AddStatus

func (fu *FileUpdate) AddStatus(u int8) *FileUpdate

AddStatus adds u to the "status" field.

func (*FileUpdate) AddTagIDs

func (fu *FileUpdate) AddTagIDs(ids ...uint64) *FileUpdate

AddTagIDs adds the "tags" edge to the FileTag entity by IDs.

func (*FileUpdate) AddTags

func (fu *FileUpdate) AddTags(f ...*FileTag) *FileUpdate

AddTags adds the "tags" edges to the FileTag entity.

func (*FileUpdate) ClearStatus

func (fu *FileUpdate) ClearStatus() *FileUpdate

ClearStatus clears the value of the "status" field.

func (*FileUpdate) ClearTags

func (fu *FileUpdate) ClearTags() *FileUpdate

ClearTags clears all "tags" edges to the FileTag entity.

func (*FileUpdate) Exec

func (fu *FileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileUpdate) ExecContext

func (c *FileUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileUpdate) ExecX

func (fu *FileUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileUpdate) Mutation

func (fu *FileUpdate) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdate) QueryContext

func (c *FileUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileUpdate) RemoveTagIDs

func (fu *FileUpdate) RemoveTagIDs(ids ...uint64) *FileUpdate

RemoveTagIDs removes the "tags" edge to FileTag entities by IDs.

func (*FileUpdate) RemoveTags

func (fu *FileUpdate) RemoveTags(f ...*FileTag) *FileUpdate

RemoveTags removes "tags" edges to FileTag entities.

func (*FileUpdate) Save

func (fu *FileUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*FileUpdate) SaveX

func (fu *FileUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*FileUpdate) SetFileType

func (fu *FileUpdate) SetFileType(u uint8) *FileUpdate

SetFileType sets the "file_type" field.

func (*FileUpdate) SetMd5

func (fu *FileUpdate) SetMd5(s string) *FileUpdate

SetMd5 sets the "md5" field.

func (*FileUpdate) SetName

func (fu *FileUpdate) SetName(s string) *FileUpdate

SetName sets the "name" field.

func (*FileUpdate) SetNillableFileType

func (fu *FileUpdate) SetNillableFileType(u *uint8) *FileUpdate

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*FileUpdate) SetNillableMd5

func (fu *FileUpdate) SetNillableMd5(s *string) *FileUpdate

SetNillableMd5 sets the "md5" field if the given value is not nil.

func (*FileUpdate) SetNillableName

func (fu *FileUpdate) SetNillableName(s *string) *FileUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*FileUpdate) SetNillablePath

func (fu *FileUpdate) SetNillablePath(s *string) *FileUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*FileUpdate) SetNillableSize

func (fu *FileUpdate) SetNillableSize(u *uint64) *FileUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*FileUpdate) SetNillableStatus

func (fu *FileUpdate) SetNillableStatus(u *uint8) *FileUpdate

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FileUpdate) SetNillableUserID

func (fu *FileUpdate) SetNillableUserID(s *string) *FileUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FileUpdate) SetNotNilFileType

func (f *FileUpdate) SetNotNilFileType(value *uint8) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilMd5

func (f *FileUpdate) SetNotNilMd5(value *string) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilName

func (f *FileUpdate) SetNotNilName(value *string) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilPath

func (f *FileUpdate) SetNotNilPath(value *string) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilSize

func (f *FileUpdate) SetNotNilSize(value *uint64) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilStatus

func (f *FileUpdate) SetNotNilStatus(value *uint8) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilUpdatedAt

func (f *FileUpdate) SetNotNilUpdatedAt(value *time.Time) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilUserID

func (f *FileUpdate) SetNotNilUserID(value *string) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetPath

func (fu *FileUpdate) SetPath(s string) *FileUpdate

SetPath sets the "path" field.

func (*FileUpdate) SetSize

func (fu *FileUpdate) SetSize(u uint64) *FileUpdate

SetSize sets the "size" field.

func (*FileUpdate) SetStatus

func (fu *FileUpdate) SetStatus(u uint8) *FileUpdate

SetStatus sets the "status" field.

func (*FileUpdate) SetUpdatedAt

func (fu *FileUpdate) SetUpdatedAt(t time.Time) *FileUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FileUpdate) SetUserID

func (fu *FileUpdate) SetUserID(s string) *FileUpdate

SetUserID sets the "user_id" field.

func (*FileUpdate) Where

func (fu *FileUpdate) Where(ps ...predicate.File) *FileUpdate

Where appends a list predicates to the FileUpdate builder.

type FileUpdateOne

type FileUpdateOne struct {
	// contains filtered or unexported fields
}

FileUpdateOne is the builder for updating a single File entity.

func (*FileUpdateOne) AddFileType

func (fuo *FileUpdateOne) AddFileType(u int8) *FileUpdateOne

AddFileType adds u to the "file_type" field.

func (*FileUpdateOne) AddSize

func (fuo *FileUpdateOne) AddSize(u int64) *FileUpdateOne

AddSize adds u to the "size" field.

func (*FileUpdateOne) AddStatus

func (fuo *FileUpdateOne) AddStatus(u int8) *FileUpdateOne

AddStatus adds u to the "status" field.

func (*FileUpdateOne) AddTagIDs

func (fuo *FileUpdateOne) AddTagIDs(ids ...uint64) *FileUpdateOne

AddTagIDs adds the "tags" edge to the FileTag entity by IDs.

func (*FileUpdateOne) AddTags

func (fuo *FileUpdateOne) AddTags(f ...*FileTag) *FileUpdateOne

AddTags adds the "tags" edges to the FileTag entity.

func (*FileUpdateOne) ClearStatus

func (fuo *FileUpdateOne) ClearStatus() *FileUpdateOne

ClearStatus clears the value of the "status" field.

func (*FileUpdateOne) ClearTags

func (fuo *FileUpdateOne) ClearTags() *FileUpdateOne

ClearTags clears all "tags" edges to the FileTag entity.

func (*FileUpdateOne) Exec

func (fuo *FileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileUpdateOne) ExecContext

func (c *FileUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*FileUpdateOne) ExecX

func (fuo *FileUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*FileUpdateOne) Mutation

func (fuo *FileUpdateOne) Mutation() *FileMutation

Mutation returns the FileMutation object of the builder.

func (*FileUpdateOne) QueryContext

func (c *FileUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*FileUpdateOne) RemoveTagIDs

func (fuo *FileUpdateOne) RemoveTagIDs(ids ...uint64) *FileUpdateOne

RemoveTagIDs removes the "tags" edge to FileTag entities by IDs.

func (*FileUpdateOne) RemoveTags

func (fuo *FileUpdateOne) RemoveTags(f ...*FileTag) *FileUpdateOne

RemoveTags removes "tags" edges to FileTag entities.

func (*FileUpdateOne) Save

func (fuo *FileUpdateOne) Save(ctx context.Context) (*File, error)

Save executes the query and returns the updated File entity.

func (*FileUpdateOne) SaveX

func (fuo *FileUpdateOne) SaveX(ctx context.Context) *File

SaveX is like Save, but panics if an error occurs.

func (*FileUpdateOne) Select

func (fuo *FileUpdateOne) Select(field string, fields ...string) *FileUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*FileUpdateOne) SetFileType

func (fuo *FileUpdateOne) SetFileType(u uint8) *FileUpdateOne

SetFileType sets the "file_type" field.

func (*FileUpdateOne) SetMd5

func (fuo *FileUpdateOne) SetMd5(s string) *FileUpdateOne

SetMd5 sets the "md5" field.

func (*FileUpdateOne) SetName

func (fuo *FileUpdateOne) SetName(s string) *FileUpdateOne

SetName sets the "name" field.

func (*FileUpdateOne) SetNillableFileType

func (fuo *FileUpdateOne) SetNillableFileType(u *uint8) *FileUpdateOne

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*FileUpdateOne) SetNillableMd5

func (fuo *FileUpdateOne) SetNillableMd5(s *string) *FileUpdateOne

SetNillableMd5 sets the "md5" field if the given value is not nil.

func (*FileUpdateOne) SetNillableName

func (fuo *FileUpdateOne) SetNillableName(s *string) *FileUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*FileUpdateOne) SetNillablePath

func (fuo *FileUpdateOne) SetNillablePath(s *string) *FileUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*FileUpdateOne) SetNillableSize

func (fuo *FileUpdateOne) SetNillableSize(u *uint64) *FileUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*FileUpdateOne) SetNillableStatus

func (fuo *FileUpdateOne) SetNillableStatus(u *uint8) *FileUpdateOne

SetNillableStatus sets the "status" field if the given value is not nil.

func (*FileUpdateOne) SetNillableUserID

func (fuo *FileUpdateOne) SetNillableUserID(s *string) *FileUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FileUpdateOne) SetNotNilFileType

func (f *FileUpdateOne) SetNotNilFileType(value *uint8) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilMd5

func (f *FileUpdateOne) SetNotNilMd5(value *string) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilName

func (f *FileUpdateOne) SetNotNilName(value *string) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilPath

func (f *FileUpdateOne) SetNotNilPath(value *string) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilSize

func (f *FileUpdateOne) SetNotNilSize(value *uint64) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilStatus

func (f *FileUpdateOne) SetNotNilStatus(value *uint8) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilUpdatedAt

func (f *FileUpdateOne) SetNotNilUpdatedAt(value *time.Time) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilUserID

func (f *FileUpdateOne) SetNotNilUserID(value *string) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetPath

func (fuo *FileUpdateOne) SetPath(s string) *FileUpdateOne

SetPath sets the "path" field.

func (*FileUpdateOne) SetSize

func (fuo *FileUpdateOne) SetSize(u uint64) *FileUpdateOne

SetSize sets the "size" field.

func (*FileUpdateOne) SetStatus

func (fuo *FileUpdateOne) SetStatus(u uint8) *FileUpdateOne

SetStatus sets the "status" field.

func (*FileUpdateOne) SetUpdatedAt

func (fuo *FileUpdateOne) SetUpdatedAt(t time.Time) *FileUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FileUpdateOne) SetUserID

func (fuo *FileUpdateOne) SetUserID(s string) *FileUpdateOne

SetUserID sets the "user_id" field.

func (*FileUpdateOne) Where

func (fuo *FileUpdateOne) Where(ps ...predicate.File) *FileUpdateOne

Where appends a list predicates to the FileUpdate builder.

type Files

type Files []*File

Files is a parsable slice of File.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

ent aliases to avoid import conflicts in user's code.

type Interceptor

type Interceptor = ent.Interceptor

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type NotFoundError

type NotFoundError struct {
	// contains filtered or unexported fields
}

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

type NotLoadedError struct {
	// contains filtered or unexported fields
}

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

type NotSingularError struct {
	// contains filtered or unexported fields
}

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type PageDetails

type PageDetails struct {
	Page  uint64 `json:"page"`
	Size  uint64 `json:"size"`
	Total uint64 `json:"total"`
}

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Querier

type Querier = ent.Querier

ent aliases to avoid import conflicts in user's code.

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type QueryContext

type QueryContext = ent.QueryContext

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type StorageProvider

type StorageProvider struct {

	// ID of the ent.
	ID uint64 `json:"id,omitempty"`
	// Create Time | 创建日期
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Update Time | 修改日期
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// State true: normal false: ban | 状态 true 正常 false 禁用
	State bool `json:"state,omitempty"`
	// The cloud storage service name | 服务名称
	Name string `json:"name,omitempty"`
	// The cloud storage bucket name | 云存储服务的存储桶
	Bucket string `json:"bucket,omitempty"`
	// The secret ID | 密钥 ID
	SecretID string `json:"secret_id,omitempty"`
	// The secret key | 密钥 Key
	SecretKey string `json:"secret_key,omitempty"`
	// The service URL | 服务器地址
	Endpoint string `json:"endpoint,omitempty"`
	// The folder in cloud | 云服务目标文件夹
	Folder string `json:"folder,omitempty"`
	// The service region | 服务器所在地区
	Region string `json:"region,omitempty"`
	// Is it the default provider | 是否为默认提供商
	IsDefault bool `json:"is_default,omitempty"`
	// Does it use CDN | 是否使用 CDN
	UseCdn bool `json:"use_cdn,omitempty"`
	// CDN URL | CDN 地址
	CdnURL string `json:"cdn_url,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the StorageProviderQuery when eager-loading is set.
	Edges StorageProviderEdges `json:"edges"`
	// contains filtered or unexported fields
}

Cloud File's Provider Configuration Table | 云文件服务商配置表

func (*StorageProvider) ExecContext

func (c *StorageProvider) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProvider) QueryCloudfiles

func (sp *StorageProvider) QueryCloudfiles() *CloudFileQuery

QueryCloudfiles queries the "cloudfiles" edge of the StorageProvider entity.

func (*StorageProvider) QueryContext

func (c *StorageProvider) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProvider) String

func (sp *StorageProvider) String() string

String implements the fmt.Stringer.

func (*StorageProvider) Unwrap

func (sp *StorageProvider) Unwrap() *StorageProvider

Unwrap unwraps the StorageProvider entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*StorageProvider) Update

Update returns a builder for updating this StorageProvider. Note that you need to call StorageProvider.Unwrap() before calling this method if this StorageProvider was returned from a transaction, and the transaction was committed or rolled back.

func (*StorageProvider) Value

func (sp *StorageProvider) Value(name string) (ent.Value, error)

Value returns the ent.Value that was dynamically selected and assigned to the StorageProvider. This includes values selected through modifiers, order, etc.

type StorageProviderClient

type StorageProviderClient struct {
	// contains filtered or unexported fields
}

StorageProviderClient is a client for the StorageProvider schema.

func NewStorageProviderClient

func NewStorageProviderClient(c config) *StorageProviderClient

NewStorageProviderClient returns a client for the StorageProvider from the given config.

func (*StorageProviderClient) Create

Create returns a builder for creating a StorageProvider entity.

func (*StorageProviderClient) CreateBulk

CreateBulk returns a builder for creating a bulk of StorageProvider entities.

func (*StorageProviderClient) Delete

Delete returns a delete builder for StorageProvider.

func (*StorageProviderClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*StorageProviderClient) DeleteOneID

DeleteOneID returns a builder for deleting the given entity by its id.

func (*StorageProviderClient) ExecContext

func (c *StorageProviderClient) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderClient) Get

Get returns a StorageProvider entity by its id.

func (*StorageProviderClient) GetX

GetX is like Get, but panics if an error occurs.

func (*StorageProviderClient) Hooks

func (c *StorageProviderClient) Hooks() []Hook

Hooks returns the client hooks.

func (*StorageProviderClient) Intercept

func (c *StorageProviderClient) Intercept(interceptors ...Interceptor)

Intercept adds a list of query interceptors to the interceptors stack. A call to `Intercept(f, g, h)` equals to `storageprovider.Intercept(f(g(h())))`.

func (*StorageProviderClient) Interceptors

func (c *StorageProviderClient) Interceptors() []Interceptor

Interceptors returns the client interceptors.

func (*StorageProviderClient) MapCreateBulk

func (c *StorageProviderClient) MapCreateBulk(slice any, setFunc func(*StorageProviderCreate, int)) *StorageProviderCreateBulk

MapCreateBulk creates a bulk creation builder from the given slice. For each item in the slice, the function creates a builder and applies setFunc on it.

func (*StorageProviderClient) Query

Query returns a query builder for StorageProvider.

func (*StorageProviderClient) QueryCloudfiles

func (c *StorageProviderClient) QueryCloudfiles(sp *StorageProvider) *CloudFileQuery

QueryCloudfiles queries the cloudfiles edge of a StorageProvider.

func (*StorageProviderClient) QueryContext

func (c *StorageProviderClient) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderClient) Update

Update returns an update builder for StorageProvider.

func (*StorageProviderClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*StorageProviderClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*StorageProviderClient) Use

func (c *StorageProviderClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `storageprovider.Hooks(f(g(h())))`.

type StorageProviderCreate

type StorageProviderCreate struct {
	// contains filtered or unexported fields
}

StorageProviderCreate is the builder for creating a StorageProvider entity.

func (*StorageProviderCreate) AddCloudfileIDs

func (spc *StorageProviderCreate) AddCloudfileIDs(ids ...uuid.UUID) *StorageProviderCreate

AddCloudfileIDs adds the "cloudfiles" edge to the CloudFile entity by IDs.

func (*StorageProviderCreate) AddCloudfiles

func (spc *StorageProviderCreate) AddCloudfiles(c ...*CloudFile) *StorageProviderCreate

AddCloudfiles adds the "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderCreate) Exec

func (spc *StorageProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageProviderCreate) ExecContext

func (c *StorageProviderCreate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderCreate) ExecX

func (spc *StorageProviderCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderCreate) Mutation

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderCreate) QueryContext

func (c *StorageProviderCreate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderCreate) Save

Save creates the StorageProvider in the database.

func (*StorageProviderCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*StorageProviderCreate) SetBucket

SetBucket sets the "bucket" field.

func (*StorageProviderCreate) SetCdnURL

SetCdnURL sets the "cdn_url" field.

func (*StorageProviderCreate) SetCreatedAt

func (spc *StorageProviderCreate) SetCreatedAt(t time.Time) *StorageProviderCreate

SetCreatedAt sets the "created_at" field.

func (*StorageProviderCreate) SetEndpoint

func (spc *StorageProviderCreate) SetEndpoint(s string) *StorageProviderCreate

SetEndpoint sets the "endpoint" field.

func (*StorageProviderCreate) SetFolder

SetFolder sets the "folder" field.

func (*StorageProviderCreate) SetID

SetID sets the "id" field.

func (*StorageProviderCreate) SetIsDefault

func (spc *StorageProviderCreate) SetIsDefault(b bool) *StorageProviderCreate

SetIsDefault sets the "is_default" field.

func (*StorageProviderCreate) SetName

SetName sets the "name" field.

func (*StorageProviderCreate) SetNillableCdnURL

func (spc *StorageProviderCreate) SetNillableCdnURL(s *string) *StorageProviderCreate

SetNillableCdnURL sets the "cdn_url" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableCreatedAt

func (spc *StorageProviderCreate) SetNillableCreatedAt(t *time.Time) *StorageProviderCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableFolder

func (spc *StorageProviderCreate) SetNillableFolder(s *string) *StorageProviderCreate

SetNillableFolder sets the "folder" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableIsDefault

func (spc *StorageProviderCreate) SetNillableIsDefault(b *bool) *StorageProviderCreate

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableState

func (spc *StorageProviderCreate) SetNillableState(b *bool) *StorageProviderCreate

SetNillableState sets the "state" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableUpdatedAt

func (spc *StorageProviderCreate) SetNillableUpdatedAt(t *time.Time) *StorageProviderCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableUseCdn

func (spc *StorageProviderCreate) SetNillableUseCdn(b *bool) *StorageProviderCreate

SetNillableUseCdn sets the "use_cdn" field if the given value is not nil.

func (*StorageProviderCreate) SetNotNilBucket

func (sp *StorageProviderCreate) SetNotNilBucket(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilCdnURL

func (sp *StorageProviderCreate) SetNotNilCdnURL(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilEndpoint

func (sp *StorageProviderCreate) SetNotNilEndpoint(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilFolder

func (sp *StorageProviderCreate) SetNotNilFolder(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilIsDefault

func (sp *StorageProviderCreate) SetNotNilIsDefault(value *bool) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilName

func (sp *StorageProviderCreate) SetNotNilName(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilRegion

func (sp *StorageProviderCreate) SetNotNilRegion(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilSecretID

func (sp *StorageProviderCreate) SetNotNilSecretID(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilSecretKey

func (sp *StorageProviderCreate) SetNotNilSecretKey(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilState

func (sp *StorageProviderCreate) SetNotNilState(value *bool) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilUpdatedAt

func (sp *StorageProviderCreate) SetNotNilUpdatedAt(value *time.Time) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilUseCdn

func (sp *StorageProviderCreate) SetNotNilUseCdn(value *bool) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetRegion

SetRegion sets the "region" field.

func (*StorageProviderCreate) SetSecretID

func (spc *StorageProviderCreate) SetSecretID(s string) *StorageProviderCreate

SetSecretID sets the "secret_id" field.

func (*StorageProviderCreate) SetSecretKey

func (spc *StorageProviderCreate) SetSecretKey(s string) *StorageProviderCreate

SetSecretKey sets the "secret_key" field.

func (*StorageProviderCreate) SetState

SetState sets the "state" field.

func (*StorageProviderCreate) SetUpdatedAt

func (spc *StorageProviderCreate) SetUpdatedAt(t time.Time) *StorageProviderCreate

SetUpdatedAt sets the "updated_at" field.

func (*StorageProviderCreate) SetUseCdn

SetUseCdn sets the "use_cdn" field.

type StorageProviderCreateBulk

type StorageProviderCreateBulk struct {
	// contains filtered or unexported fields
}

StorageProviderCreateBulk is the builder for creating many StorageProvider entities in bulk.

func (*StorageProviderCreateBulk) Exec

Exec executes the query.

func (*StorageProviderCreateBulk) ExecContext

func (c *StorageProviderCreateBulk) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderCreateBulk) ExecX

func (spcb *StorageProviderCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderCreateBulk) QueryContext

func (c *StorageProviderCreateBulk) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderCreateBulk) Save

Save creates the StorageProvider entities in the database.

func (*StorageProviderCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type StorageProviderDelete

type StorageProviderDelete struct {
	// contains filtered or unexported fields
}

StorageProviderDelete is the builder for deleting a StorageProvider entity.

func (*StorageProviderDelete) Exec

func (spd *StorageProviderDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*StorageProviderDelete) ExecContext

func (c *StorageProviderDelete) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderDelete) ExecX

func (spd *StorageProviderDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderDelete) QueryContext

func (c *StorageProviderDelete) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderDelete) Where

Where appends a list predicates to the StorageProviderDelete builder.

type StorageProviderDeleteOne

type StorageProviderDeleteOne struct {
	// contains filtered or unexported fields
}

StorageProviderDeleteOne is the builder for deleting a single StorageProvider entity.

func (*StorageProviderDeleteOne) Exec

Exec executes the deletion query.

func (*StorageProviderDeleteOne) ExecX

func (spdo *StorageProviderDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderDeleteOne) Where

Where appends a list predicates to the StorageProviderDelete builder.

type StorageProviderEdges

type StorageProviderEdges struct {
	// Cloudfiles holds the value of the cloudfiles edge.
	Cloudfiles []*CloudFile `json:"cloudfiles,omitempty"`
	// contains filtered or unexported fields
}

StorageProviderEdges holds the relations/edges for other nodes in the graph.

func (StorageProviderEdges) CloudfilesOrErr

func (e StorageProviderEdges) CloudfilesOrErr() ([]*CloudFile, error)

CloudfilesOrErr returns the Cloudfiles value or an error if the edge was not loaded in eager-loading.

type StorageProviderGroupBy

type StorageProviderGroupBy struct {
	// contains filtered or unexported fields
}

StorageProviderGroupBy is the group-by builder for StorageProvider entities.

func (*StorageProviderGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*StorageProviderGroupBy) Bool

func (s *StorageProviderGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) BoolX

func (s *StorageProviderGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StorageProviderGroupBy) Bools

func (s *StorageProviderGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) BoolsX

func (s *StorageProviderGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*StorageProviderGroupBy) Float64

func (s *StorageProviderGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) Float64X

func (s *StorageProviderGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StorageProviderGroupBy) Float64s

func (s *StorageProviderGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) Float64sX

func (s *StorageProviderGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StorageProviderGroupBy) Int

func (s *StorageProviderGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) IntX

func (s *StorageProviderGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StorageProviderGroupBy) Ints

func (s *StorageProviderGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) IntsX

func (s *StorageProviderGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*StorageProviderGroupBy) Scan

func (spgb *StorageProviderGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StorageProviderGroupBy) ScanX

func (s *StorageProviderGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StorageProviderGroupBy) String

func (s *StorageProviderGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) StringX

func (s *StorageProviderGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StorageProviderGroupBy) Strings

func (s *StorageProviderGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StorageProviderGroupBy) StringsX

func (s *StorageProviderGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StorageProviderMutation

type StorageProviderMutation struct {
	// contains filtered or unexported fields
}

StorageProviderMutation represents an operation that mutates the StorageProvider nodes in the graph.

func (*StorageProviderMutation) AddCloudfileIDs

func (m *StorageProviderMutation) AddCloudfileIDs(ids ...uuid.UUID)

AddCloudfileIDs adds the "cloudfiles" edge to the CloudFile entity by ids.

func (*StorageProviderMutation) AddField

func (m *StorageProviderMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*StorageProviderMutation) AddedEdges

func (m *StorageProviderMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*StorageProviderMutation) AddedField

func (m *StorageProviderMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*StorageProviderMutation) AddedFields

func (m *StorageProviderMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*StorageProviderMutation) AddedIDs

func (m *StorageProviderMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*StorageProviderMutation) Bucket

func (m *StorageProviderMutation) Bucket() (r string, exists bool)

Bucket returns the value of the "bucket" field in the mutation.

func (*StorageProviderMutation) CdnURL

func (m *StorageProviderMutation) CdnURL() (r string, exists bool)

CdnURL returns the value of the "cdn_url" field in the mutation.

func (*StorageProviderMutation) CdnURLCleared

func (m *StorageProviderMutation) CdnURLCleared() bool

CdnURLCleared returns if the "cdn_url" field was cleared in this mutation.

func (*StorageProviderMutation) ClearCdnURL

func (m *StorageProviderMutation) ClearCdnURL()

ClearCdnURL clears the value of the "cdn_url" field.

func (*StorageProviderMutation) ClearCloudfiles

func (m *StorageProviderMutation) ClearCloudfiles()

ClearCloudfiles clears the "cloudfiles" edge to the CloudFile entity.

func (*StorageProviderMutation) ClearEdge

func (m *StorageProviderMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*StorageProviderMutation) ClearField

func (m *StorageProviderMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*StorageProviderMutation) ClearFolder

func (m *StorageProviderMutation) ClearFolder()

ClearFolder clears the value of the "folder" field.

func (*StorageProviderMutation) ClearState

func (m *StorageProviderMutation) ClearState()

ClearState clears the value of the "state" field.

func (*StorageProviderMutation) ClearedEdges

func (m *StorageProviderMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*StorageProviderMutation) ClearedFields

func (m *StorageProviderMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (StorageProviderMutation) Client

func (m StorageProviderMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*StorageProviderMutation) CloudfilesCleared

func (m *StorageProviderMutation) CloudfilesCleared() bool

CloudfilesCleared reports if the "cloudfiles" edge to the CloudFile entity was cleared.

func (*StorageProviderMutation) CloudfilesIDs

func (m *StorageProviderMutation) CloudfilesIDs() (ids []uuid.UUID)

CloudfilesIDs returns the "cloudfiles" edge IDs in the mutation.

func (*StorageProviderMutation) CreatedAt

func (m *StorageProviderMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*StorageProviderMutation) EdgeCleared

func (m *StorageProviderMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*StorageProviderMutation) Endpoint

func (m *StorageProviderMutation) Endpoint() (r string, exists bool)

Endpoint returns the value of the "endpoint" field in the mutation.

func (*StorageProviderMutation) ExecContext

func (c *StorageProviderMutation) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderMutation) Field

func (m *StorageProviderMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*StorageProviderMutation) FieldCleared

func (m *StorageProviderMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*StorageProviderMutation) Fields

func (m *StorageProviderMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*StorageProviderMutation) Folder

func (m *StorageProviderMutation) Folder() (r string, exists bool)

Folder returns the value of the "folder" field in the mutation.

func (*StorageProviderMutation) FolderCleared

func (m *StorageProviderMutation) FolderCleared() bool

FolderCleared returns if the "folder" field was cleared in this mutation.

func (*StorageProviderMutation) ID

func (m *StorageProviderMutation) ID() (id uint64, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*StorageProviderMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*StorageProviderMutation) IsDefault

func (m *StorageProviderMutation) IsDefault() (r bool, exists bool)

IsDefault returns the value of the "is_default" field in the mutation.

func (*StorageProviderMutation) Name

func (m *StorageProviderMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*StorageProviderMutation) OldBucket

func (m *StorageProviderMutation) OldBucket(ctx context.Context) (v string, err error)

OldBucket returns the old "bucket" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldCdnURL

func (m *StorageProviderMutation) OldCdnURL(ctx context.Context) (v string, err error)

OldCdnURL returns the old "cdn_url" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldCreatedAt

func (m *StorageProviderMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldEndpoint

func (m *StorageProviderMutation) OldEndpoint(ctx context.Context) (v string, err error)

OldEndpoint returns the old "endpoint" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldField

func (m *StorageProviderMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*StorageProviderMutation) OldFolder

func (m *StorageProviderMutation) OldFolder(ctx context.Context) (v string, err error)

OldFolder returns the old "folder" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldIsDefault

func (m *StorageProviderMutation) OldIsDefault(ctx context.Context) (v bool, err error)

OldIsDefault returns the old "is_default" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldName

func (m *StorageProviderMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldRegion

func (m *StorageProviderMutation) OldRegion(ctx context.Context) (v string, err error)

OldRegion returns the old "region" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldSecretID

func (m *StorageProviderMutation) OldSecretID(ctx context.Context) (v string, err error)

OldSecretID returns the old "secret_id" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldSecretKey

func (m *StorageProviderMutation) OldSecretKey(ctx context.Context) (v string, err error)

OldSecretKey returns the old "secret_key" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldState

func (m *StorageProviderMutation) OldState(ctx context.Context) (v bool, err error)

OldState returns the old "state" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldUpdatedAt

func (m *StorageProviderMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) OldUseCdn

func (m *StorageProviderMutation) OldUseCdn(ctx context.Context) (v bool, err error)

OldUseCdn returns the old "use_cdn" field's value of the StorageProvider entity. If the StorageProvider object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*StorageProviderMutation) Op

func (m *StorageProviderMutation) Op() Op

Op returns the operation name.

func (*StorageProviderMutation) QueryContext

func (c *StorageProviderMutation) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderMutation) Region

func (m *StorageProviderMutation) Region() (r string, exists bool)

Region returns the value of the "region" field in the mutation.

func (*StorageProviderMutation) RemoveCloudfileIDs

func (m *StorageProviderMutation) RemoveCloudfileIDs(ids ...uuid.UUID)

RemoveCloudfileIDs removes the "cloudfiles" edge to the CloudFile entity by IDs.

func (*StorageProviderMutation) RemovedCloudfilesIDs

func (m *StorageProviderMutation) RemovedCloudfilesIDs() (ids []uuid.UUID)

RemovedCloudfiles returns the removed IDs of the "cloudfiles" edge to the CloudFile entity.

func (*StorageProviderMutation) RemovedEdges

func (m *StorageProviderMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*StorageProviderMutation) RemovedIDs

func (m *StorageProviderMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*StorageProviderMutation) ResetBucket

func (m *StorageProviderMutation) ResetBucket()

ResetBucket resets all changes to the "bucket" field.

func (*StorageProviderMutation) ResetCdnURL

func (m *StorageProviderMutation) ResetCdnURL()

ResetCdnURL resets all changes to the "cdn_url" field.

func (*StorageProviderMutation) ResetCloudfiles

func (m *StorageProviderMutation) ResetCloudfiles()

ResetCloudfiles resets all changes to the "cloudfiles" edge.

func (*StorageProviderMutation) ResetCreatedAt

func (m *StorageProviderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*StorageProviderMutation) ResetEdge

func (m *StorageProviderMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*StorageProviderMutation) ResetEndpoint

func (m *StorageProviderMutation) ResetEndpoint()

ResetEndpoint resets all changes to the "endpoint" field.

func (*StorageProviderMutation) ResetField

func (m *StorageProviderMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*StorageProviderMutation) ResetFolder

func (m *StorageProviderMutation) ResetFolder()

ResetFolder resets all changes to the "folder" field.

func (*StorageProviderMutation) ResetIsDefault

func (m *StorageProviderMutation) ResetIsDefault()

ResetIsDefault resets all changes to the "is_default" field.

func (*StorageProviderMutation) ResetName

func (m *StorageProviderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*StorageProviderMutation) ResetRegion

func (m *StorageProviderMutation) ResetRegion()

ResetRegion resets all changes to the "region" field.

func (*StorageProviderMutation) ResetSecretID

func (m *StorageProviderMutation) ResetSecretID()

ResetSecretID resets all changes to the "secret_id" field.

func (*StorageProviderMutation) ResetSecretKey

func (m *StorageProviderMutation) ResetSecretKey()

ResetSecretKey resets all changes to the "secret_key" field.

func (*StorageProviderMutation) ResetState

func (m *StorageProviderMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*StorageProviderMutation) ResetUpdatedAt

func (m *StorageProviderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*StorageProviderMutation) ResetUseCdn

func (m *StorageProviderMutation) ResetUseCdn()

ResetUseCdn resets all changes to the "use_cdn" field.

func (*StorageProviderMutation) SecretID

func (m *StorageProviderMutation) SecretID() (r string, exists bool)

SecretID returns the value of the "secret_id" field in the mutation.

func (*StorageProviderMutation) SecretKey

func (m *StorageProviderMutation) SecretKey() (r string, exists bool)

SecretKey returns the value of the "secret_key" field in the mutation.

func (*StorageProviderMutation) SetBucket

func (m *StorageProviderMutation) SetBucket(s string)

SetBucket sets the "bucket" field.

func (*StorageProviderMutation) SetCdnURL

func (m *StorageProviderMutation) SetCdnURL(s string)

SetCdnURL sets the "cdn_url" field.

func (*StorageProviderMutation) SetCreatedAt

func (m *StorageProviderMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*StorageProviderMutation) SetEndpoint

func (m *StorageProviderMutation) SetEndpoint(s string)

SetEndpoint sets the "endpoint" field.

func (*StorageProviderMutation) SetField

func (m *StorageProviderMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*StorageProviderMutation) SetFolder

func (m *StorageProviderMutation) SetFolder(s string)

SetFolder sets the "folder" field.

func (*StorageProviderMutation) SetID

func (m *StorageProviderMutation) SetID(id uint64)

SetID sets the value of the id field. Note that this operation is only accepted on creation of StorageProvider entities.

func (*StorageProviderMutation) SetIsDefault

func (m *StorageProviderMutation) SetIsDefault(b bool)

SetIsDefault sets the "is_default" field.

func (*StorageProviderMutation) SetName

func (m *StorageProviderMutation) SetName(s string)

SetName sets the "name" field.

func (*StorageProviderMutation) SetOp

func (m *StorageProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*StorageProviderMutation) SetRegion

func (m *StorageProviderMutation) SetRegion(s string)

SetRegion sets the "region" field.

func (*StorageProviderMutation) SetSecretID

func (m *StorageProviderMutation) SetSecretID(s string)

SetSecretID sets the "secret_id" field.

func (*StorageProviderMutation) SetSecretKey

func (m *StorageProviderMutation) SetSecretKey(s string)

SetSecretKey sets the "secret_key" field.

func (*StorageProviderMutation) SetState

func (m *StorageProviderMutation) SetState(b bool)

SetState sets the "state" field.

func (*StorageProviderMutation) SetUpdatedAt

func (m *StorageProviderMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*StorageProviderMutation) SetUseCdn

func (m *StorageProviderMutation) SetUseCdn(b bool)

SetUseCdn sets the "use_cdn" field.

func (*StorageProviderMutation) State

func (m *StorageProviderMutation) State() (r bool, exists bool)

State returns the value of the "state" field in the mutation.

func (*StorageProviderMutation) StateCleared

func (m *StorageProviderMutation) StateCleared() bool

StateCleared returns if the "state" field was cleared in this mutation.

func (StorageProviderMutation) Tx

func (m StorageProviderMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*StorageProviderMutation) Type

func (m *StorageProviderMutation) Type() string

Type returns the node type of this mutation (StorageProvider).

func (*StorageProviderMutation) UpdatedAt

func (m *StorageProviderMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*StorageProviderMutation) UseCdn

func (m *StorageProviderMutation) UseCdn() (r bool, exists bool)

UseCdn returns the value of the "use_cdn" field in the mutation.

func (*StorageProviderMutation) Where

Where appends a list predicates to the StorageProviderMutation builder.

func (*StorageProviderMutation) WhereP

func (m *StorageProviderMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the StorageProviderMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type StorageProviderPageList

type StorageProviderPageList struct {
	List        []*StorageProvider `json:"list"`
	PageDetails *PageDetails       `json:"pageDetails"`
}

StorageProviderPageList is StorageProvider PageList result.

type StorageProviderPager

type StorageProviderPager struct {
	Order  storageprovider.OrderOption
	Filter func(*StorageProviderQuery) (*StorageProviderQuery, error)
}

func (*StorageProviderPager) ApplyFilter

type StorageProviderPaginateOption

type StorageProviderPaginateOption func(*StorageProviderPager)

StorageProviderPaginateOption enables pagination customization.

type StorageProviderQuery

type StorageProviderQuery struct {
	// contains filtered or unexported fields
}

StorageProviderQuery is the builder for querying StorageProvider entities.

func (*StorageProviderQuery) Aggregate

Aggregate returns a StorageProviderSelect configured with the given aggregations.

func (*StorageProviderQuery) All

All executes the query and returns a list of StorageProviders.

func (*StorageProviderQuery) AllX

AllX is like All, but panics if an error occurs.

func (*StorageProviderQuery) Clone

Clone returns a duplicate of the StorageProviderQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*StorageProviderQuery) Count

func (spq *StorageProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StorageProviderQuery) CountX

func (spq *StorageProviderQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*StorageProviderQuery) ExecContext

func (c *StorageProviderQuery) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderQuery) Exist

func (spq *StorageProviderQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*StorageProviderQuery) ExistX

func (spq *StorageProviderQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*StorageProviderQuery) First

First returns the first StorageProvider entity from the query. Returns a *NotFoundError when no StorageProvider was found.

func (*StorageProviderQuery) FirstID

func (spq *StorageProviderQuery) FirstID(ctx context.Context) (id uint64, err error)

FirstID returns the first StorageProvider ID from the query. Returns a *NotFoundError when no StorageProvider ID was found.

func (*StorageProviderQuery) FirstIDX

func (spq *StorageProviderQuery) FirstIDX(ctx context.Context) uint64

FirstIDX is like FirstID, but panics if an error occurs.

func (*StorageProviderQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*StorageProviderQuery) GroupBy

func (spq *StorageProviderQuery) GroupBy(field string, fields ...string) *StorageProviderGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
	Count int `json:"count,omitempty"`
}

client.StorageProvider.Query().
	GroupBy(storageprovider.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*StorageProviderQuery) IDs

func (spq *StorageProviderQuery) IDs(ctx context.Context) (ids []uint64, err error)

IDs executes the query and returns a list of StorageProvider IDs.

func (*StorageProviderQuery) IDsX

func (spq *StorageProviderQuery) IDsX(ctx context.Context) []uint64

IDsX is like IDs, but panics if an error occurs.

func (*StorageProviderQuery) Limit

func (spq *StorageProviderQuery) Limit(limit int) *StorageProviderQuery

Limit the number of records to be returned by this query.

func (*StorageProviderQuery) Offset

func (spq *StorageProviderQuery) Offset(offset int) *StorageProviderQuery

Offset to start from.

func (*StorageProviderQuery) Only

Only returns a single StorageProvider entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one StorageProvider entity is found. Returns a *NotFoundError when no StorageProvider entities are found.

func (*StorageProviderQuery) OnlyID

func (spq *StorageProviderQuery) OnlyID(ctx context.Context) (id uint64, err error)

OnlyID is like Only, but returns the only StorageProvider ID in the query. Returns a *NotSingularError when more than one StorageProvider ID is found. Returns a *NotFoundError when no entities are found.

func (*StorageProviderQuery) OnlyIDX

func (spq *StorageProviderQuery) OnlyIDX(ctx context.Context) uint64

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*StorageProviderQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*StorageProviderQuery) Order

Order specifies how the records should be ordered.

func (*StorageProviderQuery) Page

func (*StorageProviderQuery) QueryCloudfiles

func (spq *StorageProviderQuery) QueryCloudfiles() *CloudFileQuery

QueryCloudfiles chains the current query on the "cloudfiles" edge.

func (*StorageProviderQuery) QueryContext

func (c *StorageProviderQuery) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderQuery) Select

func (spq *StorageProviderQuery) Select(fields ...string) *StorageProviderSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	CreatedAt time.Time `json:"created_at,omitempty"`
}

client.StorageProvider.Query().
	Select(storageprovider.FieldCreatedAt).
	Scan(ctx, &v)

func (*StorageProviderQuery) Unique

func (spq *StorageProviderQuery) Unique(unique bool) *StorageProviderQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*StorageProviderQuery) Where

Where adds a new predicate for the StorageProviderQuery builder.

func (*StorageProviderQuery) WithCloudfiles

func (spq *StorageProviderQuery) WithCloudfiles(opts ...func(*CloudFileQuery)) *StorageProviderQuery

WithCloudfiles tells the query-builder to eager-load the nodes that are connected to the "cloudfiles" edge. The optional arguments are used to configure the query builder of the edge.

type StorageProviderSelect

type StorageProviderSelect struct {
	*StorageProviderQuery
	// contains filtered or unexported fields
}

StorageProviderSelect is the builder for selecting fields of StorageProvider entities.

func (*StorageProviderSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*StorageProviderSelect) Bool

func (s *StorageProviderSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) BoolX

func (s *StorageProviderSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*StorageProviderSelect) Bools

func (s *StorageProviderSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) BoolsX

func (s *StorageProviderSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (StorageProviderSelect) ExecContext

func (c StorageProviderSelect) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderSelect) Float64

func (s *StorageProviderSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) Float64X

func (s *StorageProviderSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*StorageProviderSelect) Float64s

func (s *StorageProviderSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) Float64sX

func (s *StorageProviderSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*StorageProviderSelect) Int

func (s *StorageProviderSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) IntX

func (s *StorageProviderSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*StorageProviderSelect) Ints

func (s *StorageProviderSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) IntsX

func (s *StorageProviderSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (StorageProviderSelect) QueryContext

func (c StorageProviderSelect) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderSelect) Scan

func (sps *StorageProviderSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*StorageProviderSelect) ScanX

func (s *StorageProviderSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*StorageProviderSelect) String

func (s *StorageProviderSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) StringX

func (s *StorageProviderSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*StorageProviderSelect) Strings

func (s *StorageProviderSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*StorageProviderSelect) StringsX

func (s *StorageProviderSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type StorageProviderUpdate

type StorageProviderUpdate struct {
	// contains filtered or unexported fields
}

StorageProviderUpdate is the builder for updating StorageProvider entities.

func (*StorageProviderUpdate) AddCloudfileIDs

func (spu *StorageProviderUpdate) AddCloudfileIDs(ids ...uuid.UUID) *StorageProviderUpdate

AddCloudfileIDs adds the "cloudfiles" edge to the CloudFile entity by IDs.

func (*StorageProviderUpdate) AddCloudfiles

func (spu *StorageProviderUpdate) AddCloudfiles(c ...*CloudFile) *StorageProviderUpdate

AddCloudfiles adds the "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderUpdate) ClearCdnURL

func (spu *StorageProviderUpdate) ClearCdnURL() *StorageProviderUpdate

ClearCdnURL clears the value of the "cdn_url" field.

func (*StorageProviderUpdate) ClearCloudfiles

func (spu *StorageProviderUpdate) ClearCloudfiles() *StorageProviderUpdate

ClearCloudfiles clears all "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderUpdate) ClearFolder

func (spu *StorageProviderUpdate) ClearFolder() *StorageProviderUpdate

ClearFolder clears the value of the "folder" field.

func (*StorageProviderUpdate) ClearState

func (spu *StorageProviderUpdate) ClearState() *StorageProviderUpdate

ClearState clears the value of the "state" field.

func (*StorageProviderUpdate) Exec

func (spu *StorageProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageProviderUpdate) ExecContext

func (c *StorageProviderUpdate) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderUpdate) ExecX

func (spu *StorageProviderUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderUpdate) Mutation

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderUpdate) QueryContext

func (c *StorageProviderUpdate) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderUpdate) RemoveCloudfileIDs

func (spu *StorageProviderUpdate) RemoveCloudfileIDs(ids ...uuid.UUID) *StorageProviderUpdate

RemoveCloudfileIDs removes the "cloudfiles" edge to CloudFile entities by IDs.

func (*StorageProviderUpdate) RemoveCloudfiles

func (spu *StorageProviderUpdate) RemoveCloudfiles(c ...*CloudFile) *StorageProviderUpdate

RemoveCloudfiles removes "cloudfiles" edges to CloudFile entities.

func (*StorageProviderUpdate) Save

func (spu *StorageProviderUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*StorageProviderUpdate) SaveX

func (spu *StorageProviderUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*StorageProviderUpdate) SetBucket

SetBucket sets the "bucket" field.

func (*StorageProviderUpdate) SetCdnURL

SetCdnURL sets the "cdn_url" field.

func (*StorageProviderUpdate) SetEndpoint

func (spu *StorageProviderUpdate) SetEndpoint(s string) *StorageProviderUpdate

SetEndpoint sets the "endpoint" field.

func (*StorageProviderUpdate) SetFolder

SetFolder sets the "folder" field.

func (*StorageProviderUpdate) SetIsDefault

func (spu *StorageProviderUpdate) SetIsDefault(b bool) *StorageProviderUpdate

SetIsDefault sets the "is_default" field.

func (*StorageProviderUpdate) SetName

SetName sets the "name" field.

func (*StorageProviderUpdate) SetNillableBucket

func (spu *StorageProviderUpdate) SetNillableBucket(s *string) *StorageProviderUpdate

SetNillableBucket sets the "bucket" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableCdnURL

func (spu *StorageProviderUpdate) SetNillableCdnURL(s *string) *StorageProviderUpdate

SetNillableCdnURL sets the "cdn_url" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableEndpoint

func (spu *StorageProviderUpdate) SetNillableEndpoint(s *string) *StorageProviderUpdate

SetNillableEndpoint sets the "endpoint" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableFolder

func (spu *StorageProviderUpdate) SetNillableFolder(s *string) *StorageProviderUpdate

SetNillableFolder sets the "folder" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableIsDefault

func (spu *StorageProviderUpdate) SetNillableIsDefault(b *bool) *StorageProviderUpdate

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableName

func (spu *StorageProviderUpdate) SetNillableName(s *string) *StorageProviderUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableRegion

func (spu *StorageProviderUpdate) SetNillableRegion(s *string) *StorageProviderUpdate

SetNillableRegion sets the "region" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableSecretID

func (spu *StorageProviderUpdate) SetNillableSecretID(s *string) *StorageProviderUpdate

SetNillableSecretID sets the "secret_id" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableSecretKey

func (spu *StorageProviderUpdate) SetNillableSecretKey(s *string) *StorageProviderUpdate

SetNillableSecretKey sets the "secret_key" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableState

func (spu *StorageProviderUpdate) SetNillableState(b *bool) *StorageProviderUpdate

SetNillableState sets the "state" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableUseCdn

func (spu *StorageProviderUpdate) SetNillableUseCdn(b *bool) *StorageProviderUpdate

SetNillableUseCdn sets the "use_cdn" field if the given value is not nil.

func (*StorageProviderUpdate) SetNotNilBucket

func (sp *StorageProviderUpdate) SetNotNilBucket(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilCdnURL

func (sp *StorageProviderUpdate) SetNotNilCdnURL(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilEndpoint

func (sp *StorageProviderUpdate) SetNotNilEndpoint(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilFolder

func (sp *StorageProviderUpdate) SetNotNilFolder(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilIsDefault

func (sp *StorageProviderUpdate) SetNotNilIsDefault(value *bool) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilName

func (sp *StorageProviderUpdate) SetNotNilName(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilRegion

func (sp *StorageProviderUpdate) SetNotNilRegion(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilSecretID

func (sp *StorageProviderUpdate) SetNotNilSecretID(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilSecretKey

func (sp *StorageProviderUpdate) SetNotNilSecretKey(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilState

func (sp *StorageProviderUpdate) SetNotNilState(value *bool) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilUpdatedAt

func (sp *StorageProviderUpdate) SetNotNilUpdatedAt(value *time.Time) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilUseCdn

func (sp *StorageProviderUpdate) SetNotNilUseCdn(value *bool) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetRegion

SetRegion sets the "region" field.

func (*StorageProviderUpdate) SetSecretID

func (spu *StorageProviderUpdate) SetSecretID(s string) *StorageProviderUpdate

SetSecretID sets the "secret_id" field.

func (*StorageProviderUpdate) SetSecretKey

func (spu *StorageProviderUpdate) SetSecretKey(s string) *StorageProviderUpdate

SetSecretKey sets the "secret_key" field.

func (*StorageProviderUpdate) SetState

SetState sets the "state" field.

func (*StorageProviderUpdate) SetUpdatedAt

func (spu *StorageProviderUpdate) SetUpdatedAt(t time.Time) *StorageProviderUpdate

SetUpdatedAt sets the "updated_at" field.

func (*StorageProviderUpdate) SetUseCdn

SetUseCdn sets the "use_cdn" field.

func (*StorageProviderUpdate) Where

Where appends a list predicates to the StorageProviderUpdate builder.

type StorageProviderUpdateOne

type StorageProviderUpdateOne struct {
	// contains filtered or unexported fields
}

StorageProviderUpdateOne is the builder for updating a single StorageProvider entity.

func (*StorageProviderUpdateOne) AddCloudfileIDs

func (spuo *StorageProviderUpdateOne) AddCloudfileIDs(ids ...uuid.UUID) *StorageProviderUpdateOne

AddCloudfileIDs adds the "cloudfiles" edge to the CloudFile entity by IDs.

func (*StorageProviderUpdateOne) AddCloudfiles

func (spuo *StorageProviderUpdateOne) AddCloudfiles(c ...*CloudFile) *StorageProviderUpdateOne

AddCloudfiles adds the "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderUpdateOne) ClearCdnURL

ClearCdnURL clears the value of the "cdn_url" field.

func (*StorageProviderUpdateOne) ClearCloudfiles

func (spuo *StorageProviderUpdateOne) ClearCloudfiles() *StorageProviderUpdateOne

ClearCloudfiles clears all "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderUpdateOne) ClearFolder

ClearFolder clears the value of the "folder" field.

func (*StorageProviderUpdateOne) ClearState

ClearState clears the value of the "state" field.

func (*StorageProviderUpdateOne) Exec

Exec executes the query on the entity.

func (*StorageProviderUpdateOne) ExecContext

func (c *StorageProviderUpdateOne) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*StorageProviderUpdateOne) ExecX

func (spuo *StorageProviderUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*StorageProviderUpdateOne) Mutation

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderUpdateOne) QueryContext

func (c *StorageProviderUpdateOne) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*StorageProviderUpdateOne) RemoveCloudfileIDs

func (spuo *StorageProviderUpdateOne) RemoveCloudfileIDs(ids ...uuid.UUID) *StorageProviderUpdateOne

RemoveCloudfileIDs removes the "cloudfiles" edge to CloudFile entities by IDs.

func (*StorageProviderUpdateOne) RemoveCloudfiles

func (spuo *StorageProviderUpdateOne) RemoveCloudfiles(c ...*CloudFile) *StorageProviderUpdateOne

RemoveCloudfiles removes "cloudfiles" edges to CloudFile entities.

func (*StorageProviderUpdateOne) Save

Save executes the query and returns the updated StorageProvider entity.

func (*StorageProviderUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*StorageProviderUpdateOne) Select

func (spuo *StorageProviderUpdateOne) Select(field string, fields ...string) *StorageProviderUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*StorageProviderUpdateOne) SetBucket

SetBucket sets the "bucket" field.

func (*StorageProviderUpdateOne) SetCdnURL

SetCdnURL sets the "cdn_url" field.

func (*StorageProviderUpdateOne) SetEndpoint

SetEndpoint sets the "endpoint" field.

func (*StorageProviderUpdateOne) SetFolder

SetFolder sets the "folder" field.

func (*StorageProviderUpdateOne) SetIsDefault

SetIsDefault sets the "is_default" field.

func (*StorageProviderUpdateOne) SetName

SetName sets the "name" field.

func (*StorageProviderUpdateOne) SetNillableBucket

func (spuo *StorageProviderUpdateOne) SetNillableBucket(s *string) *StorageProviderUpdateOne

SetNillableBucket sets the "bucket" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableCdnURL

func (spuo *StorageProviderUpdateOne) SetNillableCdnURL(s *string) *StorageProviderUpdateOne

SetNillableCdnURL sets the "cdn_url" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableEndpoint

func (spuo *StorageProviderUpdateOne) SetNillableEndpoint(s *string) *StorageProviderUpdateOne

SetNillableEndpoint sets the "endpoint" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableFolder

func (spuo *StorageProviderUpdateOne) SetNillableFolder(s *string) *StorageProviderUpdateOne

SetNillableFolder sets the "folder" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableIsDefault

func (spuo *StorageProviderUpdateOne) SetNillableIsDefault(b *bool) *StorageProviderUpdateOne

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableName

func (spuo *StorageProviderUpdateOne) SetNillableName(s *string) *StorageProviderUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableRegion

func (spuo *StorageProviderUpdateOne) SetNillableRegion(s *string) *StorageProviderUpdateOne

SetNillableRegion sets the "region" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableSecretID

func (spuo *StorageProviderUpdateOne) SetNillableSecretID(s *string) *StorageProviderUpdateOne

SetNillableSecretID sets the "secret_id" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableSecretKey

func (spuo *StorageProviderUpdateOne) SetNillableSecretKey(s *string) *StorageProviderUpdateOne

SetNillableSecretKey sets the "secret_key" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableState

func (spuo *StorageProviderUpdateOne) SetNillableState(b *bool) *StorageProviderUpdateOne

SetNillableState sets the "state" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableUseCdn

func (spuo *StorageProviderUpdateOne) SetNillableUseCdn(b *bool) *StorageProviderUpdateOne

SetNillableUseCdn sets the "use_cdn" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNotNilBucket

func (sp *StorageProviderUpdateOne) SetNotNilBucket(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilCdnURL

func (sp *StorageProviderUpdateOne) SetNotNilCdnURL(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilEndpoint

func (sp *StorageProviderUpdateOne) SetNotNilEndpoint(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilFolder

func (sp *StorageProviderUpdateOne) SetNotNilFolder(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilIsDefault

func (sp *StorageProviderUpdateOne) SetNotNilIsDefault(value *bool) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilName

func (sp *StorageProviderUpdateOne) SetNotNilName(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilRegion

func (sp *StorageProviderUpdateOne) SetNotNilRegion(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilSecretID

func (sp *StorageProviderUpdateOne) SetNotNilSecretID(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilSecretKey

func (sp *StorageProviderUpdateOne) SetNotNilSecretKey(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilState

func (sp *StorageProviderUpdateOne) SetNotNilState(value *bool) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilUpdatedAt

func (sp *StorageProviderUpdateOne) SetNotNilUpdatedAt(value *time.Time) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilUseCdn

func (sp *StorageProviderUpdateOne) SetNotNilUseCdn(value *bool) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetRegion

SetRegion sets the "region" field.

func (*StorageProviderUpdateOne) SetSecretID

SetSecretID sets the "secret_id" field.

func (*StorageProviderUpdateOne) SetSecretKey

SetSecretKey sets the "secret_key" field.

func (*StorageProviderUpdateOne) SetState

SetState sets the "state" field.

func (*StorageProviderUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*StorageProviderUpdateOne) SetUseCdn

SetUseCdn sets the "use_cdn" field.

func (*StorageProviderUpdateOne) Where

Where appends a list predicates to the StorageProviderUpdate builder.

type StorageProviders

type StorageProviders []*StorageProvider

StorageProviders is a parsable slice of StorageProvider.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

ent aliases to avoid import conflicts in user's code.

type Traverser

type Traverser = ent.Traverser

ent aliases to avoid import conflicts in user's code.

type Tx

type Tx struct {

	// CloudFile is the client for interacting with the CloudFile builders.
	CloudFile *CloudFileClient
	// CloudFileTag is the client for interacting with the CloudFileTag builders.
	CloudFileTag *CloudFileTagClient
	// File is the client for interacting with the File builders.
	File *FileClient
	// FileTag is the client for interacting with the FileTag builders.
	FileTag *FileTagClient
	// StorageProvider is the client for interacting with the StorageProvider builders.
	StorageProvider *StorageProviderClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) ExecContext

func (c *Tx) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error)

ExecContext allows calling the underlying ExecContext method of the driver if it is supported by it. See, database/sql#DB.ExecContext for more information.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) QueryContext

func (c *Tx) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error)

QueryContext allows calling the underlying QueryContext method of the driver if it is supported by it. See, database/sql#DB.QueryContext for more information.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

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