ent

package
v1.3.12 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 25 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 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 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 added in v1.0.11

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 added in v1.0.11

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 added in v1.1.3

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
}

CloudFile is the model entity for the CloudFile schema.

func (*CloudFile) ExecContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (cf *CloudFile) QueryStorageProviders() *StorageProviderQuery

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

func (*CloudFile) QueryTags added in v1.1.3

func (cf *CloudFile) QueryTags() *CloudFileTagQuery

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

func (*CloudFile) String added in v1.1.3

func (cf *CloudFile) String() string

String implements the fmt.Stringer.

func (*CloudFile) Unwrap added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

CloudFileClient is a client for the CloudFile schema.

func NewCloudFileClient added in v1.1.3

func NewCloudFileClient(c config) *CloudFileClient

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

func (*CloudFileClient) Create added in v1.1.3

func (c *CloudFileClient) Create() *CloudFileCreate

Create returns a builder for creating a CloudFile entity.

func (*CloudFileClient) CreateBulk added in v1.1.3

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

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

func (*CloudFileClient) Delete added in v1.1.3

func (c *CloudFileClient) Delete() *CloudFileDelete

Delete returns a delete builder for CloudFile.

func (*CloudFileClient) DeleteOne added in v1.1.3

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

DeleteOne returns a builder for deleting the given entity.

func (*CloudFileClient) DeleteOneID added in v1.1.3

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

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

func (*CloudFileClient) ExecContext added in v1.1.3

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 added in v1.1.3

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

Get returns a CloudFile entity by its id.

func (*CloudFileClient) GetX added in v1.1.3

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

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

func (*CloudFileClient) Hooks added in v1.1.3

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

Hooks returns the client hooks.

func (*CloudFileClient) Intercept added in v1.1.3

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 added in v1.1.3

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

Interceptors returns the client interceptors.

func (*CloudFileClient) MapCreateBulk added in v1.1.5

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 added in v1.1.3

func (c *CloudFileClient) Query() *CloudFileQuery

Query returns a query builder for CloudFile.

func (*CloudFileClient) QueryContext added in v1.1.3

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 added in v1.1.3

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

QueryStorageProviders queries the storage_providers edge of a CloudFile.

func (*CloudFileClient) QueryTags added in v1.1.3

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

QueryTags queries the tags edge of a CloudFile.

func (*CloudFileClient) Update added in v1.1.3

func (c *CloudFileClient) Update() *CloudFileUpdate

Update returns an update builder for CloudFile.

func (*CloudFileClient) UpdateOne added in v1.1.3

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

UpdateOne returns an update builder for the given entity.

func (*CloudFileClient) UpdateOneID added in v1.1.3

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

UpdateOneID returns an update builder for the given id.

func (*CloudFileClient) Use added in v1.1.3

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 added in v1.1.3

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

CloudFileCreate is the builder for creating a CloudFile entity.

func (*CloudFileCreate) AddTagIDs added in v1.1.3

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

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

func (*CloudFileCreate) AddTags added in v1.1.3

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

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

func (*CloudFileCreate) Exec added in v1.1.3

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

Exec executes the query.

func (*CloudFileCreate) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileCreate) Mutation added in v1.1.3

func (cfc *CloudFileCreate) Mutation() *CloudFileMutation

Mutation returns the CloudFileMutation object of the builder.

func (*CloudFileCreate) QueryContext added in v1.1.3

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 added in v1.1.3

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

Save creates the CloudFile in the database.

func (*CloudFileCreate) SaveX added in v1.1.3

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

SaveX calls Save and panics if Save returns an error.

func (*CloudFileCreate) SetCreatedAt added in v1.1.3

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

SetCreatedAt sets the "created_at" field.

func (*CloudFileCreate) SetFileType added in v1.1.3

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

SetFileType sets the "file_type" field.

func (*CloudFileCreate) SetID added in v1.1.3

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

SetID sets the "id" field.

func (*CloudFileCreate) SetName added in v1.1.3

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

SetName sets the "name" field.

func (*CloudFileCreate) SetNillableCreatedAt added in v1.1.3

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

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

func (*CloudFileCreate) SetNillableID added in v1.1.3

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

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

func (*CloudFileCreate) SetNillableState added in v1.1.3

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

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

func (*CloudFileCreate) SetNillableStorageProvidersID added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileCreate) SetNotNilFileType added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilName added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilSize added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilState added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilURL added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilUpdatedAt added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileCreate) SetNotNilUserID added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileCreate) SetSize added in v1.1.3

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

SetSize sets the "size" field.

func (*CloudFileCreate) SetState added in v1.1.3

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

SetState sets the "state" field.

func (*CloudFileCreate) SetStorageProviders added in v1.1.3

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

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

func (*CloudFileCreate) SetStorageProvidersID added in v1.1.3

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

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

func (*CloudFileCreate) SetURL added in v1.1.3

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

SetURL sets the "url" field.

func (*CloudFileCreate) SetUpdatedAt added in v1.1.3

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

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileCreate) SetUserID added in v1.1.3

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

SetUserID sets the "user_id" field.

type CloudFileCreateBulk added in v1.1.3

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

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

func (*CloudFileCreateBulk) Exec added in v1.1.3

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

Exec executes the query.

func (*CloudFileCreateBulk) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileCreateBulk) QueryContext added in v1.1.3

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 added in v1.1.3

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

Save creates the CloudFile entities in the database.

func (*CloudFileCreateBulk) SaveX added in v1.1.3

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

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

type CloudFileDelete added in v1.1.3

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

CloudFileDelete is the builder for deleting a CloudFile entity.

func (*CloudFileDelete) Exec added in v1.1.3

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

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

func (*CloudFileDelete) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileDelete) QueryContext added in v1.1.3

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 added in v1.1.3

Where appends a list predicates to the CloudFileDelete builder.

type CloudFileDeleteOne added in v1.1.3

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

CloudFileDeleteOne is the builder for deleting a single CloudFile entity.

func (*CloudFileDeleteOne) Exec added in v1.1.3

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

Exec executes the deletion query.

func (*CloudFileDeleteOne) ExecX added in v1.1.3

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

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

func (*CloudFileDeleteOne) Where added in v1.1.3

Where appends a list predicates to the CloudFileDelete builder.

type CloudFileEdges added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

CloudFileGroupBy is the group-by builder for CloudFile entities.

func (*CloudFileGroupBy) Aggregate added in v1.1.3

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

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

func (*CloudFileGroupBy) Bool added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileGroupBy) Bools added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileGroupBy) Float64 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileGroupBy) Float64s added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileGroupBy) Int added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileGroupBy) Ints added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileGroupBy) Scan added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileGroupBy) String added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileGroupBy) Strings added in v1.1.3

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 added in v1.1.3

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

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

type CloudFileMutation added in v1.1.3

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

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

func (*CloudFileMutation) AddField added in v1.1.3

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 added in v1.1.3

func (m *CloudFileMutation) AddFileType(u int8)

AddFileType adds u to the "file_type" field.

func (*CloudFileMutation) AddSize added in v1.1.3

func (m *CloudFileMutation) AddSize(u int64)

AddSize adds u to the "size" field.

func (*CloudFileMutation) AddTagIDs added in v1.1.3

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

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

func (*CloudFileMutation) AddedEdges added in v1.1.3

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

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

func (*CloudFileMutation) AddedField added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileMutation) AddedFileType added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *CloudFileMutation) ClearState()

ClearState clears the value of the "state" field.

func (*CloudFileMutation) ClearStorageProviders added in v1.1.3

func (m *CloudFileMutation) ClearStorageProviders()

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

func (*CloudFileMutation) ClearTags added in v1.1.3

func (m *CloudFileMutation) ClearTags()

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

func (*CloudFileMutation) ClearedEdges added in v1.1.3

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

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

func (*CloudFileMutation) ClearedFields added in v1.1.3

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

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

func (CloudFileMutation) Client added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileMutation) EdgeCleared added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileMutation) ID added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileMutation) OldCreatedAt added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *CloudFileMutation) Op() Op

Op returns the operation name.

func (*CloudFileMutation) QueryContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileMutation) RemovedEdges added in v1.1.3

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

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

func (*CloudFileMutation) RemovedIDs added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileMutation) ResetCreatedAt added in v1.1.3

func (m *CloudFileMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CloudFileMutation) ResetEdge added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *CloudFileMutation) ResetFileType()

ResetFileType resets all changes to the "file_type" field.

func (*CloudFileMutation) ResetName added in v1.1.3

func (m *CloudFileMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CloudFileMutation) ResetSize added in v1.1.3

func (m *CloudFileMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*CloudFileMutation) ResetState added in v1.1.3

func (m *CloudFileMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*CloudFileMutation) ResetStorageProviders added in v1.1.3

func (m *CloudFileMutation) ResetStorageProviders()

ResetStorageProviders resets all changes to the "storage_providers" edge.

func (*CloudFileMutation) ResetTags added in v1.1.3

func (m *CloudFileMutation) ResetTags()

ResetTags resets all changes to the "tags" edge.

func (*CloudFileMutation) ResetURL added in v1.1.3

func (m *CloudFileMutation) ResetURL()

ResetURL resets all changes to the "url" field.

func (*CloudFileMutation) ResetUpdatedAt added in v1.1.3

func (m *CloudFileMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CloudFileMutation) ResetUserID added in v1.1.3

func (m *CloudFileMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*CloudFileMutation) SetCreatedAt added in v1.1.3

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

SetCreatedAt sets the "created_at" field.

func (*CloudFileMutation) SetField added in v1.1.3

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 added in v1.1.3

func (m *CloudFileMutation) SetFileType(u uint8)

SetFileType sets the "file_type" field.

func (*CloudFileMutation) SetID added in v1.1.3

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 added in v1.1.3

func (m *CloudFileMutation) SetName(s string)

SetName sets the "name" field.

func (*CloudFileMutation) SetOp added in v1.1.3

func (m *CloudFileMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CloudFileMutation) SetSize added in v1.1.3

func (m *CloudFileMutation) SetSize(u uint64)

SetSize sets the "size" field.

func (*CloudFileMutation) SetState added in v1.1.3

func (m *CloudFileMutation) SetState(b bool)

SetState sets the "state" field.

func (*CloudFileMutation) SetStorageProvidersID added in v1.1.3

func (m *CloudFileMutation) SetStorageProvidersID(id uint64)

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

func (*CloudFileMutation) SetURL added in v1.1.3

func (m *CloudFileMutation) SetURL(s string)

SetURL sets the "url" field.

func (*CloudFileMutation) SetUpdatedAt added in v1.1.3

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

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileMutation) SetUserID added in v1.1.3

func (m *CloudFileMutation) SetUserID(s string)

SetUserID sets the "user_id" field.

func (*CloudFileMutation) Size added in v1.1.3

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

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

func (*CloudFileMutation) State added in v1.1.3

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

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

func (*CloudFileMutation) StateCleared added in v1.1.3

func (m *CloudFileMutation) StateCleared() bool

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

func (*CloudFileMutation) StorageProvidersCleared added in v1.1.3

func (m *CloudFileMutation) StorageProvidersCleared() bool

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

func (*CloudFileMutation) StorageProvidersID added in v1.1.3

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

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

func (*CloudFileMutation) StorageProvidersIDs added in v1.1.3

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 added in v1.1.3

func (m *CloudFileMutation) TagsCleared() bool

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

func (*CloudFileMutation) TagsIDs added in v1.1.3

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

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

func (CloudFileMutation) Tx added in v1.1.3

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 added in v1.1.3

func (m *CloudFileMutation) Type() string

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

func (*CloudFileMutation) URL added in v1.1.3

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

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

func (*CloudFileMutation) UpdatedAt added in v1.1.3

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

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

func (*CloudFileMutation) UserID added in v1.1.3

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

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

func (*CloudFileMutation) Where added in v1.1.3

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

Where appends a list predicates to the CloudFileMutation builder.

func (*CloudFileMutation) WhereP added in v1.1.3

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 added in v1.1.3

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

CloudFilePageList is CloudFile PageList result.

type CloudFilePager added in v1.1.3

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

func (*CloudFilePager) ApplyFilter added in v1.1.3

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

type CloudFilePaginateOption added in v1.1.3

type CloudFilePaginateOption func(*CloudFilePager)

CloudFilePaginateOption enables pagination customization.

type CloudFileQuery added in v1.1.3

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

CloudFileQuery is the builder for querying CloudFile entities.

func (*CloudFileQuery) Aggregate added in v1.1.3

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

Aggregate returns a CloudFileSelect configured with the given aggregations.

func (*CloudFileQuery) All added in v1.1.3

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

All executes the query and returns a list of CloudFiles.

func (*CloudFileQuery) AllX added in v1.1.3

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

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

func (*CloudFileQuery) Clone added in v1.1.3

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 added in v1.1.3

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

Count returns the count of the given query.

func (*CloudFileQuery) CountX added in v1.1.3

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

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

func (*CloudFileQuery) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileQuery) ExistX added in v1.1.3

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

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

func (*CloudFileQuery) First added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileQuery) FirstX added in v1.1.3

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

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

func (*CloudFileQuery) GroupBy added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileQuery) Limit added in v1.1.3

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

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

func (*CloudFileQuery) Offset added in v1.1.3

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

Offset to start from.

func (*CloudFileQuery) Only added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileQuery) OnlyX added in v1.1.3

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

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

func (*CloudFileQuery) Order added in v1.1.3

Order specifies how the records should be ordered.

func (*CloudFileQuery) Page added in v1.1.3

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

func (*CloudFileQuery) QueryContext added in v1.1.3

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 added in v1.1.3

func (cfq *CloudFileQuery) QueryStorageProviders() *StorageProviderQuery

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

func (*CloudFileQuery) QueryTags added in v1.1.3

func (cfq *CloudFileQuery) QueryTags() *CloudFileTagQuery

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

func (*CloudFileQuery) Select added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

Where adds a new predicate for the CloudFileQuery builder.

func (*CloudFileQuery) WithStorageProviders added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

CloudFileSelect is the builder for selecting fields of CloudFile entities.

func (*CloudFileSelect) Aggregate added in v1.1.3

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

Aggregate adds the given aggregation functions to the selector query.

func (*CloudFileSelect) Bool added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileSelect) Bools added in v1.1.3

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 added in v1.1.3

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

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

func (CloudFileSelect) ExecContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileSelect) Float64s added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileSelect) Int added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileSelect) Ints added in v1.1.3

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 added in v1.1.3

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

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

func (CloudFileSelect) QueryContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileSelect) String added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileSelect) Strings added in v1.1.3

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 added in v1.1.3

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

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

type CloudFileTag added in v1.1.3

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
}

CloudFileTag is the model entity for the CloudFileTag schema.

func (*CloudFileTag) ExecContext added in v1.1.3

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 added in v1.1.3

func (cft *CloudFileTag) QueryCloudFiles() *CloudFileQuery

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

func (*CloudFileTag) QueryContext added in v1.1.3

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 added in v1.1.3

func (cft *CloudFileTag) String() string

String implements the fmt.Stringer.

func (*CloudFileTag) Unwrap added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

CloudFileTagClient is a client for the CloudFileTag schema.

func NewCloudFileTagClient added in v1.1.3

func NewCloudFileTagClient(c config) *CloudFileTagClient

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

func (*CloudFileTagClient) Create added in v1.1.3

Create returns a builder for creating a CloudFileTag entity.

func (*CloudFileTagClient) CreateBulk added in v1.1.3

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

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

func (*CloudFileTagClient) Delete added in v1.1.3

Delete returns a delete builder for CloudFileTag.

func (*CloudFileTagClient) DeleteOne added in v1.1.3

DeleteOne returns a builder for deleting the given entity.

func (*CloudFileTagClient) DeleteOneID added in v1.1.3

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

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

func (*CloudFileTagClient) ExecContext added in v1.1.3

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 added in v1.1.3

Get returns a CloudFileTag entity by its id.

func (*CloudFileTagClient) GetX added in v1.1.3

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

func (*CloudFileTagClient) Hooks added in v1.1.3

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

Hooks returns the client hooks.

func (*CloudFileTagClient) Intercept added in v1.1.3

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 added in v1.1.3

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

Interceptors returns the client interceptors.

func (*CloudFileTagClient) MapCreateBulk added in v1.1.5

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 added in v1.1.3

Query returns a query builder for CloudFileTag.

func (*CloudFileTagClient) QueryCloudFiles added in v1.1.3

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

QueryCloudFiles queries the cloud_files edge of a CloudFileTag.

func (*CloudFileTagClient) QueryContext added in v1.1.3

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 added in v1.1.3

Update returns an update builder for CloudFileTag.

func (*CloudFileTagClient) UpdateOne added in v1.1.3

UpdateOne returns an update builder for the given entity.

func (*CloudFileTagClient) UpdateOneID added in v1.1.3

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

UpdateOneID returns an update builder for the given id.

func (*CloudFileTagClient) Use added in v1.1.3

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 added in v1.1.3

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

CloudFileTagCreate is the builder for creating a CloudFileTag entity.

func (*CloudFileTagCreate) AddCloudFileIDs added in v1.1.3

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

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

func (*CloudFileTagCreate) AddCloudFiles added in v1.1.3

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

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

func (*CloudFileTagCreate) Exec added in v1.1.3

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

Exec executes the query.

func (*CloudFileTagCreate) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagCreate) Mutation added in v1.1.3

func (cftc *CloudFileTagCreate) Mutation() *CloudFileTagMutation

Mutation returns the CloudFileTagMutation object of the builder.

func (*CloudFileTagCreate) QueryContext added in v1.1.3

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 added in v1.1.3

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

Save creates the CloudFileTag in the database.

func (*CloudFileTagCreate) SaveX added in v1.1.3

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

SaveX calls Save and panics if Save returns an error.

func (*CloudFileTagCreate) SetCreatedAt added in v1.1.3

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

SetCreatedAt sets the "created_at" field.

func (*CloudFileTagCreate) SetID added in v1.1.3

SetID sets the "id" field.

func (*CloudFileTagCreate) SetName added in v1.1.3

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

SetName sets the "name" field.

func (*CloudFileTagCreate) SetNillableCreatedAt added in v1.1.3

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

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

func (*CloudFileTagCreate) SetNillableRemark added in v1.1.3

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

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

func (*CloudFileTagCreate) SetNillableStatus added in v1.1.3

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

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

func (*CloudFileTagCreate) SetNillableUpdatedAt added in v1.1.3

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

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

func (*CloudFileTagCreate) SetNotNilName added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagCreate) SetNotNilRemark added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagCreate) SetNotNilStatus added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagCreate) SetNotNilUpdatedAt added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagCreate) SetRemark added in v1.1.3

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

SetRemark sets the "remark" field.

func (*CloudFileTagCreate) SetStatus added in v1.1.3

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

SetStatus sets the "status" field.

func (*CloudFileTagCreate) SetUpdatedAt added in v1.1.3

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

SetUpdatedAt sets the "updated_at" field.

type CloudFileTagCreateBulk added in v1.1.3

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

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

func (*CloudFileTagCreateBulk) Exec added in v1.1.3

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

Exec executes the query.

func (*CloudFileTagCreateBulk) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagCreateBulk) QueryContext added in v1.1.3

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 added in v1.1.3

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

Save creates the CloudFileTag entities in the database.

func (*CloudFileTagCreateBulk) SaveX added in v1.1.3

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

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

type CloudFileTagDelete added in v1.1.3

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

CloudFileTagDelete is the builder for deleting a CloudFileTag entity.

func (*CloudFileTagDelete) Exec added in v1.1.3

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

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

func (*CloudFileTagDelete) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagDelete) QueryContext added in v1.1.3

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 added in v1.1.3

Where appends a list predicates to the CloudFileTagDelete builder.

type CloudFileTagDeleteOne added in v1.1.3

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

CloudFileTagDeleteOne is the builder for deleting a single CloudFileTag entity.

func (*CloudFileTagDeleteOne) Exec added in v1.1.3

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

Exec executes the deletion query.

func (*CloudFileTagDeleteOne) ExecX added in v1.1.3

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

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

func (*CloudFileTagDeleteOne) Where added in v1.1.3

Where appends a list predicates to the CloudFileTagDelete builder.

type CloudFileTagEdges added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

CloudFileTagGroupBy is the group-by builder for CloudFileTag entities.

func (*CloudFileTagGroupBy) Aggregate added in v1.1.3

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

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

func (*CloudFileTagGroupBy) Bool added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagGroupBy) Bools added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagGroupBy) Float64 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagGroupBy) Float64s added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagGroupBy) Int added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagGroupBy) Ints added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagGroupBy) Scan added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagGroupBy) String added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagGroupBy) Strings added in v1.1.3

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 added in v1.1.3

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

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

type CloudFileTagMutation added in v1.1.3

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

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

func (*CloudFileTagMutation) AddCloudFileIDs added in v1.1.3

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

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

func (*CloudFileTagMutation) AddField added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*CloudFileTagMutation) AddedEdges added in v1.1.3

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

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

func (*CloudFileTagMutation) AddedField added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagMutation) AddedIDs added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) ClearCloudFiles()

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

func (*CloudFileTagMutation) ClearEdge added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*CloudFileTagMutation) ClearStatus added in v1.1.3

func (m *CloudFileTagMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*CloudFileTagMutation) ClearedEdges added in v1.1.3

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

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

func (*CloudFileTagMutation) ClearedFields added in v1.1.3

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

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

func (CloudFileTagMutation) Client added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) CloudFilesCleared() bool

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

func (*CloudFileTagMutation) CloudFilesIDs added in v1.1.3

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

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

func (*CloudFileTagMutation) CreatedAt added in v1.1.3

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

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

func (*CloudFileTagMutation) EdgeCleared added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagMutation) OldCreatedAt added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) Op() Op

Op returns the operation name.

func (*CloudFileTagMutation) QueryContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagMutation) RemarkCleared added in v1.1.3

func (m *CloudFileTagMutation) RemarkCleared() bool

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

func (*CloudFileTagMutation) RemoveCloudFileIDs added in v1.1.3

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

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

func (*CloudFileTagMutation) RemovedCloudFilesIDs added in v1.1.3

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

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

func (*CloudFileTagMutation) RemovedEdges added in v1.1.3

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

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

func (*CloudFileTagMutation) RemovedIDs added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) ResetCloudFiles()

ResetCloudFiles resets all changes to the "cloud_files" edge.

func (*CloudFileTagMutation) ResetCreatedAt added in v1.1.3

func (m *CloudFileTagMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*CloudFileTagMutation) ResetEdge added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*CloudFileTagMutation) ResetRemark added in v1.1.3

func (m *CloudFileTagMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*CloudFileTagMutation) ResetStatus added in v1.1.3

func (m *CloudFileTagMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*CloudFileTagMutation) ResetUpdatedAt added in v1.1.3

func (m *CloudFileTagMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*CloudFileTagMutation) SetCreatedAt added in v1.1.3

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

SetCreatedAt sets the "created_at" field.

func (*CloudFileTagMutation) SetField added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) SetName(s string)

SetName sets the "name" field.

func (*CloudFileTagMutation) SetOp added in v1.1.3

func (m *CloudFileTagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*CloudFileTagMutation) SetRemark added in v1.1.3

func (m *CloudFileTagMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*CloudFileTagMutation) SetStatus added in v1.1.3

func (m *CloudFileTagMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*CloudFileTagMutation) SetUpdatedAt added in v1.1.3

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

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileTagMutation) Status added in v1.1.3

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

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

func (*CloudFileTagMutation) StatusCleared added in v1.1.3

func (m *CloudFileTagMutation) StatusCleared() bool

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

func (CloudFileTagMutation) Tx added in v1.1.3

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 added in v1.1.3

func (m *CloudFileTagMutation) Type() string

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

func (*CloudFileTagMutation) UpdatedAt added in v1.1.3

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

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

func (*CloudFileTagMutation) Where added in v1.1.3

Where appends a list predicates to the CloudFileTagMutation builder.

func (*CloudFileTagMutation) WhereP added in v1.1.3

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 added in v1.1.3

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

CloudFileTagPageList is CloudFileTag PageList result.

type CloudFileTagPager added in v1.1.3

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

func (*CloudFileTagPager) ApplyFilter added in v1.1.3

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

type CloudFileTagPaginateOption added in v1.1.3

type CloudFileTagPaginateOption func(*CloudFileTagPager)

CloudFileTagPaginateOption enables pagination customization.

type CloudFileTagQuery added in v1.1.3

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

CloudFileTagQuery is the builder for querying CloudFileTag entities.

func (*CloudFileTagQuery) Aggregate added in v1.1.3

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

Aggregate returns a CloudFileTagSelect configured with the given aggregations.

func (*CloudFileTagQuery) All added in v1.1.3

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

All executes the query and returns a list of CloudFileTags.

func (*CloudFileTagQuery) AllX added in v1.1.3

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

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

func (*CloudFileTagQuery) Clone added in v1.1.3

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 added in v1.1.3

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

Count returns the count of the given query.

func (*CloudFileTagQuery) CountX added in v1.1.3

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

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

func (*CloudFileTagQuery) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagQuery) ExistX added in v1.1.3

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

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

func (*CloudFileTagQuery) First added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagQuery) FirstX added in v1.1.3

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

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

func (*CloudFileTagQuery) GroupBy added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagQuery) Limit added in v1.1.3

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

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

func (*CloudFileTagQuery) Offset added in v1.1.3

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

Offset to start from.

func (*CloudFileTagQuery) Only added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagQuery) OnlyX added in v1.1.3

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

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

func (*CloudFileTagQuery) Order added in v1.1.3

Order specifies how the records should be ordered.

func (*CloudFileTagQuery) Page added in v1.1.3

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

func (*CloudFileTagQuery) QueryCloudFiles added in v1.1.3

func (cftq *CloudFileTagQuery) QueryCloudFiles() *CloudFileQuery

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

func (*CloudFileTagQuery) QueryContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

Where adds a new predicate for the CloudFileTagQuery builder.

func (*CloudFileTagQuery) WithCloudFiles added in v1.1.3

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 added in v1.1.3

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

CloudFileTagSelect is the builder for selecting fields of CloudFileTag entities.

func (*CloudFileTagSelect) Aggregate added in v1.1.3

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

Aggregate adds the given aggregation functions to the selector query.

func (*CloudFileTagSelect) Bool added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagSelect) Bools added in v1.1.3

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 added in v1.1.3

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

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

func (CloudFileTagSelect) ExecContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagSelect) Float64s added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagSelect) Int added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagSelect) Ints added in v1.1.3

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 added in v1.1.3

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

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

func (CloudFileTagSelect) QueryContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagSelect) String added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagSelect) Strings added in v1.1.3

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 added in v1.1.3

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

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

type CloudFileTagUpdate added in v1.1.3

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

CloudFileTagUpdate is the builder for updating CloudFileTag entities.

func (*CloudFileTagUpdate) AddCloudFileIDs added in v1.1.3

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

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

func (*CloudFileTagUpdate) AddCloudFiles added in v1.1.3

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

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

func (*CloudFileTagUpdate) AddStatus added in v1.1.3

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

AddStatus adds u to the "status" field.

func (*CloudFileTagUpdate) ClearCloudFiles added in v1.1.3

func (cftu *CloudFileTagUpdate) ClearCloudFiles() *CloudFileTagUpdate

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

func (*CloudFileTagUpdate) ClearRemark added in v1.1.3

func (cftu *CloudFileTagUpdate) ClearRemark() *CloudFileTagUpdate

ClearRemark clears the value of the "remark" field.

func (*CloudFileTagUpdate) ClearStatus added in v1.1.3

func (cftu *CloudFileTagUpdate) ClearStatus() *CloudFileTagUpdate

ClearStatus clears the value of the "status" field.

func (*CloudFileTagUpdate) Exec added in v1.1.3

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

Exec executes the query.

func (*CloudFileTagUpdate) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagUpdate) Mutation added in v1.1.3

func (cftu *CloudFileTagUpdate) Mutation() *CloudFileTagMutation

Mutation returns the CloudFileTagMutation object of the builder.

func (*CloudFileTagUpdate) QueryContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagUpdate) RemoveCloudFiles added in v1.1.3

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

RemoveCloudFiles removes "cloud_files" edges to CloudFile entities.

func (*CloudFileTagUpdate) Save added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagUpdate) SetName added in v1.1.3

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

SetName sets the "name" field.

func (*CloudFileTagUpdate) SetNillableName added in v1.2.3

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

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

func (*CloudFileTagUpdate) SetNillableRemark added in v1.1.3

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

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

func (*CloudFileTagUpdate) SetNillableStatus added in v1.1.3

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

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

func (*CloudFileTagUpdate) SetNotNilName added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagUpdate) SetNotNilRemark added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagUpdate) SetNotNilStatus added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagUpdate) SetNotNilUpdatedAt added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagUpdate) SetRemark added in v1.1.3

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

SetRemark sets the "remark" field.

func (*CloudFileTagUpdate) SetStatus added in v1.1.3

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

SetStatus sets the "status" field.

func (*CloudFileTagUpdate) SetUpdatedAt added in v1.1.3

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

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileTagUpdate) Where added in v1.1.3

Where appends a list predicates to the CloudFileTagUpdate builder.

type CloudFileTagUpdateOne added in v1.1.3

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

CloudFileTagUpdateOne is the builder for updating a single CloudFileTag entity.

func (*CloudFileTagUpdateOne) AddCloudFileIDs added in v1.1.3

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

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

func (*CloudFileTagUpdateOne) AddCloudFiles added in v1.1.3

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

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

func (*CloudFileTagUpdateOne) AddStatus added in v1.1.3

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

AddStatus adds u to the "status" field.

func (*CloudFileTagUpdateOne) ClearCloudFiles added in v1.1.3

func (cftuo *CloudFileTagUpdateOne) ClearCloudFiles() *CloudFileTagUpdateOne

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

func (*CloudFileTagUpdateOne) ClearRemark added in v1.1.3

func (cftuo *CloudFileTagUpdateOne) ClearRemark() *CloudFileTagUpdateOne

ClearRemark clears the value of the "remark" field.

func (*CloudFileTagUpdateOne) ClearStatus added in v1.1.3

func (cftuo *CloudFileTagUpdateOne) ClearStatus() *CloudFileTagUpdateOne

ClearStatus clears the value of the "status" field.

func (*CloudFileTagUpdateOne) Exec added in v1.1.3

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

Exec executes the query on the entity.

func (*CloudFileTagUpdateOne) ExecContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagUpdateOne) Mutation added in v1.1.3

func (cftuo *CloudFileTagUpdateOne) Mutation() *CloudFileTagMutation

Mutation returns the CloudFileTagMutation object of the builder.

func (*CloudFileTagUpdateOne) QueryContext added in v1.1.3

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 added in v1.1.3

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

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

func (*CloudFileTagUpdateOne) RemoveCloudFiles added in v1.1.3

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

RemoveCloudFiles removes "cloud_files" edges to CloudFile entities.

func (*CloudFileTagUpdateOne) Save added in v1.1.3

Save executes the query and returns the updated CloudFileTag entity.

func (*CloudFileTagUpdateOne) SaveX added in v1.1.3

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

func (*CloudFileTagUpdateOne) Select added in v1.1.3

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 added in v1.1.3

SetName sets the "name" field.

func (*CloudFileTagUpdateOne) SetNillableName added in v1.2.3

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

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

func (*CloudFileTagUpdateOne) SetNillableRemark added in v1.1.3

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

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

func (*CloudFileTagUpdateOne) SetNillableStatus added in v1.1.3

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

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

func (*CloudFileTagUpdateOne) SetNotNilName added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagUpdateOne) SetNotNilRemark added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagUpdateOne) SetNotNilStatus added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagUpdateOne) SetNotNilUpdatedAt added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileTagUpdateOne) SetRemark added in v1.1.3

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

SetRemark sets the "remark" field.

func (*CloudFileTagUpdateOne) SetStatus added in v1.1.3

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

SetStatus sets the "status" field.

func (*CloudFileTagUpdateOne) SetUpdatedAt added in v1.1.3

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

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileTagUpdateOne) Where added in v1.1.3

Where appends a list predicates to the CloudFileTagUpdate builder.

type CloudFileTags added in v1.1.3

type CloudFileTags []*CloudFileTag

CloudFileTags is a parsable slice of CloudFileTag.

type CloudFileUpdate added in v1.1.3

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

CloudFileUpdate is the builder for updating CloudFile entities.

func (*CloudFileUpdate) AddFileType added in v1.1.3

func (cfu *CloudFileUpdate) AddFileType(u int8) *CloudFileUpdate

AddFileType adds u to the "file_type" field.

func (*CloudFileUpdate) AddSize added in v1.1.3

func (cfu *CloudFileUpdate) AddSize(u int64) *CloudFileUpdate

AddSize adds u to the "size" field.

func (*CloudFileUpdate) AddTagIDs added in v1.1.3

func (cfu *CloudFileUpdate) AddTagIDs(ids ...uint64) *CloudFileUpdate

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

func (*CloudFileUpdate) AddTags added in v1.1.3

func (cfu *CloudFileUpdate) AddTags(c ...*CloudFileTag) *CloudFileUpdate

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

func (*CloudFileUpdate) ClearState added in v1.1.3

func (cfu *CloudFileUpdate) ClearState() *CloudFileUpdate

ClearState clears the value of the "state" field.

func (*CloudFileUpdate) ClearStorageProviders added in v1.1.3

func (cfu *CloudFileUpdate) ClearStorageProviders() *CloudFileUpdate

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

func (*CloudFileUpdate) ClearTags added in v1.1.3

func (cfu *CloudFileUpdate) ClearTags() *CloudFileUpdate

ClearTags clears all "tags" edges to the CloudFileTag entity.

func (*CloudFileUpdate) Exec added in v1.1.3

func (cfu *CloudFileUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*CloudFileUpdate) ExecContext added in v1.1.3

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 added in v1.1.3

func (cfu *CloudFileUpdate) ExecX(ctx context.Context)

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

func (*CloudFileUpdate) Mutation added in v1.1.3

func (cfu *CloudFileUpdate) Mutation() *CloudFileMutation

Mutation returns the CloudFileMutation object of the builder.

func (*CloudFileUpdate) QueryContext added in v1.1.3

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 added in v1.1.3

func (cfu *CloudFileUpdate) RemoveTagIDs(ids ...uint64) *CloudFileUpdate

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

func (*CloudFileUpdate) RemoveTags added in v1.1.3

func (cfu *CloudFileUpdate) RemoveTags(c ...*CloudFileTag) *CloudFileUpdate

RemoveTags removes "tags" edges to CloudFileTag entities.

func (*CloudFileUpdate) Save added in v1.1.3

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 added in v1.1.3

func (cfu *CloudFileUpdate) SaveX(ctx context.Context) int

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

func (*CloudFileUpdate) SetFileType added in v1.1.3

func (cfu *CloudFileUpdate) SetFileType(u uint8) *CloudFileUpdate

SetFileType sets the "file_type" field.

func (*CloudFileUpdate) SetName added in v1.1.3

func (cfu *CloudFileUpdate) SetName(s string) *CloudFileUpdate

SetName sets the "name" field.

func (*CloudFileUpdate) SetNillableFileType added in v1.2.3

func (cfu *CloudFileUpdate) SetNillableFileType(u *uint8) *CloudFileUpdate

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*CloudFileUpdate) SetNillableName added in v1.2.3

func (cfu *CloudFileUpdate) SetNillableName(s *string) *CloudFileUpdate

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

func (*CloudFileUpdate) SetNillableSize added in v1.2.3

func (cfu *CloudFileUpdate) SetNillableSize(u *uint64) *CloudFileUpdate

SetNillableSize sets the "size" field if the given value is not nil.

func (*CloudFileUpdate) SetNillableState added in v1.1.3

func (cfu *CloudFileUpdate) SetNillableState(b *bool) *CloudFileUpdate

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

func (*CloudFileUpdate) SetNillableStorageProvidersID added in v1.1.3

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 added in v1.2.3

func (cfu *CloudFileUpdate) SetNillableURL(s *string) *CloudFileUpdate

SetNillableURL sets the "url" field if the given value is not nil.

func (*CloudFileUpdate) SetNillableUserID added in v1.2.3

func (cfu *CloudFileUpdate) SetNillableUserID(s *string) *CloudFileUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CloudFileUpdate) SetNotNilFileType added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilName added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilSize added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilState added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilURL added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilUpdatedAt added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetNotNilUserID added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdate) SetSize added in v1.1.3

func (cfu *CloudFileUpdate) SetSize(u uint64) *CloudFileUpdate

SetSize sets the "size" field.

func (*CloudFileUpdate) SetState added in v1.1.3

func (cfu *CloudFileUpdate) SetState(b bool) *CloudFileUpdate

SetState sets the "state" field.

func (*CloudFileUpdate) SetStorageProviders added in v1.1.3

func (cfu *CloudFileUpdate) SetStorageProviders(s *StorageProvider) *CloudFileUpdate

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

func (*CloudFileUpdate) SetStorageProvidersID added in v1.1.3

func (cfu *CloudFileUpdate) SetStorageProvidersID(id uint64) *CloudFileUpdate

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

func (*CloudFileUpdate) SetURL added in v1.1.3

func (cfu *CloudFileUpdate) SetURL(s string) *CloudFileUpdate

SetURL sets the "url" field.

func (*CloudFileUpdate) SetUpdatedAt added in v1.1.3

func (cfu *CloudFileUpdate) SetUpdatedAt(t time.Time) *CloudFileUpdate

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileUpdate) SetUserID added in v1.1.3

func (cfu *CloudFileUpdate) SetUserID(s string) *CloudFileUpdate

SetUserID sets the "user_id" field.

func (*CloudFileUpdate) Where added in v1.1.3

Where appends a list predicates to the CloudFileUpdate builder.

type CloudFileUpdateOne added in v1.1.3

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

CloudFileUpdateOne is the builder for updating a single CloudFile entity.

func (*CloudFileUpdateOne) AddFileType added in v1.1.3

func (cfuo *CloudFileUpdateOne) AddFileType(u int8) *CloudFileUpdateOne

AddFileType adds u to the "file_type" field.

func (*CloudFileUpdateOne) AddSize added in v1.1.3

func (cfuo *CloudFileUpdateOne) AddSize(u int64) *CloudFileUpdateOne

AddSize adds u to the "size" field.

func (*CloudFileUpdateOne) AddTagIDs added in v1.1.3

func (cfuo *CloudFileUpdateOne) AddTagIDs(ids ...uint64) *CloudFileUpdateOne

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

func (*CloudFileUpdateOne) AddTags added in v1.1.3

func (cfuo *CloudFileUpdateOne) AddTags(c ...*CloudFileTag) *CloudFileUpdateOne

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

func (*CloudFileUpdateOne) ClearState added in v1.1.3

func (cfuo *CloudFileUpdateOne) ClearState() *CloudFileUpdateOne

ClearState clears the value of the "state" field.

func (*CloudFileUpdateOne) ClearStorageProviders added in v1.1.3

func (cfuo *CloudFileUpdateOne) ClearStorageProviders() *CloudFileUpdateOne

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

func (*CloudFileUpdateOne) ClearTags added in v1.1.3

func (cfuo *CloudFileUpdateOne) ClearTags() *CloudFileUpdateOne

ClearTags clears all "tags" edges to the CloudFileTag entity.

func (*CloudFileUpdateOne) Exec added in v1.1.3

func (cfuo *CloudFileUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*CloudFileUpdateOne) ExecContext added in v1.1.3

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 added in v1.1.3

func (cfuo *CloudFileUpdateOne) ExecX(ctx context.Context)

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

func (*CloudFileUpdateOne) Mutation added in v1.1.3

func (cfuo *CloudFileUpdateOne) Mutation() *CloudFileMutation

Mutation returns the CloudFileMutation object of the builder.

func (*CloudFileUpdateOne) QueryContext added in v1.1.3

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 added in v1.1.3

func (cfuo *CloudFileUpdateOne) RemoveTagIDs(ids ...uint64) *CloudFileUpdateOne

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

func (*CloudFileUpdateOne) RemoveTags added in v1.1.3

func (cfuo *CloudFileUpdateOne) RemoveTags(c ...*CloudFileTag) *CloudFileUpdateOne

RemoveTags removes "tags" edges to CloudFileTag entities.

func (*CloudFileUpdateOne) Save added in v1.1.3

func (cfuo *CloudFileUpdateOne) Save(ctx context.Context) (*CloudFile, error)

Save executes the query and returns the updated CloudFile entity.

func (*CloudFileUpdateOne) SaveX added in v1.1.3

func (cfuo *CloudFileUpdateOne) SaveX(ctx context.Context) *CloudFile

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

func (*CloudFileUpdateOne) Select added in v1.1.3

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 added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetFileType(u uint8) *CloudFileUpdateOne

SetFileType sets the "file_type" field.

func (*CloudFileUpdateOne) SetName added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetName(s string) *CloudFileUpdateOne

SetName sets the "name" field.

func (*CloudFileUpdateOne) SetNillableFileType added in v1.2.3

func (cfuo *CloudFileUpdateOne) SetNillableFileType(u *uint8) *CloudFileUpdateOne

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableName added in v1.2.3

func (cfuo *CloudFileUpdateOne) SetNillableName(s *string) *CloudFileUpdateOne

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

func (*CloudFileUpdateOne) SetNillableSize added in v1.2.3

func (cfuo *CloudFileUpdateOne) SetNillableSize(u *uint64) *CloudFileUpdateOne

SetNillableSize sets the "size" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableState added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetNillableState(b *bool) *CloudFileUpdateOne

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

func (*CloudFileUpdateOne) SetNillableStorageProvidersID added in v1.1.3

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 added in v1.2.3

func (cfuo *CloudFileUpdateOne) SetNillableURL(s *string) *CloudFileUpdateOne

SetNillableURL sets the "url" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNillableUserID added in v1.2.3

func (cfuo *CloudFileUpdateOne) SetNillableUserID(s *string) *CloudFileUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*CloudFileUpdateOne) SetNotNilFileType added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilName added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilSize added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilState added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilURL added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilUpdatedAt added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetNotNilUserID added in v1.1.3

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

set field if value's pointer is not nil.

func (*CloudFileUpdateOne) SetSize added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetSize(u uint64) *CloudFileUpdateOne

SetSize sets the "size" field.

func (*CloudFileUpdateOne) SetState added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetState(b bool) *CloudFileUpdateOne

SetState sets the "state" field.

func (*CloudFileUpdateOne) SetStorageProviders added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetStorageProviders(s *StorageProvider) *CloudFileUpdateOne

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

func (*CloudFileUpdateOne) SetStorageProvidersID added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetStorageProvidersID(id uint64) *CloudFileUpdateOne

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

func (*CloudFileUpdateOne) SetURL added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetURL(s string) *CloudFileUpdateOne

SetURL sets the "url" field.

func (*CloudFileUpdateOne) SetUpdatedAt added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetUpdatedAt(t time.Time) *CloudFileUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*CloudFileUpdateOne) SetUserID added in v1.1.3

func (cfuo *CloudFileUpdateOne) SetUserID(s string) *CloudFileUpdateOne

SetUserID sets the "user_id" field.

func (*CloudFileUpdateOne) Where added in v1.1.3

Where appends a list predicates to the CloudFileUpdate builder.

type CloudFiles added in v1.1.3

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 is the model entity for the File schema.

func (*File) ExecContext added in v1.0.11

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 added in v1.0.11

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 added in v1.0.12

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 added in v1.0.11

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 added in v1.1.5

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 added in v1.0.11

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 added in v1.0.12

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 added in v1.0.12

func (fc *FileCreate) AddTagIDs(ids ...uint64) *FileCreate

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

func (*FileCreate) AddTags added in v1.0.12

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.0.10

func (f *FileCreate) SetNotNilFileType(value *uint8) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilMd5 added in v1.0.10

func (f *FileCreate) SetNotNilMd5(value *string) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilName added in v1.0.10

func (f *FileCreate) SetNotNilName(value *string) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilPath added in v1.0.10

func (f *FileCreate) SetNotNilPath(value *string) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilSize added in v1.0.10

func (f *FileCreate) SetNotNilSize(value *uint64) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilStatus added in v1.0.10

func (f *FileCreate) SetNotNilStatus(value *uint8) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilUpdatedAt added in v1.0.10

func (f *FileCreate) SetNotNilUpdatedAt(value *time.Time) *FileCreate

set field if value's pointer is not nil.

func (*FileCreate) SetNotNilUserID added in v1.1.3

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 added in v1.1.3

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.0.12

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 added in v1.0.12

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 added in v1.0.12

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 added in v1.0.12

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 added in v1.0.11

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 added in v1.1.3

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 added in v1.0.11

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 added in v1.0.12

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 added in v1.0.12

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 added in v1.0.12

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.0.12

func (m *FileMutation) TagsCleared() bool

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

func (*FileMutation) TagsIDs added in v1.0.12

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 added in v1.1.3

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.0.12

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 added in v1.0.12

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.1.3

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
}

FileTag is the model entity for the FileTag schema.

func (*FileTag) ExecContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (ft *FileTag) QueryFiles() *FileQuery

QueryFiles queries the "files" edge of the FileTag entity.

func (*FileTag) String added in v1.1.3

func (ft *FileTag) String() string

String implements the fmt.Stringer.

func (*FileTag) Unwrap added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

FileTagClient is a client for the FileTag schema.

func NewFileTagClient added in v1.1.3

func NewFileTagClient(c config) *FileTagClient

NewFileTagClient returns a client for the FileTag from the given config.

func (*FileTagClient) Create added in v1.1.3

func (c *FileTagClient) Create() *FileTagCreate

Create returns a builder for creating a FileTag entity.

func (*FileTagClient) CreateBulk added in v1.1.3

func (c *FileTagClient) CreateBulk(builders ...*FileTagCreate) *FileTagCreateBulk

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

func (*FileTagClient) Delete added in v1.1.3

func (c *FileTagClient) Delete() *FileTagDelete

Delete returns a delete builder for FileTag.

func (*FileTagClient) DeleteOne added in v1.1.3

func (c *FileTagClient) DeleteOne(ft *FileTag) *FileTagDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*FileTagClient) DeleteOneID added in v1.1.3

func (c *FileTagClient) DeleteOneID(id uint64) *FileTagDeleteOne

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

func (*FileTagClient) ExecContext added in v1.1.3

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 added in v1.1.3

func (c *FileTagClient) Get(ctx context.Context, id uint64) (*FileTag, error)

Get returns a FileTag entity by its id.

func (*FileTagClient) GetX added in v1.1.3

func (c *FileTagClient) GetX(ctx context.Context, id uint64) *FileTag

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

func (*FileTagClient) Hooks added in v1.1.3

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

Hooks returns the client hooks.

func (*FileTagClient) Intercept added in v1.1.3

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 added in v1.1.3

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

Interceptors returns the client interceptors.

func (*FileTagClient) MapCreateBulk added in v1.1.5

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 added in v1.1.3

func (c *FileTagClient) Query() *FileTagQuery

Query returns a query builder for FileTag.

func (*FileTagClient) QueryContext added in v1.1.3

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 added in v1.1.3

func (c *FileTagClient) QueryFiles(ft *FileTag) *FileQuery

QueryFiles queries the files edge of a FileTag.

func (*FileTagClient) Update added in v1.1.3

func (c *FileTagClient) Update() *FileTagUpdate

Update returns an update builder for FileTag.

func (*FileTagClient) UpdateOne added in v1.1.3

func (c *FileTagClient) UpdateOne(ft *FileTag) *FileTagUpdateOne

UpdateOne returns an update builder for the given entity.

func (*FileTagClient) UpdateOneID added in v1.1.3

func (c *FileTagClient) UpdateOneID(id uint64) *FileTagUpdateOne

UpdateOneID returns an update builder for the given id.

func (*FileTagClient) Use added in v1.1.3

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 added in v1.1.3

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

FileTagCreate is the builder for creating a FileTag entity.

func (*FileTagCreate) AddFileIDs added in v1.1.3

func (ftc *FileTagCreate) AddFileIDs(ids ...uuid.UUID) *FileTagCreate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*FileTagCreate) AddFiles added in v1.1.3

func (ftc *FileTagCreate) AddFiles(f ...*File) *FileTagCreate

AddFiles adds the "files" edges to the File entity.

func (*FileTagCreate) Exec added in v1.1.3

func (ftc *FileTagCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileTagCreate) ExecContext added in v1.1.3

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 added in v1.1.3

func (ftc *FileTagCreate) ExecX(ctx context.Context)

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

func (*FileTagCreate) Mutation added in v1.1.3

func (ftc *FileTagCreate) Mutation() *FileTagMutation

Mutation returns the FileTagMutation object of the builder.

func (*FileTagCreate) QueryContext added in v1.1.3

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 added in v1.1.3

func (ftc *FileTagCreate) Save(ctx context.Context) (*FileTag, error)

Save creates the FileTag in the database.

func (*FileTagCreate) SaveX added in v1.1.3

func (ftc *FileTagCreate) SaveX(ctx context.Context) *FileTag

SaveX calls Save and panics if Save returns an error.

func (*FileTagCreate) SetCreatedAt added in v1.1.3

func (ftc *FileTagCreate) SetCreatedAt(t time.Time) *FileTagCreate

SetCreatedAt sets the "created_at" field.

func (*FileTagCreate) SetID added in v1.1.3

func (ftc *FileTagCreate) SetID(u uint64) *FileTagCreate

SetID sets the "id" field.

func (*FileTagCreate) SetName added in v1.1.3

func (ftc *FileTagCreate) SetName(s string) *FileTagCreate

SetName sets the "name" field.

func (*FileTagCreate) SetNillableCreatedAt added in v1.1.3

func (ftc *FileTagCreate) SetNillableCreatedAt(t *time.Time) *FileTagCreate

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

func (*FileTagCreate) SetNillableRemark added in v1.1.3

func (ftc *FileTagCreate) SetNillableRemark(s *string) *FileTagCreate

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

func (*FileTagCreate) SetNillableStatus added in v1.1.3

func (ftc *FileTagCreate) SetNillableStatus(u *uint8) *FileTagCreate

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

func (*FileTagCreate) SetNillableUpdatedAt added in v1.1.3

func (ftc *FileTagCreate) SetNillableUpdatedAt(t *time.Time) *FileTagCreate

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

func (*FileTagCreate) SetNotNilName added in v1.1.3

func (ft *FileTagCreate) SetNotNilName(value *string) *FileTagCreate

set field if value's pointer is not nil.

func (*FileTagCreate) SetNotNilRemark added in v1.1.3

func (ft *FileTagCreate) SetNotNilRemark(value *string) *FileTagCreate

set field if value's pointer is not nil.

func (*FileTagCreate) SetNotNilStatus added in v1.1.3

func (ft *FileTagCreate) SetNotNilStatus(value *uint8) *FileTagCreate

set field if value's pointer is not nil.

func (*FileTagCreate) SetNotNilUpdatedAt added in v1.1.3

func (ft *FileTagCreate) SetNotNilUpdatedAt(value *time.Time) *FileTagCreate

set field if value's pointer is not nil.

func (*FileTagCreate) SetRemark added in v1.1.3

func (ftc *FileTagCreate) SetRemark(s string) *FileTagCreate

SetRemark sets the "remark" field.

func (*FileTagCreate) SetStatus added in v1.1.3

func (ftc *FileTagCreate) SetStatus(u uint8) *FileTagCreate

SetStatus sets the "status" field.

func (*FileTagCreate) SetUpdatedAt added in v1.1.3

func (ftc *FileTagCreate) SetUpdatedAt(t time.Time) *FileTagCreate

SetUpdatedAt sets the "updated_at" field.

type FileTagCreateBulk added in v1.1.3

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

FileTagCreateBulk is the builder for creating many FileTag entities in bulk.

func (*FileTagCreateBulk) Exec added in v1.1.3

func (ftcb *FileTagCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*FileTagCreateBulk) ExecContext added in v1.1.3

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 added in v1.1.3

func (ftcb *FileTagCreateBulk) ExecX(ctx context.Context)

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

func (*FileTagCreateBulk) QueryContext added in v1.1.3

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 added in v1.1.3

func (ftcb *FileTagCreateBulk) Save(ctx context.Context) ([]*FileTag, error)

Save creates the FileTag entities in the database.

func (*FileTagCreateBulk) SaveX added in v1.1.3

func (ftcb *FileTagCreateBulk) SaveX(ctx context.Context) []*FileTag

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

type FileTagDelete added in v1.1.3

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

FileTagDelete is the builder for deleting a FileTag entity.

func (*FileTagDelete) Exec added in v1.1.3

func (ftd *FileTagDelete) Exec(ctx context.Context) (int, error)

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

func (*FileTagDelete) ExecContext added in v1.1.3

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 added in v1.1.3

func (ftd *FileTagDelete) ExecX(ctx context.Context) int

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

func (*FileTagDelete) QueryContext added in v1.1.3

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 added in v1.1.3

func (ftd *FileTagDelete) Where(ps ...predicate.FileTag) *FileTagDelete

Where appends a list predicates to the FileTagDelete builder.

type FileTagDeleteOne added in v1.1.3

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

FileTagDeleteOne is the builder for deleting a single FileTag entity.

func (*FileTagDeleteOne) Exec added in v1.1.3

func (ftdo *FileTagDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*FileTagDeleteOne) ExecX added in v1.1.3

func (ftdo *FileTagDeleteOne) ExecX(ctx context.Context)

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

func (*FileTagDeleteOne) Where added in v1.1.3

func (ftdo *FileTagDeleteOne) Where(ps ...predicate.FileTag) *FileTagDeleteOne

Where appends a list predicates to the FileTagDelete builder.

type FileTagEdges added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

FileTagGroupBy is the group-by builder for FileTag entities.

func (*FileTagGroupBy) Aggregate added in v1.1.3

func (ftgb *FileTagGroupBy) Aggregate(fns ...AggregateFunc) *FileTagGroupBy

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

func (*FileTagGroupBy) Bool added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagGroupBy) Bools added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagGroupBy) Float64 added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagGroupBy) Float64s added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagGroupBy) Int added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagGroupBy) Ints added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagGroupBy) Scan added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagGroupBy) String added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagGroupBy) Strings added in v1.1.3

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 added in v1.1.3

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

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

type FileTagMutation added in v1.1.3

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

FileTagMutation represents an operation that mutates the FileTag nodes in the graph.

func (*FileTagMutation) AddField added in v1.1.3

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 added in v1.1.3

func (m *FileTagMutation) AddFileIDs(ids ...uuid.UUID)

AddFileIDs adds the "files" edge to the File entity by ids.

func (*FileTagMutation) AddStatus added in v1.1.3

func (m *FileTagMutation) AddStatus(u int8)

AddStatus adds u to the "status" field.

func (*FileTagMutation) AddedEdges added in v1.1.3

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

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

func (*FileTagMutation) AddedField added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagMutation) AddedIDs added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *FileTagMutation) ClearFiles()

ClearFiles clears the "files" edge to the File entity.

func (*FileTagMutation) ClearRemark added in v1.1.3

func (m *FileTagMutation) ClearRemark()

ClearRemark clears the value of the "remark" field.

func (*FileTagMutation) ClearStatus added in v1.1.3

func (m *FileTagMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*FileTagMutation) ClearedEdges added in v1.1.3

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

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

func (*FileTagMutation) ClearedFields added in v1.1.3

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

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

func (FileTagMutation) Client added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagMutation) EdgeCleared added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *FileTagMutation) FilesCleared() bool

FilesCleared reports if the "files" edge to the File entity was cleared.

func (*FileTagMutation) FilesIDs added in v1.1.3

func (m *FileTagMutation) FilesIDs() (ids []uuid.UUID)

FilesIDs returns the "files" edge IDs in the mutation.

func (*FileTagMutation) ID added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagMutation) OldCreatedAt added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *FileTagMutation) Op() Op

Op returns the operation name.

func (*FileTagMutation) QueryContext added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagMutation) RemarkCleared added in v1.1.3

func (m *FileTagMutation) RemarkCleared() bool

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

func (*FileTagMutation) RemoveFileIDs added in v1.1.3

func (m *FileTagMutation) RemoveFileIDs(ids ...uuid.UUID)

RemoveFileIDs removes the "files" edge to the File entity by IDs.

func (*FileTagMutation) RemovedEdges added in v1.1.3

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

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

func (*FileTagMutation) RemovedFilesIDs added in v1.1.3

func (m *FileTagMutation) RemovedFilesIDs() (ids []uuid.UUID)

RemovedFiles returns the removed IDs of the "files" edge to the File entity.

func (*FileTagMutation) RemovedIDs added in v1.1.3

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 added in v1.1.3

func (m *FileTagMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*FileTagMutation) ResetEdge added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *FileTagMutation) ResetFiles()

ResetFiles resets all changes to the "files" edge.

func (*FileTagMutation) ResetName added in v1.1.3

func (m *FileTagMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*FileTagMutation) ResetRemark added in v1.1.3

func (m *FileTagMutation) ResetRemark()

ResetRemark resets all changes to the "remark" field.

func (*FileTagMutation) ResetStatus added in v1.1.3

func (m *FileTagMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*FileTagMutation) ResetUpdatedAt added in v1.1.3

func (m *FileTagMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*FileTagMutation) SetCreatedAt added in v1.1.3

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

SetCreatedAt sets the "created_at" field.

func (*FileTagMutation) SetField added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *FileTagMutation) SetName(s string)

SetName sets the "name" field.

func (*FileTagMutation) SetOp added in v1.1.3

func (m *FileTagMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*FileTagMutation) SetRemark added in v1.1.3

func (m *FileTagMutation) SetRemark(s string)

SetRemark sets the "remark" field.

func (*FileTagMutation) SetStatus added in v1.1.3

func (m *FileTagMutation) SetStatus(u uint8)

SetStatus sets the "status" field.

func (*FileTagMutation) SetUpdatedAt added in v1.1.3

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

SetUpdatedAt sets the "updated_at" field.

func (*FileTagMutation) Status added in v1.1.3

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

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

func (*FileTagMutation) StatusCleared added in v1.1.3

func (m *FileTagMutation) StatusCleared() bool

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

func (FileTagMutation) Tx added in v1.1.3

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 added in v1.1.3

func (m *FileTagMutation) Type() string

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

func (*FileTagMutation) UpdatedAt added in v1.1.3

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

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

func (*FileTagMutation) Where added in v1.1.3

func (m *FileTagMutation) Where(ps ...predicate.FileTag)

Where appends a list predicates to the FileTagMutation builder.

func (*FileTagMutation) WhereP added in v1.1.3

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 added in v1.1.3

type FileTagPageList struct {
	List        []*FileTag   `json:"list"`
	PageDetails *PageDetails `json:"pageDetails"`
}

FileTagPageList is FileTag PageList result.

type FileTagPager added in v1.1.3

type FileTagPager struct {
	Order  filetag.OrderOption
	Filter func(*FileTagQuery) (*FileTagQuery, error)
}

func (*FileTagPager) ApplyFilter added in v1.1.3

func (p *FileTagPager) ApplyFilter(query *FileTagQuery) (*FileTagQuery, error)

type FileTagPaginateOption added in v1.1.3

type FileTagPaginateOption func(*FileTagPager)

FileTagPaginateOption enables pagination customization.

type FileTagQuery added in v1.1.3

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

FileTagQuery is the builder for querying FileTag entities.

func (*FileTagQuery) Aggregate added in v1.1.3

func (ftq *FileTagQuery) Aggregate(fns ...AggregateFunc) *FileTagSelect

Aggregate returns a FileTagSelect configured with the given aggregations.

func (*FileTagQuery) All added in v1.1.3

func (ftq *FileTagQuery) All(ctx context.Context) ([]*FileTag, error)

All executes the query and returns a list of FileTags.

func (*FileTagQuery) AllX added in v1.1.3

func (ftq *FileTagQuery) AllX(ctx context.Context) []*FileTag

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

func (*FileTagQuery) Clone added in v1.1.3

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 added in v1.1.3

func (ftq *FileTagQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*FileTagQuery) CountX added in v1.1.3

func (ftq *FileTagQuery) CountX(ctx context.Context) int

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

func (*FileTagQuery) ExecContext added in v1.1.3

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 added in v1.1.3

func (ftq *FileTagQuery) Exist(ctx context.Context) (bool, error)

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

func (*FileTagQuery) ExistX added in v1.1.3

func (ftq *FileTagQuery) ExistX(ctx context.Context) bool

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

func (*FileTagQuery) First added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (ftq *FileTagQuery) FirstIDX(ctx context.Context) uint64

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

func (*FileTagQuery) FirstX added in v1.1.3

func (ftq *FileTagQuery) FirstX(ctx context.Context) *FileTag

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

func (*FileTagQuery) GroupBy added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (ftq *FileTagQuery) IDsX(ctx context.Context) []uint64

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

func (*FileTagQuery) Limit added in v1.1.3

func (ftq *FileTagQuery) Limit(limit int) *FileTagQuery

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

func (*FileTagQuery) Offset added in v1.1.3

func (ftq *FileTagQuery) Offset(offset int) *FileTagQuery

Offset to start from.

func (*FileTagQuery) Only added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (ftq *FileTagQuery) OnlyIDX(ctx context.Context) uint64

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

func (*FileTagQuery) OnlyX added in v1.1.3

func (ftq *FileTagQuery) OnlyX(ctx context.Context) *FileTag

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

func (*FileTagQuery) Order added in v1.1.3

func (ftq *FileTagQuery) Order(o ...filetag.OrderOption) *FileTagQuery

Order specifies how the records should be ordered.

func (*FileTagQuery) Page added in v1.1.3

func (ft *FileTagQuery) Page(
	ctx context.Context, pageNum uint64, pageSize uint64, opts ...FileTagPaginateOption,
) (*FileTagPageList, error)

func (*FileTagQuery) QueryContext added in v1.1.3

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 added in v1.1.3

func (ftq *FileTagQuery) QueryFiles() *FileQuery

QueryFiles chains the current query on the "files" edge.

func (*FileTagQuery) Select added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (ftq *FileTagQuery) Where(ps ...predicate.FileTag) *FileTagQuery

Where adds a new predicate for the FileTagQuery builder.

func (*FileTagQuery) WithFiles added in v1.1.3

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 added in v1.1.3

type FileTagSelect struct {
	*FileTagQuery
	// contains filtered or unexported fields
}

FileTagSelect is the builder for selecting fields of FileTag entities.

func (*FileTagSelect) Aggregate added in v1.1.3

func (fts *FileTagSelect) Aggregate(fns ...AggregateFunc) *FileTagSelect

Aggregate adds the given aggregation functions to the selector query.

func (*FileTagSelect) Bool added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagSelect) Bools added in v1.1.3

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 added in v1.1.3

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

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

func (FileTagSelect) ExecContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagSelect) Float64s added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagSelect) Int added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagSelect) Ints added in v1.1.3

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 added in v1.1.3

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

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

func (FileTagSelect) QueryContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagSelect) String added in v1.1.3

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 added in v1.1.3

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

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

func (*FileTagSelect) Strings added in v1.1.3

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 added in v1.1.3

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

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

type FileTagUpdate added in v1.1.3

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

FileTagUpdate is the builder for updating FileTag entities.

func (*FileTagUpdate) AddFileIDs added in v1.1.3

func (ftu *FileTagUpdate) AddFileIDs(ids ...uuid.UUID) *FileTagUpdate

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*FileTagUpdate) AddFiles added in v1.1.3

func (ftu *FileTagUpdate) AddFiles(f ...*File) *FileTagUpdate

AddFiles adds the "files" edges to the File entity.

func (*FileTagUpdate) AddStatus added in v1.1.3

func (ftu *FileTagUpdate) AddStatus(u int8) *FileTagUpdate

AddStatus adds u to the "status" field.

func (*FileTagUpdate) ClearFiles added in v1.1.3

func (ftu *FileTagUpdate) ClearFiles() *FileTagUpdate

ClearFiles clears all "files" edges to the File entity.

func (*FileTagUpdate) ClearRemark added in v1.1.3

func (ftu *FileTagUpdate) ClearRemark() *FileTagUpdate

ClearRemark clears the value of the "remark" field.

func (*FileTagUpdate) ClearStatus added in v1.1.3

func (ftu *FileTagUpdate) ClearStatus() *FileTagUpdate

ClearStatus clears the value of the "status" field.

func (*FileTagUpdate) Exec added in v1.1.3

func (ftu *FileTagUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*FileTagUpdate) ExecContext added in v1.1.3

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 added in v1.1.3

func (ftu *FileTagUpdate) ExecX(ctx context.Context)

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

func (*FileTagUpdate) Mutation added in v1.1.3

func (ftu *FileTagUpdate) Mutation() *FileTagMutation

Mutation returns the FileTagMutation object of the builder.

func (*FileTagUpdate) QueryContext added in v1.1.3

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 added in v1.1.3

func (ftu *FileTagUpdate) RemoveFileIDs(ids ...uuid.UUID) *FileTagUpdate

RemoveFileIDs removes the "files" edge to File entities by IDs.

func (*FileTagUpdate) RemoveFiles added in v1.1.3

func (ftu *FileTagUpdate) RemoveFiles(f ...*File) *FileTagUpdate

RemoveFiles removes "files" edges to File entities.

func (*FileTagUpdate) Save added in v1.1.3

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 added in v1.1.3

func (ftu *FileTagUpdate) SaveX(ctx context.Context) int

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

func (*FileTagUpdate) SetName added in v1.1.3

func (ftu *FileTagUpdate) SetName(s string) *FileTagUpdate

SetName sets the "name" field.

func (*FileTagUpdate) SetNillableName added in v1.2.3

func (ftu *FileTagUpdate) SetNillableName(s *string) *FileTagUpdate

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

func (*FileTagUpdate) SetNillableRemark added in v1.1.3

func (ftu *FileTagUpdate) SetNillableRemark(s *string) *FileTagUpdate

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

func (*FileTagUpdate) SetNillableStatus added in v1.1.3

func (ftu *FileTagUpdate) SetNillableStatus(u *uint8) *FileTagUpdate

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

func (*FileTagUpdate) SetNotNilName added in v1.1.3

func (ft *FileTagUpdate) SetNotNilName(value *string) *FileTagUpdate

set field if value's pointer is not nil.

func (*FileTagUpdate) SetNotNilRemark added in v1.1.3

func (ft *FileTagUpdate) SetNotNilRemark(value *string) *FileTagUpdate

set field if value's pointer is not nil.

func (*FileTagUpdate) SetNotNilStatus added in v1.1.3

func (ft *FileTagUpdate) SetNotNilStatus(value *uint8) *FileTagUpdate

set field if value's pointer is not nil.

func (*FileTagUpdate) SetNotNilUpdatedAt added in v1.1.3

func (ft *FileTagUpdate) SetNotNilUpdatedAt(value *time.Time) *FileTagUpdate

set field if value's pointer is not nil.

func (*FileTagUpdate) SetRemark added in v1.1.3

func (ftu *FileTagUpdate) SetRemark(s string) *FileTagUpdate

SetRemark sets the "remark" field.

func (*FileTagUpdate) SetStatus added in v1.1.3

func (ftu *FileTagUpdate) SetStatus(u uint8) *FileTagUpdate

SetStatus sets the "status" field.

func (*FileTagUpdate) SetUpdatedAt added in v1.1.3

func (ftu *FileTagUpdate) SetUpdatedAt(t time.Time) *FileTagUpdate

SetUpdatedAt sets the "updated_at" field.

func (*FileTagUpdate) Where added in v1.1.3

func (ftu *FileTagUpdate) Where(ps ...predicate.FileTag) *FileTagUpdate

Where appends a list predicates to the FileTagUpdate builder.

type FileTagUpdateOne added in v1.1.3

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

FileTagUpdateOne is the builder for updating a single FileTag entity.

func (*FileTagUpdateOne) AddFileIDs added in v1.1.3

func (ftuo *FileTagUpdateOne) AddFileIDs(ids ...uuid.UUID) *FileTagUpdateOne

AddFileIDs adds the "files" edge to the File entity by IDs.

func (*FileTagUpdateOne) AddFiles added in v1.1.3

func (ftuo *FileTagUpdateOne) AddFiles(f ...*File) *FileTagUpdateOne

AddFiles adds the "files" edges to the File entity.

func (*FileTagUpdateOne) AddStatus added in v1.1.3

func (ftuo *FileTagUpdateOne) AddStatus(u int8) *FileTagUpdateOne

AddStatus adds u to the "status" field.

func (*FileTagUpdateOne) ClearFiles added in v1.1.3

func (ftuo *FileTagUpdateOne) ClearFiles() *FileTagUpdateOne

ClearFiles clears all "files" edges to the File entity.

func (*FileTagUpdateOne) ClearRemark added in v1.1.3

func (ftuo *FileTagUpdateOne) ClearRemark() *FileTagUpdateOne

ClearRemark clears the value of the "remark" field.

func (*FileTagUpdateOne) ClearStatus added in v1.1.3

func (ftuo *FileTagUpdateOne) ClearStatus() *FileTagUpdateOne

ClearStatus clears the value of the "status" field.

func (*FileTagUpdateOne) Exec added in v1.1.3

func (ftuo *FileTagUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*FileTagUpdateOne) ExecContext added in v1.1.3

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 added in v1.1.3

func (ftuo *FileTagUpdateOne) ExecX(ctx context.Context)

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

func (*FileTagUpdateOne) Mutation added in v1.1.3

func (ftuo *FileTagUpdateOne) Mutation() *FileTagMutation

Mutation returns the FileTagMutation object of the builder.

func (*FileTagUpdateOne) QueryContext added in v1.1.3

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 added in v1.1.3

func (ftuo *FileTagUpdateOne) RemoveFileIDs(ids ...uuid.UUID) *FileTagUpdateOne

RemoveFileIDs removes the "files" edge to File entities by IDs.

func (*FileTagUpdateOne) RemoveFiles added in v1.1.3

func (ftuo *FileTagUpdateOne) RemoveFiles(f ...*File) *FileTagUpdateOne

RemoveFiles removes "files" edges to File entities.

func (*FileTagUpdateOne) Save added in v1.1.3

func (ftuo *FileTagUpdateOne) Save(ctx context.Context) (*FileTag, error)

Save executes the query and returns the updated FileTag entity.

func (*FileTagUpdateOne) SaveX added in v1.1.3

func (ftuo *FileTagUpdateOne) SaveX(ctx context.Context) *FileTag

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

func (*FileTagUpdateOne) Select added in v1.1.3

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 added in v1.1.3

func (ftuo *FileTagUpdateOne) SetName(s string) *FileTagUpdateOne

SetName sets the "name" field.

func (*FileTagUpdateOne) SetNillableName added in v1.2.3

func (ftuo *FileTagUpdateOne) SetNillableName(s *string) *FileTagUpdateOne

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

func (*FileTagUpdateOne) SetNillableRemark added in v1.1.3

func (ftuo *FileTagUpdateOne) SetNillableRemark(s *string) *FileTagUpdateOne

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

func (*FileTagUpdateOne) SetNillableStatus added in v1.1.3

func (ftuo *FileTagUpdateOne) SetNillableStatus(u *uint8) *FileTagUpdateOne

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

func (*FileTagUpdateOne) SetNotNilName added in v1.1.3

func (ft *FileTagUpdateOne) SetNotNilName(value *string) *FileTagUpdateOne

set field if value's pointer is not nil.

func (*FileTagUpdateOne) SetNotNilRemark added in v1.1.3

func (ft *FileTagUpdateOne) SetNotNilRemark(value *string) *FileTagUpdateOne

set field if value's pointer is not nil.

func (*FileTagUpdateOne) SetNotNilStatus added in v1.1.3

func (ft *FileTagUpdateOne) SetNotNilStatus(value *uint8) *FileTagUpdateOne

set field if value's pointer is not nil.

func (*FileTagUpdateOne) SetNotNilUpdatedAt added in v1.1.3

func (ft *FileTagUpdateOne) SetNotNilUpdatedAt(value *time.Time) *FileTagUpdateOne

set field if value's pointer is not nil.

func (*FileTagUpdateOne) SetRemark added in v1.1.3

func (ftuo *FileTagUpdateOne) SetRemark(s string) *FileTagUpdateOne

SetRemark sets the "remark" field.

func (*FileTagUpdateOne) SetStatus added in v1.1.3

func (ftuo *FileTagUpdateOne) SetStatus(u uint8) *FileTagUpdateOne

SetStatus sets the "status" field.

func (*FileTagUpdateOne) SetUpdatedAt added in v1.1.3

func (ftuo *FileTagUpdateOne) SetUpdatedAt(t time.Time) *FileTagUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*FileTagUpdateOne) Where added in v1.1.3

func (ftuo *FileTagUpdateOne) Where(ps ...predicate.FileTag) *FileTagUpdateOne

Where appends a list predicates to the FileTagUpdate builder.

type FileTags added in v1.1.3

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 added in v1.0.12

func (fu *FileUpdate) AddTagIDs(ids ...uint64) *FileUpdate

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

func (*FileUpdate) AddTags added in v1.0.12

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 added in v1.0.12

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.0.12

func (fu *FileUpdate) RemoveTagIDs(ids ...uint64) *FileUpdate

RemoveTagIDs removes the "tags" edge to FileTag entities by IDs.

func (*FileUpdate) RemoveTags added in v1.0.12

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 added in v1.2.3

func (fu *FileUpdate) SetNillableFileType(u *uint8) *FileUpdate

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*FileUpdate) SetNillableMd5 added in v1.2.3

func (fu *FileUpdate) SetNillableMd5(s *string) *FileUpdate

SetNillableMd5 sets the "md5" field if the given value is not nil.

func (*FileUpdate) SetNillableName added in v1.2.3

func (fu *FileUpdate) SetNillableName(s *string) *FileUpdate

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

func (*FileUpdate) SetNillablePath added in v1.2.3

func (fu *FileUpdate) SetNillablePath(s *string) *FileUpdate

SetNillablePath sets the "path" field if the given value is not nil.

func (*FileUpdate) SetNillableSize added in v1.2.3

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 added in v1.2.3

func (fu *FileUpdate) SetNillableUserID(s *string) *FileUpdate

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FileUpdate) SetNotNilFileType added in v1.0.10

func (f *FileUpdate) SetNotNilFileType(value *uint8) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilMd5 added in v1.0.10

func (f *FileUpdate) SetNotNilMd5(value *string) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilName added in v1.0.10

func (f *FileUpdate) SetNotNilName(value *string) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilPath added in v1.0.10

func (f *FileUpdate) SetNotNilPath(value *string) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilSize added in v1.0.10

func (f *FileUpdate) SetNotNilSize(value *uint64) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilStatus added in v1.0.10

func (f *FileUpdate) SetNotNilStatus(value *uint8) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilUpdatedAt added in v1.0.10

func (f *FileUpdate) SetNotNilUpdatedAt(value *time.Time) *FileUpdate

set field if value's pointer is not nil.

func (*FileUpdate) SetNotNilUserID added in v1.1.3

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 added in v1.1.3

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 added in v1.0.12

func (fuo *FileUpdateOne) AddTagIDs(ids ...uint64) *FileUpdateOne

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

func (*FileUpdateOne) AddTags added in v1.0.12

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 added in v1.0.12

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 added in v1.0.11

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 added in v1.0.11

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 added in v1.0.12

func (fuo *FileUpdateOne) RemoveTagIDs(ids ...uint64) *FileUpdateOne

RemoveTagIDs removes the "tags" edge to FileTag entities by IDs.

func (*FileUpdateOne) RemoveTags added in v1.0.12

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 added in v1.2.3

func (fuo *FileUpdateOne) SetNillableFileType(u *uint8) *FileUpdateOne

SetNillableFileType sets the "file_type" field if the given value is not nil.

func (*FileUpdateOne) SetNillableMd5 added in v1.2.3

func (fuo *FileUpdateOne) SetNillableMd5(s *string) *FileUpdateOne

SetNillableMd5 sets the "md5" field if the given value is not nil.

func (*FileUpdateOne) SetNillableName added in v1.2.3

func (fuo *FileUpdateOne) SetNillableName(s *string) *FileUpdateOne

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

func (*FileUpdateOne) SetNillablePath added in v1.2.3

func (fuo *FileUpdateOne) SetNillablePath(s *string) *FileUpdateOne

SetNillablePath sets the "path" field if the given value is not nil.

func (*FileUpdateOne) SetNillableSize added in v1.2.3

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 added in v1.2.3

func (fuo *FileUpdateOne) SetNillableUserID(s *string) *FileUpdateOne

SetNillableUserID sets the "user_id" field if the given value is not nil.

func (*FileUpdateOne) SetNotNilFileType added in v1.0.10

func (f *FileUpdateOne) SetNotNilFileType(value *uint8) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilMd5 added in v1.0.10

func (f *FileUpdateOne) SetNotNilMd5(value *string) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilName added in v1.0.10

func (f *FileUpdateOne) SetNotNilName(value *string) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilPath added in v1.0.10

func (f *FileUpdateOne) SetNotNilPath(value *string) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilSize added in v1.0.10

func (f *FileUpdateOne) SetNotNilSize(value *uint64) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilStatus added in v1.0.10

func (f *FileUpdateOne) SetNotNilStatus(value *uint8) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilUpdatedAt added in v1.0.10

func (f *FileUpdateOne) SetNotNilUpdatedAt(value *time.Time) *FileUpdateOne

set field if value's pointer is not nil.

func (*FileUpdateOne) SetNotNilUserID added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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
}

StorageProvider is the model entity for the StorageProvider schema.

func (*StorageProvider) ExecContext added in v1.1.3

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 added in v1.1.3

func (sp *StorageProvider) QueryCloudfiles() *CloudFileQuery

QueryCloudfiles queries the "cloudfiles" edge of the StorageProvider entity.

func (*StorageProvider) QueryContext added in v1.1.3

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 added in v1.1.3

func (sp *StorageProvider) String() string

String implements the fmt.Stringer.

func (*StorageProvider) Unwrap added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

StorageProviderClient is a client for the StorageProvider schema.

func NewStorageProviderClient added in v1.1.3

func NewStorageProviderClient(c config) *StorageProviderClient

NewStorageProviderClient returns a client for the StorageProvider from the given config.

func (*StorageProviderClient) Create added in v1.1.3

Create returns a builder for creating a StorageProvider entity.

func (*StorageProviderClient) CreateBulk added in v1.1.3

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

func (*StorageProviderClient) Delete added in v1.1.3

Delete returns a delete builder for StorageProvider.

func (*StorageProviderClient) DeleteOne added in v1.1.3

DeleteOne returns a builder for deleting the given entity.

func (*StorageProviderClient) DeleteOneID added in v1.1.3

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

func (*StorageProviderClient) ExecContext added in v1.1.3

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 added in v1.1.3

Get returns a StorageProvider entity by its id.

func (*StorageProviderClient) GetX added in v1.1.3

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

func (*StorageProviderClient) Hooks added in v1.1.3

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

Hooks returns the client hooks.

func (*StorageProviderClient) Intercept added in v1.1.3

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 added in v1.1.3

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

Interceptors returns the client interceptors.

func (*StorageProviderClient) MapCreateBulk added in v1.1.5

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 added in v1.1.3

Query returns a query builder for StorageProvider.

func (*StorageProviderClient) QueryCloudfiles added in v1.1.3

func (c *StorageProviderClient) QueryCloudfiles(sp *StorageProvider) *CloudFileQuery

QueryCloudfiles queries the cloudfiles edge of a StorageProvider.

func (*StorageProviderClient) QueryContext added in v1.1.3

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 added in v1.1.3

Update returns an update builder for StorageProvider.

func (*StorageProviderClient) UpdateOne added in v1.1.3

UpdateOne returns an update builder for the given entity.

func (*StorageProviderClient) UpdateOneID added in v1.1.3

UpdateOneID returns an update builder for the given id.

func (*StorageProviderClient) Use added in v1.1.3

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 added in v1.1.3

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

StorageProviderCreate is the builder for creating a StorageProvider entity.

func (*StorageProviderCreate) AddCloudfileIDs added in v1.1.3

func (spc *StorageProviderCreate) AddCloudfileIDs(ids ...uuid.UUID) *StorageProviderCreate

AddCloudfileIDs adds the "cloudfiles" edge to the CloudFile entity by IDs.

func (*StorageProviderCreate) AddCloudfiles added in v1.1.3

func (spc *StorageProviderCreate) AddCloudfiles(c ...*CloudFile) *StorageProviderCreate

AddCloudfiles adds the "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderCreate) Exec added in v1.1.3

func (spc *StorageProviderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageProviderCreate) ExecContext added in v1.1.3

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 added in v1.1.3

func (spc *StorageProviderCreate) ExecX(ctx context.Context)

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

func (*StorageProviderCreate) Mutation added in v1.1.3

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderCreate) QueryContext added in v1.1.3

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 added in v1.1.3

Save creates the StorageProvider in the database.

func (*StorageProviderCreate) SaveX added in v1.1.3

SaveX calls Save and panics if Save returns an error.

func (*StorageProviderCreate) SetBucket added in v1.1.3

SetBucket sets the "bucket" field.

func (*StorageProviderCreate) SetCdnURL added in v1.3.10

SetCdnURL sets the "cdn_url" field.

func (*StorageProviderCreate) SetCreatedAt added in v1.1.3

func (spc *StorageProviderCreate) SetCreatedAt(t time.Time) *StorageProviderCreate

SetCreatedAt sets the "created_at" field.

func (*StorageProviderCreate) SetEndpoint added in v1.1.4

func (spc *StorageProviderCreate) SetEndpoint(s string) *StorageProviderCreate

SetEndpoint sets the "endpoint" field.

func (*StorageProviderCreate) SetFolder added in v1.1.3

SetFolder sets the "folder" field.

func (*StorageProviderCreate) SetID added in v1.1.3

SetID sets the "id" field.

func (*StorageProviderCreate) SetIsDefault added in v1.1.3

func (spc *StorageProviderCreate) SetIsDefault(b bool) *StorageProviderCreate

SetIsDefault sets the "is_default" field.

func (*StorageProviderCreate) SetName added in v1.1.3

SetName sets the "name" field.

func (*StorageProviderCreate) SetNillableCdnURL added in v1.3.10

func (spc *StorageProviderCreate) SetNillableCdnURL(s *string) *StorageProviderCreate

SetNillableCdnURL sets the "cdn_url" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableCreatedAt added in v1.1.3

func (spc *StorageProviderCreate) SetNillableCreatedAt(t *time.Time) *StorageProviderCreate

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

func (*StorageProviderCreate) SetNillableFolder added in v1.1.3

func (spc *StorageProviderCreate) SetNillableFolder(s *string) *StorageProviderCreate

SetNillableFolder sets the "folder" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableIsDefault added in v1.1.3

func (spc *StorageProviderCreate) SetNillableIsDefault(b *bool) *StorageProviderCreate

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*StorageProviderCreate) SetNillableState added in v1.1.3

func (spc *StorageProviderCreate) SetNillableState(b *bool) *StorageProviderCreate

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

func (*StorageProviderCreate) SetNillableUpdatedAt added in v1.1.3

func (spc *StorageProviderCreate) SetNillableUpdatedAt(t *time.Time) *StorageProviderCreate

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

func (*StorageProviderCreate) SetNillableUseCdn added in v1.3.10

func (spc *StorageProviderCreate) SetNillableUseCdn(b *bool) *StorageProviderCreate

SetNillableUseCdn sets the "use_cdn" field if the given value is not nil.

func (*StorageProviderCreate) SetNotNilBucket added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilBucket(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilCdnURL added in v1.3.10

func (sp *StorageProviderCreate) SetNotNilCdnURL(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilEndpoint added in v1.1.4

func (sp *StorageProviderCreate) SetNotNilEndpoint(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilFolder added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilFolder(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilIsDefault added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilIsDefault(value *bool) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilName added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilName(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilRegion added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilRegion(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilSecretID added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilSecretID(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilSecretKey added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilSecretKey(value *string) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilState added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilState(value *bool) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilUpdatedAt added in v1.1.3

func (sp *StorageProviderCreate) SetNotNilUpdatedAt(value *time.Time) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetNotNilUseCdn added in v1.3.10

func (sp *StorageProviderCreate) SetNotNilUseCdn(value *bool) *StorageProviderCreate

set field if value's pointer is not nil.

func (*StorageProviderCreate) SetRegion added in v1.1.3

SetRegion sets the "region" field.

func (*StorageProviderCreate) SetSecretID added in v1.1.3

func (spc *StorageProviderCreate) SetSecretID(s string) *StorageProviderCreate

SetSecretID sets the "secret_id" field.

func (*StorageProviderCreate) SetSecretKey added in v1.1.3

func (spc *StorageProviderCreate) SetSecretKey(s string) *StorageProviderCreate

SetSecretKey sets the "secret_key" field.

func (*StorageProviderCreate) SetState added in v1.1.3

SetState sets the "state" field.

func (*StorageProviderCreate) SetUpdatedAt added in v1.1.3

func (spc *StorageProviderCreate) SetUpdatedAt(t time.Time) *StorageProviderCreate

SetUpdatedAt sets the "updated_at" field.

func (*StorageProviderCreate) SetUseCdn added in v1.3.10

SetUseCdn sets the "use_cdn" field.

type StorageProviderCreateBulk added in v1.1.3

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

StorageProviderCreateBulk is the builder for creating many StorageProvider entities in bulk.

func (*StorageProviderCreateBulk) Exec added in v1.1.3

Exec executes the query.

func (*StorageProviderCreateBulk) ExecContext added in v1.1.3

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 added in v1.1.3

func (spcb *StorageProviderCreateBulk) ExecX(ctx context.Context)

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

func (*StorageProviderCreateBulk) QueryContext added in v1.1.3

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 added in v1.1.3

Save creates the StorageProvider entities in the database.

func (*StorageProviderCreateBulk) SaveX added in v1.1.3

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

type StorageProviderDelete added in v1.1.3

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

StorageProviderDelete is the builder for deleting a StorageProvider entity.

func (*StorageProviderDelete) Exec added in v1.1.3

func (spd *StorageProviderDelete) Exec(ctx context.Context) (int, error)

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

func (*StorageProviderDelete) ExecContext added in v1.1.3

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 added in v1.1.3

func (spd *StorageProviderDelete) ExecX(ctx context.Context) int

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

func (*StorageProviderDelete) QueryContext added in v1.1.3

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 added in v1.1.3

Where appends a list predicates to the StorageProviderDelete builder.

type StorageProviderDeleteOne added in v1.1.3

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

StorageProviderDeleteOne is the builder for deleting a single StorageProvider entity.

func (*StorageProviderDeleteOne) Exec added in v1.1.3

Exec executes the deletion query.

func (*StorageProviderDeleteOne) ExecX added in v1.1.3

func (spdo *StorageProviderDeleteOne) ExecX(ctx context.Context)

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

func (*StorageProviderDeleteOne) Where added in v1.1.3

Where appends a list predicates to the StorageProviderDelete builder.

type StorageProviderEdges added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

StorageProviderGroupBy is the group-by builder for StorageProvider entities.

func (*StorageProviderGroupBy) Aggregate added in v1.1.3

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

func (*StorageProviderGroupBy) Bool added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderGroupBy) Bools added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderGroupBy) Float64 added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderGroupBy) Float64s added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderGroupBy) Int added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderGroupBy) Ints added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderGroupBy) Scan added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderGroupBy) String added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderGroupBy) Strings added in v1.1.3

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 added in v1.1.3

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

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

type StorageProviderMutation added in v1.1.3

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

StorageProviderMutation represents an operation that mutates the StorageProvider nodes in the graph.

func (*StorageProviderMutation) AddCloudfileIDs added in v1.1.3

func (m *StorageProviderMutation) AddCloudfileIDs(ids ...uuid.UUID)

AddCloudfileIDs adds the "cloudfiles" edge to the CloudFile entity by ids.

func (*StorageProviderMutation) AddField added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderMutation) AddedField added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderMutation) AddedIDs added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) Bucket() (r string, exists bool)

Bucket returns the value of the "bucket" field in the mutation.

func (*StorageProviderMutation) CdnURL added in v1.3.10

func (m *StorageProviderMutation) CdnURL() (r string, exists bool)

CdnURL returns the value of the "cdn_url" field in the mutation.

func (*StorageProviderMutation) CdnURLCleared added in v1.3.10

func (m *StorageProviderMutation) CdnURLCleared() bool

CdnURLCleared returns if the "cdn_url" field was cleared in this mutation.

func (*StorageProviderMutation) ClearCdnURL added in v1.3.10

func (m *StorageProviderMutation) ClearCdnURL()

ClearCdnURL clears the value of the "cdn_url" field.

func (*StorageProviderMutation) ClearCloudfiles added in v1.1.3

func (m *StorageProviderMutation) ClearCloudfiles()

ClearCloudfiles clears the "cloudfiles" edge to the CloudFile entity.

func (*StorageProviderMutation) ClearEdge added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) ClearFolder()

ClearFolder clears the value of the "folder" field.

func (*StorageProviderMutation) ClearState added in v1.1.3

func (m *StorageProviderMutation) ClearState()

ClearState clears the value of the "state" field.

func (*StorageProviderMutation) ClearedEdges added in v1.1.3

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

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

func (*StorageProviderMutation) ClearedFields added in v1.1.3

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

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

func (StorageProviderMutation) Client added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) CloudfilesCleared() bool

CloudfilesCleared reports if the "cloudfiles" edge to the CloudFile entity was cleared.

func (*StorageProviderMutation) CloudfilesIDs added in v1.1.3

func (m *StorageProviderMutation) CloudfilesIDs() (ids []uuid.UUID)

CloudfilesIDs returns the "cloudfiles" edge IDs in the mutation.

func (*StorageProviderMutation) CreatedAt added in v1.1.3

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

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

func (*StorageProviderMutation) EdgeCleared added in v1.1.3

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 added in v1.1.4

func (m *StorageProviderMutation) Endpoint() (r string, exists bool)

Endpoint returns the value of the "endpoint" field in the mutation.

func (*StorageProviderMutation) ExecContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) Folder() (r string, exists bool)

Folder returns the value of the "folder" field in the mutation.

func (*StorageProviderMutation) FolderCleared added in v1.1.3

func (m *StorageProviderMutation) FolderCleared() bool

FolderCleared returns if the "folder" field was cleared in this mutation.

func (*StorageProviderMutation) ID added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) IsDefault() (r bool, exists bool)

IsDefault returns the value of the "is_default" field in the mutation.

func (*StorageProviderMutation) Name added in v1.1.3

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

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

func (*StorageProviderMutation) OldBucket added in v1.1.3

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 added in v1.3.10

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 added in v1.1.3

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 added in v1.1.4

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.3.10

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 added in v1.1.3

func (m *StorageProviderMutation) Op() Op

Op returns the operation name.

func (*StorageProviderMutation) QueryContext added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) Region() (r string, exists bool)

Region returns the value of the "region" field in the mutation.

func (*StorageProviderMutation) RemoveCloudfileIDs added in v1.1.3

func (m *StorageProviderMutation) RemoveCloudfileIDs(ids ...uuid.UUID)

RemoveCloudfileIDs removes the "cloudfiles" edge to the CloudFile entity by IDs.

func (*StorageProviderMutation) RemovedCloudfilesIDs added in v1.1.3

func (m *StorageProviderMutation) RemovedCloudfilesIDs() (ids []uuid.UUID)

RemovedCloudfiles returns the removed IDs of the "cloudfiles" edge to the CloudFile entity.

func (*StorageProviderMutation) RemovedEdges added in v1.1.3

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

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

func (*StorageProviderMutation) RemovedIDs added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) ResetBucket()

ResetBucket resets all changes to the "bucket" field.

func (*StorageProviderMutation) ResetCdnURL added in v1.3.10

func (m *StorageProviderMutation) ResetCdnURL()

ResetCdnURL resets all changes to the "cdn_url" field.

func (*StorageProviderMutation) ResetCloudfiles added in v1.1.3

func (m *StorageProviderMutation) ResetCloudfiles()

ResetCloudfiles resets all changes to the "cloudfiles" edge.

func (*StorageProviderMutation) ResetCreatedAt added in v1.1.3

func (m *StorageProviderMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*StorageProviderMutation) ResetEdge added in v1.1.3

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 added in v1.1.4

func (m *StorageProviderMutation) ResetEndpoint()

ResetEndpoint resets all changes to the "endpoint" field.

func (*StorageProviderMutation) ResetField added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) ResetFolder()

ResetFolder resets all changes to the "folder" field.

func (*StorageProviderMutation) ResetIsDefault added in v1.1.3

func (m *StorageProviderMutation) ResetIsDefault()

ResetIsDefault resets all changes to the "is_default" field.

func (*StorageProviderMutation) ResetName added in v1.1.3

func (m *StorageProviderMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*StorageProviderMutation) ResetRegion added in v1.1.3

func (m *StorageProviderMutation) ResetRegion()

ResetRegion resets all changes to the "region" field.

func (*StorageProviderMutation) ResetSecretID added in v1.1.3

func (m *StorageProviderMutation) ResetSecretID()

ResetSecretID resets all changes to the "secret_id" field.

func (*StorageProviderMutation) ResetSecretKey added in v1.1.3

func (m *StorageProviderMutation) ResetSecretKey()

ResetSecretKey resets all changes to the "secret_key" field.

func (*StorageProviderMutation) ResetState added in v1.1.3

func (m *StorageProviderMutation) ResetState()

ResetState resets all changes to the "state" field.

func (*StorageProviderMutation) ResetUpdatedAt added in v1.1.3

func (m *StorageProviderMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*StorageProviderMutation) ResetUseCdn added in v1.3.10

func (m *StorageProviderMutation) ResetUseCdn()

ResetUseCdn resets all changes to the "use_cdn" field.

func (*StorageProviderMutation) SecretID added in v1.1.3

func (m *StorageProviderMutation) SecretID() (r string, exists bool)

SecretID returns the value of the "secret_id" field in the mutation.

func (*StorageProviderMutation) SecretKey added in v1.1.3

func (m *StorageProviderMutation) SecretKey() (r string, exists bool)

SecretKey returns the value of the "secret_key" field in the mutation.

func (*StorageProviderMutation) SetBucket added in v1.1.3

func (m *StorageProviderMutation) SetBucket(s string)

SetBucket sets the "bucket" field.

func (*StorageProviderMutation) SetCdnURL added in v1.3.10

func (m *StorageProviderMutation) SetCdnURL(s string)

SetCdnURL sets the "cdn_url" field.

func (*StorageProviderMutation) SetCreatedAt added in v1.1.3

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

SetCreatedAt sets the "created_at" field.

func (*StorageProviderMutation) SetEndpoint added in v1.1.4

func (m *StorageProviderMutation) SetEndpoint(s string)

SetEndpoint sets the "endpoint" field.

func (*StorageProviderMutation) SetField added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) SetFolder(s string)

SetFolder sets the "folder" field.

func (*StorageProviderMutation) SetID added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) SetIsDefault(b bool)

SetIsDefault sets the "is_default" field.

func (*StorageProviderMutation) SetName added in v1.1.3

func (m *StorageProviderMutation) SetName(s string)

SetName sets the "name" field.

func (*StorageProviderMutation) SetOp added in v1.1.3

func (m *StorageProviderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*StorageProviderMutation) SetRegion added in v1.1.3

func (m *StorageProviderMutation) SetRegion(s string)

SetRegion sets the "region" field.

func (*StorageProviderMutation) SetSecretID added in v1.1.3

func (m *StorageProviderMutation) SetSecretID(s string)

SetSecretID sets the "secret_id" field.

func (*StorageProviderMutation) SetSecretKey added in v1.1.3

func (m *StorageProviderMutation) SetSecretKey(s string)

SetSecretKey sets the "secret_key" field.

func (*StorageProviderMutation) SetState added in v1.1.3

func (m *StorageProviderMutation) SetState(b bool)

SetState sets the "state" field.

func (*StorageProviderMutation) SetUpdatedAt added in v1.1.3

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

SetUpdatedAt sets the "updated_at" field.

func (*StorageProviderMutation) SetUseCdn added in v1.3.10

func (m *StorageProviderMutation) SetUseCdn(b bool)

SetUseCdn sets the "use_cdn" field.

func (*StorageProviderMutation) State added in v1.1.3

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

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

func (*StorageProviderMutation) StateCleared added in v1.1.3

func (m *StorageProviderMutation) StateCleared() bool

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

func (StorageProviderMutation) Tx added in v1.1.3

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 added in v1.1.3

func (m *StorageProviderMutation) Type() string

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

func (*StorageProviderMutation) UpdatedAt added in v1.1.3

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

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

func (*StorageProviderMutation) UseCdn added in v1.3.10

func (m *StorageProviderMutation) UseCdn() (r bool, exists bool)

UseCdn returns the value of the "use_cdn" field in the mutation.

func (*StorageProviderMutation) Where added in v1.1.3

Where appends a list predicates to the StorageProviderMutation builder.

func (*StorageProviderMutation) WhereP added in v1.1.3

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 added in v1.1.3

type StorageProviderPageList struct {
	List        []*StorageProvider `json:"list"`
	PageDetails *PageDetails       `json:"pageDetails"`
}

StorageProviderPageList is StorageProvider PageList result.

type StorageProviderPager added in v1.1.3

type StorageProviderPager struct {
	Order  storageprovider.OrderOption
	Filter func(*StorageProviderQuery) (*StorageProviderQuery, error)
}

func (*StorageProviderPager) ApplyFilter added in v1.1.3

type StorageProviderPaginateOption added in v1.1.3

type StorageProviderPaginateOption func(*StorageProviderPager)

StorageProviderPaginateOption enables pagination customization.

type StorageProviderQuery added in v1.1.3

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

StorageProviderQuery is the builder for querying StorageProvider entities.

func (*StorageProviderQuery) Aggregate added in v1.1.3

Aggregate returns a StorageProviderSelect configured with the given aggregations.

func (*StorageProviderQuery) All added in v1.1.3

All executes the query and returns a list of StorageProviders.

func (*StorageProviderQuery) AllX added in v1.1.3

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

func (*StorageProviderQuery) Clone added in v1.1.3

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 added in v1.1.3

func (spq *StorageProviderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StorageProviderQuery) CountX added in v1.1.3

func (spq *StorageProviderQuery) CountX(ctx context.Context) int

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

func (*StorageProviderQuery) ExecContext added in v1.1.3

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 added in v1.1.3

func (spq *StorageProviderQuery) Exist(ctx context.Context) (bool, error)

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

func (*StorageProviderQuery) ExistX added in v1.1.3

func (spq *StorageProviderQuery) ExistX(ctx context.Context) bool

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

func (*StorageProviderQuery) First added in v1.1.3

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

func (*StorageProviderQuery) FirstID added in v1.1.3

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 added in v1.1.3

func (spq *StorageProviderQuery) FirstIDX(ctx context.Context) uint64

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

func (*StorageProviderQuery) FirstX added in v1.1.3

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

func (*StorageProviderQuery) GroupBy added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (spq *StorageProviderQuery) IDsX(ctx context.Context) []uint64

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

func (*StorageProviderQuery) Limit added in v1.1.3

func (spq *StorageProviderQuery) Limit(limit int) *StorageProviderQuery

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

func (*StorageProviderQuery) Offset added in v1.1.3

func (spq *StorageProviderQuery) Offset(offset int) *StorageProviderQuery

Offset to start from.

func (*StorageProviderQuery) Only added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

func (spq *StorageProviderQuery) OnlyIDX(ctx context.Context) uint64

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

func (*StorageProviderQuery) OnlyX added in v1.1.3

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

func (*StorageProviderQuery) Order added in v1.1.3

Order specifies how the records should be ordered.

func (*StorageProviderQuery) Page added in v1.1.3

func (*StorageProviderQuery) QueryCloudfiles added in v1.1.3

func (spq *StorageProviderQuery) QueryCloudfiles() *CloudFileQuery

QueryCloudfiles chains the current query on the "cloudfiles" edge.

func (*StorageProviderQuery) QueryContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

Where adds a new predicate for the StorageProviderQuery builder.

func (*StorageProviderQuery) WithCloudfiles added in v1.1.3

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 added in v1.1.3

type StorageProviderSelect struct {
	*StorageProviderQuery
	// contains filtered or unexported fields
}

StorageProviderSelect is the builder for selecting fields of StorageProvider entities.

func (*StorageProviderSelect) Aggregate added in v1.1.3

Aggregate adds the given aggregation functions to the selector query.

func (*StorageProviderSelect) Bool added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderSelect) Bools added in v1.1.3

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 added in v1.1.3

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

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

func (StorageProviderSelect) ExecContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderSelect) Float64s added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderSelect) Int added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderSelect) Ints added in v1.1.3

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 added in v1.1.3

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

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

func (StorageProviderSelect) QueryContext added in v1.1.3

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 added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderSelect) String added in v1.1.3

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 added in v1.1.3

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

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

func (*StorageProviderSelect) Strings added in v1.1.3

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 added in v1.1.3

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

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

type StorageProviderUpdate added in v1.1.3

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

StorageProviderUpdate is the builder for updating StorageProvider entities.

func (*StorageProviderUpdate) AddCloudfileIDs added in v1.1.3

func (spu *StorageProviderUpdate) AddCloudfileIDs(ids ...uuid.UUID) *StorageProviderUpdate

AddCloudfileIDs adds the "cloudfiles" edge to the CloudFile entity by IDs.

func (*StorageProviderUpdate) AddCloudfiles added in v1.1.3

func (spu *StorageProviderUpdate) AddCloudfiles(c ...*CloudFile) *StorageProviderUpdate

AddCloudfiles adds the "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderUpdate) ClearCdnURL added in v1.3.10

func (spu *StorageProviderUpdate) ClearCdnURL() *StorageProviderUpdate

ClearCdnURL clears the value of the "cdn_url" field.

func (*StorageProviderUpdate) ClearCloudfiles added in v1.1.3

func (spu *StorageProviderUpdate) ClearCloudfiles() *StorageProviderUpdate

ClearCloudfiles clears all "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderUpdate) ClearFolder added in v1.1.3

func (spu *StorageProviderUpdate) ClearFolder() *StorageProviderUpdate

ClearFolder clears the value of the "folder" field.

func (*StorageProviderUpdate) ClearState added in v1.1.3

func (spu *StorageProviderUpdate) ClearState() *StorageProviderUpdate

ClearState clears the value of the "state" field.

func (*StorageProviderUpdate) Exec added in v1.1.3

func (spu *StorageProviderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StorageProviderUpdate) ExecContext added in v1.1.3

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 added in v1.1.3

func (spu *StorageProviderUpdate) ExecX(ctx context.Context)

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

func (*StorageProviderUpdate) Mutation added in v1.1.3

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderUpdate) QueryContext added in v1.1.3

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 added in v1.1.3

func (spu *StorageProviderUpdate) RemoveCloudfileIDs(ids ...uuid.UUID) *StorageProviderUpdate

RemoveCloudfileIDs removes the "cloudfiles" edge to CloudFile entities by IDs.

func (*StorageProviderUpdate) RemoveCloudfiles added in v1.1.3

func (spu *StorageProviderUpdate) RemoveCloudfiles(c ...*CloudFile) *StorageProviderUpdate

RemoveCloudfiles removes "cloudfiles" edges to CloudFile entities.

func (*StorageProviderUpdate) Save added in v1.1.3

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 added in v1.1.3

func (spu *StorageProviderUpdate) SaveX(ctx context.Context) int

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

func (*StorageProviderUpdate) SetBucket added in v1.1.3

SetBucket sets the "bucket" field.

func (*StorageProviderUpdate) SetCdnURL added in v1.3.10

SetCdnURL sets the "cdn_url" field.

func (*StorageProviderUpdate) SetEndpoint added in v1.1.4

func (spu *StorageProviderUpdate) SetEndpoint(s string) *StorageProviderUpdate

SetEndpoint sets the "endpoint" field.

func (*StorageProviderUpdate) SetFolder added in v1.1.3

SetFolder sets the "folder" field.

func (*StorageProviderUpdate) SetIsDefault added in v1.1.3

func (spu *StorageProviderUpdate) SetIsDefault(b bool) *StorageProviderUpdate

SetIsDefault sets the "is_default" field.

func (*StorageProviderUpdate) SetName added in v1.1.3

SetName sets the "name" field.

func (*StorageProviderUpdate) SetNillableBucket added in v1.2.3

func (spu *StorageProviderUpdate) SetNillableBucket(s *string) *StorageProviderUpdate

SetNillableBucket sets the "bucket" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableCdnURL added in v1.3.10

func (spu *StorageProviderUpdate) SetNillableCdnURL(s *string) *StorageProviderUpdate

SetNillableCdnURL sets the "cdn_url" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableEndpoint added in v1.2.3

func (spu *StorageProviderUpdate) SetNillableEndpoint(s *string) *StorageProviderUpdate

SetNillableEndpoint sets the "endpoint" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableFolder added in v1.1.3

func (spu *StorageProviderUpdate) SetNillableFolder(s *string) *StorageProviderUpdate

SetNillableFolder sets the "folder" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableIsDefault added in v1.1.3

func (spu *StorageProviderUpdate) SetNillableIsDefault(b *bool) *StorageProviderUpdate

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableName added in v1.2.3

func (spu *StorageProviderUpdate) SetNillableName(s *string) *StorageProviderUpdate

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

func (*StorageProviderUpdate) SetNillableRegion added in v1.2.3

func (spu *StorageProviderUpdate) SetNillableRegion(s *string) *StorageProviderUpdate

SetNillableRegion sets the "region" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableSecretID added in v1.2.3

func (spu *StorageProviderUpdate) SetNillableSecretID(s *string) *StorageProviderUpdate

SetNillableSecretID sets the "secret_id" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableSecretKey added in v1.2.3

func (spu *StorageProviderUpdate) SetNillableSecretKey(s *string) *StorageProviderUpdate

SetNillableSecretKey sets the "secret_key" field if the given value is not nil.

func (*StorageProviderUpdate) SetNillableState added in v1.1.3

func (spu *StorageProviderUpdate) SetNillableState(b *bool) *StorageProviderUpdate

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

func (*StorageProviderUpdate) SetNillableUseCdn added in v1.3.10

func (spu *StorageProviderUpdate) SetNillableUseCdn(b *bool) *StorageProviderUpdate

SetNillableUseCdn sets the "use_cdn" field if the given value is not nil.

func (*StorageProviderUpdate) SetNotNilBucket added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilBucket(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilCdnURL added in v1.3.10

func (sp *StorageProviderUpdate) SetNotNilCdnURL(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilEndpoint added in v1.1.4

func (sp *StorageProviderUpdate) SetNotNilEndpoint(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilFolder added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilFolder(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilIsDefault added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilIsDefault(value *bool) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilName added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilName(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilRegion added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilRegion(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilSecretID added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilSecretID(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilSecretKey added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilSecretKey(value *string) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilState added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilState(value *bool) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilUpdatedAt added in v1.1.3

func (sp *StorageProviderUpdate) SetNotNilUpdatedAt(value *time.Time) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetNotNilUseCdn added in v1.3.10

func (sp *StorageProviderUpdate) SetNotNilUseCdn(value *bool) *StorageProviderUpdate

set field if value's pointer is not nil.

func (*StorageProviderUpdate) SetRegion added in v1.1.3

SetRegion sets the "region" field.

func (*StorageProviderUpdate) SetSecretID added in v1.1.3

func (spu *StorageProviderUpdate) SetSecretID(s string) *StorageProviderUpdate

SetSecretID sets the "secret_id" field.

func (*StorageProviderUpdate) SetSecretKey added in v1.1.3

func (spu *StorageProviderUpdate) SetSecretKey(s string) *StorageProviderUpdate

SetSecretKey sets the "secret_key" field.

func (*StorageProviderUpdate) SetState added in v1.1.3

SetState sets the "state" field.

func (*StorageProviderUpdate) SetUpdatedAt added in v1.1.3

func (spu *StorageProviderUpdate) SetUpdatedAt(t time.Time) *StorageProviderUpdate

SetUpdatedAt sets the "updated_at" field.

func (*StorageProviderUpdate) SetUseCdn added in v1.3.10

SetUseCdn sets the "use_cdn" field.

func (*StorageProviderUpdate) Where added in v1.1.3

Where appends a list predicates to the StorageProviderUpdate builder.

type StorageProviderUpdateOne added in v1.1.3

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

StorageProviderUpdateOne is the builder for updating a single StorageProvider entity.

func (*StorageProviderUpdateOne) AddCloudfileIDs added in v1.1.3

func (spuo *StorageProviderUpdateOne) AddCloudfileIDs(ids ...uuid.UUID) *StorageProviderUpdateOne

AddCloudfileIDs adds the "cloudfiles" edge to the CloudFile entity by IDs.

func (*StorageProviderUpdateOne) AddCloudfiles added in v1.1.3

func (spuo *StorageProviderUpdateOne) AddCloudfiles(c ...*CloudFile) *StorageProviderUpdateOne

AddCloudfiles adds the "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderUpdateOne) ClearCdnURL added in v1.3.10

ClearCdnURL clears the value of the "cdn_url" field.

func (*StorageProviderUpdateOne) ClearCloudfiles added in v1.1.3

func (spuo *StorageProviderUpdateOne) ClearCloudfiles() *StorageProviderUpdateOne

ClearCloudfiles clears all "cloudfiles" edges to the CloudFile entity.

func (*StorageProviderUpdateOne) ClearFolder added in v1.1.3

ClearFolder clears the value of the "folder" field.

func (*StorageProviderUpdateOne) ClearState added in v1.1.3

ClearState clears the value of the "state" field.

func (*StorageProviderUpdateOne) Exec added in v1.1.3

Exec executes the query on the entity.

func (*StorageProviderUpdateOne) ExecContext added in v1.1.3

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 added in v1.1.3

func (spuo *StorageProviderUpdateOne) ExecX(ctx context.Context)

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

func (*StorageProviderUpdateOne) Mutation added in v1.1.3

Mutation returns the StorageProviderMutation object of the builder.

func (*StorageProviderUpdateOne) QueryContext added in v1.1.3

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 added in v1.1.3

func (spuo *StorageProviderUpdateOne) RemoveCloudfileIDs(ids ...uuid.UUID) *StorageProviderUpdateOne

RemoveCloudfileIDs removes the "cloudfiles" edge to CloudFile entities by IDs.

func (*StorageProviderUpdateOne) RemoveCloudfiles added in v1.1.3

func (spuo *StorageProviderUpdateOne) RemoveCloudfiles(c ...*CloudFile) *StorageProviderUpdateOne

RemoveCloudfiles removes "cloudfiles" edges to CloudFile entities.

func (*StorageProviderUpdateOne) Save added in v1.1.3

Save executes the query and returns the updated StorageProvider entity.

func (*StorageProviderUpdateOne) SaveX added in v1.1.3

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

func (*StorageProviderUpdateOne) Select added in v1.1.3

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 added in v1.1.3

SetBucket sets the "bucket" field.

func (*StorageProviderUpdateOne) SetCdnURL added in v1.3.10

SetCdnURL sets the "cdn_url" field.

func (*StorageProviderUpdateOne) SetEndpoint added in v1.1.4

SetEndpoint sets the "endpoint" field.

func (*StorageProviderUpdateOne) SetFolder added in v1.1.3

SetFolder sets the "folder" field.

func (*StorageProviderUpdateOne) SetIsDefault added in v1.1.3

SetIsDefault sets the "is_default" field.

func (*StorageProviderUpdateOne) SetName added in v1.1.3

SetName sets the "name" field.

func (*StorageProviderUpdateOne) SetNillableBucket added in v1.2.3

func (spuo *StorageProviderUpdateOne) SetNillableBucket(s *string) *StorageProviderUpdateOne

SetNillableBucket sets the "bucket" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableCdnURL added in v1.3.10

func (spuo *StorageProviderUpdateOne) SetNillableCdnURL(s *string) *StorageProviderUpdateOne

SetNillableCdnURL sets the "cdn_url" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableEndpoint added in v1.2.3

func (spuo *StorageProviderUpdateOne) SetNillableEndpoint(s *string) *StorageProviderUpdateOne

SetNillableEndpoint sets the "endpoint" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableFolder added in v1.1.3

func (spuo *StorageProviderUpdateOne) SetNillableFolder(s *string) *StorageProviderUpdateOne

SetNillableFolder sets the "folder" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableIsDefault added in v1.1.3

func (spuo *StorageProviderUpdateOne) SetNillableIsDefault(b *bool) *StorageProviderUpdateOne

SetNillableIsDefault sets the "is_default" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableName added in v1.2.3

func (spuo *StorageProviderUpdateOne) SetNillableName(s *string) *StorageProviderUpdateOne

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

func (*StorageProviderUpdateOne) SetNillableRegion added in v1.2.3

func (spuo *StorageProviderUpdateOne) SetNillableRegion(s *string) *StorageProviderUpdateOne

SetNillableRegion sets the "region" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableSecretID added in v1.2.3

func (spuo *StorageProviderUpdateOne) SetNillableSecretID(s *string) *StorageProviderUpdateOne

SetNillableSecretID sets the "secret_id" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableSecretKey added in v1.2.3

func (spuo *StorageProviderUpdateOne) SetNillableSecretKey(s *string) *StorageProviderUpdateOne

SetNillableSecretKey sets the "secret_key" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNillableState added in v1.1.3

func (spuo *StorageProviderUpdateOne) SetNillableState(b *bool) *StorageProviderUpdateOne

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

func (*StorageProviderUpdateOne) SetNillableUseCdn added in v1.3.10

func (spuo *StorageProviderUpdateOne) SetNillableUseCdn(b *bool) *StorageProviderUpdateOne

SetNillableUseCdn sets the "use_cdn" field if the given value is not nil.

func (*StorageProviderUpdateOne) SetNotNilBucket added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilBucket(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilCdnURL added in v1.3.10

func (sp *StorageProviderUpdateOne) SetNotNilCdnURL(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilEndpoint added in v1.1.4

func (sp *StorageProviderUpdateOne) SetNotNilEndpoint(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilFolder added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilFolder(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilIsDefault added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilIsDefault(value *bool) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilName added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilName(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilRegion added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilRegion(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilSecretID added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilSecretID(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilSecretKey added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilSecretKey(value *string) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilState added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilState(value *bool) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilUpdatedAt added in v1.1.3

func (sp *StorageProviderUpdateOne) SetNotNilUpdatedAt(value *time.Time) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetNotNilUseCdn added in v1.3.10

func (sp *StorageProviderUpdateOne) SetNotNilUseCdn(value *bool) *StorageProviderUpdateOne

set field if value's pointer is not nil.

func (*StorageProviderUpdateOne) SetRegion added in v1.1.3

SetRegion sets the "region" field.

func (*StorageProviderUpdateOne) SetSecretID added in v1.1.3

SetSecretID sets the "secret_id" field.

func (*StorageProviderUpdateOne) SetSecretKey added in v1.1.3

SetSecretKey sets the "secret_key" field.

func (*StorageProviderUpdateOne) SetState added in v1.1.3

SetState sets the "state" field.

func (*StorageProviderUpdateOne) SetUpdatedAt added in v1.1.3

SetUpdatedAt sets the "updated_at" field.

func (*StorageProviderUpdateOne) SetUseCdn added in v1.3.10

SetUseCdn sets the "use_cdn" field.

func (*StorageProviderUpdateOne) Where added in v1.1.3

Where appends a list predicates to the StorageProviderUpdate builder.

type StorageProviders added in v1.1.3

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 added in v1.0.11

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 added in v1.0.11

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