ent

package
v0.0.0-...-f17293a Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 21 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.
	TypeApp      = "App"
	TypeMedia    = "Media"
	TypeOperator = "Operator"
	TypeUser     = "User"
)

Variables

This section is empty.

Functions

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 App

type App struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeleteAt holds the value of the "delete_at" field.
	DeleteAt time.Time `json:"delete_at,omitempty"`
	// OperatorID holds the value of the "operator_id" field.
	OperatorID int `json:"operator_id,omitempty"`
	// EncryptedOperatorRsaPublicKey holds the value of the "encrypted_operator_rsa_public_key" field.
	// 用户公钥(operator上传)
	EncryptedOperatorRsaPublicKey string `json:"encrypted_operator_rsa_public_key,omitempty"`
	// EncryptedAppPrivateKey holds the value of the "encrypted_app_private_key" field.
	// 本平台为当前应用生成的应用私钥
	EncryptedAppPrivateKey string `json:"encrypted_app_private_key,omitempty"`
	// EncryptedAppPublicKey holds the value of the "encrypted_app_public_key" field.
	// 本平台为当前应用生成的应用公钥
	EncryptedAppPublicKey string `json:"encrypted_app_public_key,omitempty"`
	// Title holds the value of the "title" field.
	Title string `json:"title,omitempty"`
	// Description holds the value of the "description" field.
	Description string `json:"description,omitempty"`
	// Conf holds the value of the "conf" field.
	// 使用的配置名称
	Conf string `json:"conf,omitempty"`
	// AppID holds the value of the "app_id" field.
	// 应用id
	AppID string `json:"app_id,omitempty"`
	// AppSecret holds the value of the "app_secret" field.
	// 应用密钥
	AppSecret string `json:"app_secret,omitempty"`
	// Status holds the value of the "status" field.
	// 是否启用。 0: 未设置, 1: 启用, 2:不启用
	Status int `json:"status,omitempty"`
	// IPWhitelist holds the value of the "ip_whitelist" field.
	// 允许发起支付的ip白名单
	IPWhitelist []map[string]interface{} `json:"ip_whitelist,omitempty"`
	// contains filtered or unexported fields
}

App is the model entity for the App schema.

func (*App) String

func (a *App) String() string

String implements the fmt.Stringer.

func (*App) Unwrap

func (a *App) Unwrap() *App

Unwrap unwraps the App 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 (*App) Update

func (a *App) Update() *AppUpdateOne

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

type AppClient

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

AppClient is a client for the App schema.

func NewAppClient

func NewAppClient(c config) *AppClient

NewAppClient returns a client for the App from the given config.

func (*AppClient) Create

func (c *AppClient) Create() *AppCreate

Create returns a create builder for App.

func (*AppClient) CreateBulk

func (c *AppClient) CreateBulk(builders ...*AppCreate) *AppCreateBulk

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

func (*AppClient) Delete

func (c *AppClient) Delete() *AppDelete

Delete returns a delete builder for App.

func (*AppClient) DeleteOne

func (c *AppClient) DeleteOne(a *App) *AppDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*AppClient) DeleteOneID

func (c *AppClient) DeleteOneID(id int) *AppDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*AppClient) Get

func (c *AppClient) Get(ctx context.Context, id int) (*App, error)

Get returns a App entity by its id.

func (*AppClient) GetX

func (c *AppClient) GetX(ctx context.Context, id int) *App

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

func (*AppClient) Hooks

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

Hooks returns the client hooks.

func (*AppClient) Query

func (c *AppClient) Query() *AppQuery

Query returns a query builder for App.

func (*AppClient) Update

func (c *AppClient) Update() *AppUpdate

Update returns an update builder for App.

func (*AppClient) UpdateOne

func (c *AppClient) UpdateOne(a *App) *AppUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AppClient) UpdateOneID

func (c *AppClient) UpdateOneID(id int) *AppUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AppClient) Use

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

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

type AppCreate

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

AppCreate is the builder for creating a App entity.

func (*AppCreate) Exec

func (ac *AppCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*AppCreate) ExecX

func (ac *AppCreate) ExecX(ctx context.Context)

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

func (*AppCreate) Mutation

func (ac *AppCreate) Mutation() *AppMutation

Mutation returns the AppMutation object of the builder.

func (*AppCreate) Save

func (ac *AppCreate) Save(ctx context.Context) (*App, error)

Save creates the App in the database.

func (*AppCreate) SaveX

func (ac *AppCreate) SaveX(ctx context.Context) *App

SaveX calls Save and panics if Save returns an error.

func (*AppCreate) SetAppID

func (ac *AppCreate) SetAppID(s string) *AppCreate

SetAppID sets the "app_id" field.

func (*AppCreate) SetAppSecret

func (ac *AppCreate) SetAppSecret(s string) *AppCreate

SetAppSecret sets the "app_secret" field.

func (*AppCreate) SetConf

func (ac *AppCreate) SetConf(s string) *AppCreate

SetConf sets the "conf" field.

func (*AppCreate) SetCreatedAt

func (ac *AppCreate) SetCreatedAt(t time.Time) *AppCreate

SetCreatedAt sets the "created_at" field.

func (*AppCreate) SetDeleteAt

func (ac *AppCreate) SetDeleteAt(t time.Time) *AppCreate

SetDeleteAt sets the "delete_at" field.

func (*AppCreate) SetDescription

func (ac *AppCreate) SetDescription(s string) *AppCreate

SetDescription sets the "description" field.

func (*AppCreate) SetEncryptedAppPrivateKey

func (ac *AppCreate) SetEncryptedAppPrivateKey(s string) *AppCreate

SetEncryptedAppPrivateKey sets the "encrypted_app_private_key" field.

func (*AppCreate) SetEncryptedAppPublicKey

func (ac *AppCreate) SetEncryptedAppPublicKey(s string) *AppCreate

SetEncryptedAppPublicKey sets the "encrypted_app_public_key" field.

func (*AppCreate) SetEncryptedOperatorRsaPublicKey

func (ac *AppCreate) SetEncryptedOperatorRsaPublicKey(s string) *AppCreate

SetEncryptedOperatorRsaPublicKey sets the "encrypted_operator_rsa_public_key" field.

func (*AppCreate) SetIPWhitelist

func (ac *AppCreate) SetIPWhitelist(m []map[string]interface{}) *AppCreate

SetIPWhitelist sets the "ip_whitelist" field.

func (*AppCreate) SetNillableAppID

func (ac *AppCreate) SetNillableAppID(s *string) *AppCreate

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*AppCreate) SetNillableAppSecret

func (ac *AppCreate) SetNillableAppSecret(s *string) *AppCreate

SetNillableAppSecret sets the "app_secret" field if the given value is not nil.

func (*AppCreate) SetNillableConf

func (ac *AppCreate) SetNillableConf(s *string) *AppCreate

SetNillableConf sets the "conf" field if the given value is not nil.

func (*AppCreate) SetNillableCreatedAt

func (ac *AppCreate) SetNillableCreatedAt(t *time.Time) *AppCreate

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

func (*AppCreate) SetNillableDeleteAt

func (ac *AppCreate) SetNillableDeleteAt(t *time.Time) *AppCreate

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*AppCreate) SetNillableDescription

func (ac *AppCreate) SetNillableDescription(s *string) *AppCreate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AppCreate) SetNillableEncryptedAppPrivateKey

func (ac *AppCreate) SetNillableEncryptedAppPrivateKey(s *string) *AppCreate

SetNillableEncryptedAppPrivateKey sets the "encrypted_app_private_key" field if the given value is not nil.

func (*AppCreate) SetNillableEncryptedAppPublicKey

func (ac *AppCreate) SetNillableEncryptedAppPublicKey(s *string) *AppCreate

SetNillableEncryptedAppPublicKey sets the "encrypted_app_public_key" field if the given value is not nil.

func (*AppCreate) SetNillableEncryptedOperatorRsaPublicKey

func (ac *AppCreate) SetNillableEncryptedOperatorRsaPublicKey(s *string) *AppCreate

SetNillableEncryptedOperatorRsaPublicKey sets the "encrypted_operator_rsa_public_key" field if the given value is not nil.

func (*AppCreate) SetNillableOperatorID

func (ac *AppCreate) SetNillableOperatorID(i *int) *AppCreate

SetNillableOperatorID sets the "operator_id" field if the given value is not nil.

func (*AppCreate) SetNillableStatus

func (ac *AppCreate) SetNillableStatus(i *int) *AppCreate

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

func (*AppCreate) SetNillableTitle

func (ac *AppCreate) SetNillableTitle(s *string) *AppCreate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*AppCreate) SetNillableUpdatedAt

func (ac *AppCreate) SetNillableUpdatedAt(t *time.Time) *AppCreate

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

func (*AppCreate) SetOperatorID

func (ac *AppCreate) SetOperatorID(i int) *AppCreate

SetOperatorID sets the "operator_id" field.

func (*AppCreate) SetStatus

func (ac *AppCreate) SetStatus(i int) *AppCreate

SetStatus sets the "status" field.

func (*AppCreate) SetTitle

func (ac *AppCreate) SetTitle(s string) *AppCreate

SetTitle sets the "title" field.

func (*AppCreate) SetUpdatedAt

func (ac *AppCreate) SetUpdatedAt(t time.Time) *AppCreate

SetUpdatedAt sets the "updated_at" field.

type AppCreateBulk

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

AppCreateBulk is the builder for creating many App entities in bulk.

func (*AppCreateBulk) Exec

func (acb *AppCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*AppCreateBulk) ExecX

func (acb *AppCreateBulk) ExecX(ctx context.Context)

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

func (*AppCreateBulk) Save

func (acb *AppCreateBulk) Save(ctx context.Context) ([]*App, error)

Save creates the App entities in the database.

func (*AppCreateBulk) SaveX

func (acb *AppCreateBulk) SaveX(ctx context.Context) []*App

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

type AppDelete

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

AppDelete is the builder for deleting a App entity.

func (*AppDelete) Exec

func (ad *AppDelete) Exec(ctx context.Context) (int, error)

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

func (*AppDelete) ExecX

func (ad *AppDelete) ExecX(ctx context.Context) int

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

func (*AppDelete) Where

func (ad *AppDelete) Where(ps ...predicate.App) *AppDelete

Where appends a list predicates to the AppDelete builder.

type AppDeleteOne

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

AppDeleteOne is the builder for deleting a single App entity.

func (*AppDeleteOne) Exec

func (ado *AppDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*AppDeleteOne) ExecX

func (ado *AppDeleteOne) ExecX(ctx context.Context)

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

type AppGroupBy

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

AppGroupBy is the group-by builder for App entities.

func (*AppGroupBy) Aggregate

func (agb *AppGroupBy) Aggregate(fns ...AggregateFunc) *AppGroupBy

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

func (*AppGroupBy) Bool

func (agb *AppGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) BoolX

func (agb *AppGroupBy) BoolX(ctx context.Context) bool

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

func (*AppGroupBy) Bools

func (agb *AppGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) BoolsX

func (agb *AppGroupBy) BoolsX(ctx context.Context) []bool

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

func (*AppGroupBy) Float64

func (agb *AppGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) Float64X

func (agb *AppGroupBy) Float64X(ctx context.Context) float64

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

func (*AppGroupBy) Float64s

func (agb *AppGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) Float64sX

func (agb *AppGroupBy) Float64sX(ctx context.Context) []float64

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

func (*AppGroupBy) Int

func (agb *AppGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) IntX

func (agb *AppGroupBy) IntX(ctx context.Context) int

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

func (*AppGroupBy) Ints

func (agb *AppGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) IntsX

func (agb *AppGroupBy) IntsX(ctx context.Context) []int

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

func (*AppGroupBy) Scan

func (agb *AppGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*AppGroupBy) ScanX

func (agb *AppGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*AppGroupBy) String

func (agb *AppGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) StringX

func (agb *AppGroupBy) StringX(ctx context.Context) string

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

func (*AppGroupBy) Strings

func (agb *AppGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*AppGroupBy) StringsX

func (agb *AppGroupBy) StringsX(ctx context.Context) []string

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

type AppMutation

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

AppMutation represents an operation that mutates the App nodes in the graph.

func (*AppMutation) AddField

func (m *AppMutation) 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 (*AppMutation) AddOperatorID

func (m *AppMutation) AddOperatorID(i int)

AddOperatorID adds i to the "operator_id" field.

func (*AppMutation) AddStatus

func (m *AppMutation) AddStatus(i int)

AddStatus adds i to the "status" field.

func (*AppMutation) AddedEdges

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

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

func (*AppMutation) AddedField

func (m *AppMutation) 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 (*AppMutation) AddedFields

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

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

func (*AppMutation) AddedIDs

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

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

func (*AppMutation) AddedOperatorID

func (m *AppMutation) AddedOperatorID() (r int, exists bool)

AddedOperatorID returns the value that was added to the "operator_id" field in this mutation.

func (*AppMutation) AddedStatus

func (m *AppMutation) AddedStatus() (r int, exists bool)

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

func (*AppMutation) AppID

func (m *AppMutation) AppID() (r string, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*AppMutation) AppIDCleared

func (m *AppMutation) AppIDCleared() bool

AppIDCleared returns if the "app_id" field was cleared in this mutation.

func (*AppMutation) AppSecret

func (m *AppMutation) AppSecret() (r string, exists bool)

AppSecret returns the value of the "app_secret" field in the mutation.

func (*AppMutation) AppSecretCleared

func (m *AppMutation) AppSecretCleared() bool

AppSecretCleared returns if the "app_secret" field was cleared in this mutation.

func (*AppMutation) ClearAppID

func (m *AppMutation) ClearAppID()

ClearAppID clears the value of the "app_id" field.

func (*AppMutation) ClearAppSecret

func (m *AppMutation) ClearAppSecret()

ClearAppSecret clears the value of the "app_secret" field.

func (*AppMutation) ClearConf

func (m *AppMutation) ClearConf()

ClearConf clears the value of the "conf" field.

func (*AppMutation) ClearCreatedAt

func (m *AppMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*AppMutation) ClearDeleteAt

func (m *AppMutation) ClearDeleteAt()

ClearDeleteAt clears the value of the "delete_at" field.

func (*AppMutation) ClearDescription

func (m *AppMutation) ClearDescription()

ClearDescription clears the value of the "description" field.

func (*AppMutation) ClearEdge

func (m *AppMutation) 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 (*AppMutation) ClearEncryptedAppPrivateKey

func (m *AppMutation) ClearEncryptedAppPrivateKey()

ClearEncryptedAppPrivateKey clears the value of the "encrypted_app_private_key" field.

func (*AppMutation) ClearEncryptedAppPublicKey

func (m *AppMutation) ClearEncryptedAppPublicKey()

ClearEncryptedAppPublicKey clears the value of the "encrypted_app_public_key" field.

func (*AppMutation) ClearEncryptedOperatorRsaPublicKey

func (m *AppMutation) ClearEncryptedOperatorRsaPublicKey()

ClearEncryptedOperatorRsaPublicKey clears the value of the "encrypted_operator_rsa_public_key" field.

func (*AppMutation) ClearField

func (m *AppMutation) 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 (*AppMutation) ClearIPWhitelist

func (m *AppMutation) ClearIPWhitelist()

ClearIPWhitelist clears the value of the "ip_whitelist" field.

func (*AppMutation) ClearOperatorID

func (m *AppMutation) ClearOperatorID()

ClearOperatorID clears the value of the "operator_id" field.

func (*AppMutation) ClearStatus

func (m *AppMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*AppMutation) ClearTitle

func (m *AppMutation) ClearTitle()

ClearTitle clears the value of the "title" field.

func (*AppMutation) ClearUpdatedAt

func (m *AppMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AppMutation) ClearedEdges

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

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

func (*AppMutation) ClearedFields

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

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

func (AppMutation) Client

func (m AppMutation) 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 (*AppMutation) Conf

func (m *AppMutation) Conf() (r string, exists bool)

Conf returns the value of the "conf" field in the mutation.

func (*AppMutation) ConfCleared

func (m *AppMutation) ConfCleared() bool

ConfCleared returns if the "conf" field was cleared in this mutation.

func (*AppMutation) CreatedAt

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

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

func (*AppMutation) CreatedAtCleared

func (m *AppMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*AppMutation) DeleteAt

func (m *AppMutation) DeleteAt() (r time.Time, exists bool)

DeleteAt returns the value of the "delete_at" field in the mutation.

func (*AppMutation) DeleteAtCleared

func (m *AppMutation) DeleteAtCleared() bool

DeleteAtCleared returns if the "delete_at" field was cleared in this mutation.

func (*AppMutation) Description

func (m *AppMutation) Description() (r string, exists bool)

Description returns the value of the "description" field in the mutation.

func (*AppMutation) DescriptionCleared

func (m *AppMutation) DescriptionCleared() bool

DescriptionCleared returns if the "description" field was cleared in this mutation.

func (*AppMutation) EdgeCleared

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

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

func (*AppMutation) EncryptedAppPrivateKey

func (m *AppMutation) EncryptedAppPrivateKey() (r string, exists bool)

EncryptedAppPrivateKey returns the value of the "encrypted_app_private_key" field in the mutation.

func (*AppMutation) EncryptedAppPrivateKeyCleared

func (m *AppMutation) EncryptedAppPrivateKeyCleared() bool

EncryptedAppPrivateKeyCleared returns if the "encrypted_app_private_key" field was cleared in this mutation.

func (*AppMutation) EncryptedAppPublicKey

func (m *AppMutation) EncryptedAppPublicKey() (r string, exists bool)

EncryptedAppPublicKey returns the value of the "encrypted_app_public_key" field in the mutation.

func (*AppMutation) EncryptedAppPublicKeyCleared

func (m *AppMutation) EncryptedAppPublicKeyCleared() bool

EncryptedAppPublicKeyCleared returns if the "encrypted_app_public_key" field was cleared in this mutation.

func (*AppMutation) EncryptedOperatorRsaPublicKey

func (m *AppMutation) EncryptedOperatorRsaPublicKey() (r string, exists bool)

EncryptedOperatorRsaPublicKey returns the value of the "encrypted_operator_rsa_public_key" field in the mutation.

func (*AppMutation) EncryptedOperatorRsaPublicKeyCleared

func (m *AppMutation) EncryptedOperatorRsaPublicKeyCleared() bool

EncryptedOperatorRsaPublicKeyCleared returns if the "encrypted_operator_rsa_public_key" field was cleared in this mutation.

func (*AppMutation) Field

func (m *AppMutation) 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 (*AppMutation) FieldCleared

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

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

func (*AppMutation) Fields

func (m *AppMutation) 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 (*AppMutation) ID

func (m *AppMutation) ID() (id int, 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 (*AppMutation) IDs

func (m *AppMutation) IDs(ctx context.Context) ([]int, 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 (*AppMutation) IPWhitelist

func (m *AppMutation) IPWhitelist() (r []map[string]interface{}, exists bool)

IPWhitelist returns the value of the "ip_whitelist" field in the mutation.

func (*AppMutation) IPWhitelistCleared

func (m *AppMutation) IPWhitelistCleared() bool

IPWhitelistCleared returns if the "ip_whitelist" field was cleared in this mutation.

func (*AppMutation) OldAppID

func (m *AppMutation) OldAppID(ctx context.Context) (v string, err error)

OldAppID returns the old "app_id" field's value of the App entity. If the App 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 (*AppMutation) OldAppSecret

func (m *AppMutation) OldAppSecret(ctx context.Context) (v string, err error)

OldAppSecret returns the old "app_secret" field's value of the App entity. If the App 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 (*AppMutation) OldConf

func (m *AppMutation) OldConf(ctx context.Context) (v string, err error)

OldConf returns the old "conf" field's value of the App entity. If the App 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 (*AppMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the App entity. If the App 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 (*AppMutation) OldDeleteAt

func (m *AppMutation) OldDeleteAt(ctx context.Context) (v time.Time, err error)

OldDeleteAt returns the old "delete_at" field's value of the App entity. If the App 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 (*AppMutation) OldDescription

func (m *AppMutation) OldDescription(ctx context.Context) (v string, err error)

OldDescription returns the old "description" field's value of the App entity. If the App 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 (*AppMutation) OldEncryptedAppPrivateKey

func (m *AppMutation) OldEncryptedAppPrivateKey(ctx context.Context) (v string, err error)

OldEncryptedAppPrivateKey returns the old "encrypted_app_private_key" field's value of the App entity. If the App 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 (*AppMutation) OldEncryptedAppPublicKey

func (m *AppMutation) OldEncryptedAppPublicKey(ctx context.Context) (v string, err error)

OldEncryptedAppPublicKey returns the old "encrypted_app_public_key" field's value of the App entity. If the App 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 (*AppMutation) OldEncryptedOperatorRsaPublicKey

func (m *AppMutation) OldEncryptedOperatorRsaPublicKey(ctx context.Context) (v string, err error)

OldEncryptedOperatorRsaPublicKey returns the old "encrypted_operator_rsa_public_key" field's value of the App entity. If the App 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 (*AppMutation) OldField

func (m *AppMutation) 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 (*AppMutation) OldIPWhitelist

func (m *AppMutation) OldIPWhitelist(ctx context.Context) (v []map[string]interface{}, err error)

OldIPWhitelist returns the old "ip_whitelist" field's value of the App entity. If the App 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 (*AppMutation) OldOperatorID

func (m *AppMutation) OldOperatorID(ctx context.Context) (v int, err error)

OldOperatorID returns the old "operator_id" field's value of the App entity. If the App 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 (*AppMutation) OldStatus

func (m *AppMutation) OldStatus(ctx context.Context) (v int, err error)

OldStatus returns the old "status" field's value of the App entity. If the App 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 (*AppMutation) OldTitle

func (m *AppMutation) OldTitle(ctx context.Context) (v string, err error)

OldTitle returns the old "title" field's value of the App entity. If the App 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 (*AppMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the App entity. If the App 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 (*AppMutation) Op

func (m *AppMutation) Op() Op

Op returns the operation name.

func (*AppMutation) OperatorID

func (m *AppMutation) OperatorID() (r int, exists bool)

OperatorID returns the value of the "operator_id" field in the mutation.

func (*AppMutation) OperatorIDCleared

func (m *AppMutation) OperatorIDCleared() bool

OperatorIDCleared returns if the "operator_id" field was cleared in this mutation.

func (*AppMutation) RemovedEdges

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

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

func (*AppMutation) RemovedIDs

func (m *AppMutation) 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 (*AppMutation) ResetAppID

func (m *AppMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*AppMutation) ResetAppSecret

func (m *AppMutation) ResetAppSecret()

ResetAppSecret resets all changes to the "app_secret" field.

func (*AppMutation) ResetConf

func (m *AppMutation) ResetConf()

ResetConf resets all changes to the "conf" field.

func (*AppMutation) ResetCreatedAt

func (m *AppMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AppMutation) ResetDeleteAt

func (m *AppMutation) ResetDeleteAt()

ResetDeleteAt resets all changes to the "delete_at" field.

func (*AppMutation) ResetDescription

func (m *AppMutation) ResetDescription()

ResetDescription resets all changes to the "description" field.

func (*AppMutation) ResetEdge

func (m *AppMutation) 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 (*AppMutation) ResetEncryptedAppPrivateKey

func (m *AppMutation) ResetEncryptedAppPrivateKey()

ResetEncryptedAppPrivateKey resets all changes to the "encrypted_app_private_key" field.

func (*AppMutation) ResetEncryptedAppPublicKey

func (m *AppMutation) ResetEncryptedAppPublicKey()

ResetEncryptedAppPublicKey resets all changes to the "encrypted_app_public_key" field.

func (*AppMutation) ResetEncryptedOperatorRsaPublicKey

func (m *AppMutation) ResetEncryptedOperatorRsaPublicKey()

ResetEncryptedOperatorRsaPublicKey resets all changes to the "encrypted_operator_rsa_public_key" field.

func (*AppMutation) ResetField

func (m *AppMutation) 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 (*AppMutation) ResetIPWhitelist

func (m *AppMutation) ResetIPWhitelist()

ResetIPWhitelist resets all changes to the "ip_whitelist" field.

func (*AppMutation) ResetOperatorID

func (m *AppMutation) ResetOperatorID()

ResetOperatorID resets all changes to the "operator_id" field.

func (*AppMutation) ResetStatus

func (m *AppMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*AppMutation) ResetTitle

func (m *AppMutation) ResetTitle()

ResetTitle resets all changes to the "title" field.

func (*AppMutation) ResetUpdatedAt

func (m *AppMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*AppMutation) SetAppID

func (m *AppMutation) SetAppID(s string)

SetAppID sets the "app_id" field.

func (*AppMutation) SetAppSecret

func (m *AppMutation) SetAppSecret(s string)

SetAppSecret sets the "app_secret" field.

func (*AppMutation) SetConf

func (m *AppMutation) SetConf(s string)

SetConf sets the "conf" field.

func (*AppMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AppMutation) SetDeleteAt

func (m *AppMutation) SetDeleteAt(t time.Time)

SetDeleteAt sets the "delete_at" field.

func (*AppMutation) SetDescription

func (m *AppMutation) SetDescription(s string)

SetDescription sets the "description" field.

func (*AppMutation) SetEncryptedAppPrivateKey

func (m *AppMutation) SetEncryptedAppPrivateKey(s string)

SetEncryptedAppPrivateKey sets the "encrypted_app_private_key" field.

func (*AppMutation) SetEncryptedAppPublicKey

func (m *AppMutation) SetEncryptedAppPublicKey(s string)

SetEncryptedAppPublicKey sets the "encrypted_app_public_key" field.

func (*AppMutation) SetEncryptedOperatorRsaPublicKey

func (m *AppMutation) SetEncryptedOperatorRsaPublicKey(s string)

SetEncryptedOperatorRsaPublicKey sets the "encrypted_operator_rsa_public_key" field.

func (*AppMutation) SetField

func (m *AppMutation) 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 (*AppMutation) SetIPWhitelist

func (m *AppMutation) SetIPWhitelist(value []map[string]interface{})

SetIPWhitelist sets the "ip_whitelist" field.

func (*AppMutation) SetOperatorID

func (m *AppMutation) SetOperatorID(i int)

SetOperatorID sets the "operator_id" field.

func (*AppMutation) SetStatus

func (m *AppMutation) SetStatus(i int)

SetStatus sets the "status" field.

func (*AppMutation) SetTitle

func (m *AppMutation) SetTitle(s string)

SetTitle sets the "title" field.

func (*AppMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*AppMutation) Status

func (m *AppMutation) Status() (r int, exists bool)

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

func (*AppMutation) StatusCleared

func (m *AppMutation) StatusCleared() bool

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

func (*AppMutation) Title

func (m *AppMutation) Title() (r string, exists bool)

Title returns the value of the "title" field in the mutation.

func (*AppMutation) TitleCleared

func (m *AppMutation) TitleCleared() bool

TitleCleared returns if the "title" field was cleared in this mutation.

func (AppMutation) Tx

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

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

func (*AppMutation) Type

func (m *AppMutation) Type() string

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

func (*AppMutation) UpdatedAt

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

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

func (*AppMutation) UpdatedAtCleared

func (m *AppMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*AppMutation) Where

func (m *AppMutation) Where(ps ...predicate.App)

Where appends a list predicates to the AppMutation builder.

type AppQuery

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

AppQuery is the builder for querying App entities.

func (*AppQuery) All

func (aq *AppQuery) All(ctx context.Context) ([]*App, error)

All executes the query and returns a list of Apps.

func (*AppQuery) AllX

func (aq *AppQuery) AllX(ctx context.Context) []*App

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

func (*AppQuery) Clone

func (aq *AppQuery) Clone() *AppQuery

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

func (*AppQuery) Count

func (aq *AppQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*AppQuery) CountX

func (aq *AppQuery) CountX(ctx context.Context) int

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

func (*AppQuery) Exist

func (aq *AppQuery) Exist(ctx context.Context) (bool, error)

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

func (*AppQuery) ExistX

func (aq *AppQuery) ExistX(ctx context.Context) bool

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

func (*AppQuery) First

func (aq *AppQuery) First(ctx context.Context) (*App, error)

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

func (*AppQuery) FirstID

func (aq *AppQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*AppQuery) FirstIDX

func (aq *AppQuery) FirstIDX(ctx context.Context) int

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

func (*AppQuery) FirstX

func (aq *AppQuery) FirstX(ctx context.Context) *App

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

func (*AppQuery) GroupBy

func (aq *AppQuery) GroupBy(field string, fields ...string) *AppGroupBy

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.App.Query().
	GroupBy(app.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AppQuery) IDs

func (aq *AppQuery) IDs(ctx context.Context) ([]int, error)

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

func (*AppQuery) IDsX

func (aq *AppQuery) IDsX(ctx context.Context) []int

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

func (*AppQuery) Limit

func (aq *AppQuery) Limit(limit int) *AppQuery

Limit adds a limit step to the query.

func (*AppQuery) Offset

func (aq *AppQuery) Offset(offset int) *AppQuery

Offset adds an offset step to the query.

func (*AppQuery) Only

func (aq *AppQuery) Only(ctx context.Context) (*App, error)

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

func (*AppQuery) OnlyID

func (aq *AppQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*AppQuery) OnlyIDX

func (aq *AppQuery) OnlyIDX(ctx context.Context) int

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

func (*AppQuery) OnlyX

func (aq *AppQuery) OnlyX(ctx context.Context) *App

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

func (*AppQuery) Order

func (aq *AppQuery) Order(o ...OrderFunc) *AppQuery

Order adds an order step to the query.

func (*AppQuery) Select

func (aq *AppQuery) Select(fields ...string) *AppSelect

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.App.Query().
	Select(app.FieldCreatedAt).
	Scan(ctx, &v)

func (*AppQuery) Unique

func (aq *AppQuery) Unique(unique bool) *AppQuery

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 (*AppQuery) Where

func (aq *AppQuery) Where(ps ...predicate.App) *AppQuery

Where adds a new predicate for the AppQuery builder.

type AppSelect

type AppSelect struct {
	*AppQuery
	// contains filtered or unexported fields
}

AppSelect is the builder for selecting fields of App entities.

func (*AppSelect) Bool

func (as *AppSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*AppSelect) BoolX

func (as *AppSelect) BoolX(ctx context.Context) bool

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

func (*AppSelect) Bools

func (as *AppSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*AppSelect) BoolsX

func (as *AppSelect) BoolsX(ctx context.Context) []bool

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

func (*AppSelect) Float64

func (as *AppSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*AppSelect) Float64X

func (as *AppSelect) Float64X(ctx context.Context) float64

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

func (*AppSelect) Float64s

func (as *AppSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*AppSelect) Float64sX

func (as *AppSelect) Float64sX(ctx context.Context) []float64

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

func (*AppSelect) Int

func (as *AppSelect) Int(ctx context.Context) (_ int, err error)

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

func (*AppSelect) IntX

func (as *AppSelect) IntX(ctx context.Context) int

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

func (*AppSelect) Ints

func (as *AppSelect) Ints(ctx context.Context) ([]int, error)

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

func (*AppSelect) IntsX

func (as *AppSelect) IntsX(ctx context.Context) []int

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

func (*AppSelect) Scan

func (as *AppSelect) Scan(ctx context.Context, v interface{}) error

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

func (*AppSelect) ScanX

func (as *AppSelect) ScanX(ctx context.Context, v interface{})

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

func (*AppSelect) String

func (as *AppSelect) String(ctx context.Context) (_ string, err error)

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

func (*AppSelect) StringX

func (as *AppSelect) StringX(ctx context.Context) string

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

func (*AppSelect) Strings

func (as *AppSelect) Strings(ctx context.Context) ([]string, error)

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

func (*AppSelect) StringsX

func (as *AppSelect) StringsX(ctx context.Context) []string

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

type AppUpdate

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

AppUpdate is the builder for updating App entities.

func (*AppUpdate) AddOperatorID

func (au *AppUpdate) AddOperatorID(i int) *AppUpdate

AddOperatorID adds i to the "operator_id" field.

func (*AppUpdate) AddStatus

func (au *AppUpdate) AddStatus(i int) *AppUpdate

AddStatus adds i to the "status" field.

func (*AppUpdate) ClearAppID

func (au *AppUpdate) ClearAppID() *AppUpdate

ClearAppID clears the value of the "app_id" field.

func (*AppUpdate) ClearAppSecret

func (au *AppUpdate) ClearAppSecret() *AppUpdate

ClearAppSecret clears the value of the "app_secret" field.

func (*AppUpdate) ClearConf

func (au *AppUpdate) ClearConf() *AppUpdate

ClearConf clears the value of the "conf" field.

func (*AppUpdate) ClearDeleteAt

func (au *AppUpdate) ClearDeleteAt() *AppUpdate

ClearDeleteAt clears the value of the "delete_at" field.

func (*AppUpdate) ClearDescription

func (au *AppUpdate) ClearDescription() *AppUpdate

ClearDescription clears the value of the "description" field.

func (*AppUpdate) ClearEncryptedAppPrivateKey

func (au *AppUpdate) ClearEncryptedAppPrivateKey() *AppUpdate

ClearEncryptedAppPrivateKey clears the value of the "encrypted_app_private_key" field.

func (*AppUpdate) ClearEncryptedAppPublicKey

func (au *AppUpdate) ClearEncryptedAppPublicKey() *AppUpdate

ClearEncryptedAppPublicKey clears the value of the "encrypted_app_public_key" field.

func (*AppUpdate) ClearEncryptedOperatorRsaPublicKey

func (au *AppUpdate) ClearEncryptedOperatorRsaPublicKey() *AppUpdate

ClearEncryptedOperatorRsaPublicKey clears the value of the "encrypted_operator_rsa_public_key" field.

func (*AppUpdate) ClearIPWhitelist

func (au *AppUpdate) ClearIPWhitelist() *AppUpdate

ClearIPWhitelist clears the value of the "ip_whitelist" field.

func (*AppUpdate) ClearOperatorID

func (au *AppUpdate) ClearOperatorID() *AppUpdate

ClearOperatorID clears the value of the "operator_id" field.

func (*AppUpdate) ClearStatus

func (au *AppUpdate) ClearStatus() *AppUpdate

ClearStatus clears the value of the "status" field.

func (*AppUpdate) ClearTitle

func (au *AppUpdate) ClearTitle() *AppUpdate

ClearTitle clears the value of the "title" field.

func (*AppUpdate) ClearUpdatedAt

func (au *AppUpdate) ClearUpdatedAt() *AppUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AppUpdate) Exec

func (au *AppUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*AppUpdate) ExecX

func (au *AppUpdate) ExecX(ctx context.Context)

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

func (*AppUpdate) Mutation

func (au *AppUpdate) Mutation() *AppMutation

Mutation returns the AppMutation object of the builder.

func (*AppUpdate) Save

func (au *AppUpdate) Save(ctx context.Context) (int, error)

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

func (*AppUpdate) SaveX

func (au *AppUpdate) SaveX(ctx context.Context) int

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

func (*AppUpdate) SetAppID

func (au *AppUpdate) SetAppID(s string) *AppUpdate

SetAppID sets the "app_id" field.

func (*AppUpdate) SetAppSecret

func (au *AppUpdate) SetAppSecret(s string) *AppUpdate

SetAppSecret sets the "app_secret" field.

func (*AppUpdate) SetConf

func (au *AppUpdate) SetConf(s string) *AppUpdate

SetConf sets the "conf" field.

func (*AppUpdate) SetDeleteAt

func (au *AppUpdate) SetDeleteAt(t time.Time) *AppUpdate

SetDeleteAt sets the "delete_at" field.

func (*AppUpdate) SetDescription

func (au *AppUpdate) SetDescription(s string) *AppUpdate

SetDescription sets the "description" field.

func (*AppUpdate) SetEncryptedAppPrivateKey

func (au *AppUpdate) SetEncryptedAppPrivateKey(s string) *AppUpdate

SetEncryptedAppPrivateKey sets the "encrypted_app_private_key" field.

func (*AppUpdate) SetEncryptedAppPublicKey

func (au *AppUpdate) SetEncryptedAppPublicKey(s string) *AppUpdate

SetEncryptedAppPublicKey sets the "encrypted_app_public_key" field.

func (*AppUpdate) SetEncryptedOperatorRsaPublicKey

func (au *AppUpdate) SetEncryptedOperatorRsaPublicKey(s string) *AppUpdate

SetEncryptedOperatorRsaPublicKey sets the "encrypted_operator_rsa_public_key" field.

func (*AppUpdate) SetIPWhitelist

func (au *AppUpdate) SetIPWhitelist(m []map[string]interface{}) *AppUpdate

SetIPWhitelist sets the "ip_whitelist" field.

func (*AppUpdate) SetNillableAppID

func (au *AppUpdate) SetNillableAppID(s *string) *AppUpdate

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*AppUpdate) SetNillableAppSecret

func (au *AppUpdate) SetNillableAppSecret(s *string) *AppUpdate

SetNillableAppSecret sets the "app_secret" field if the given value is not nil.

func (*AppUpdate) SetNillableConf

func (au *AppUpdate) SetNillableConf(s *string) *AppUpdate

SetNillableConf sets the "conf" field if the given value is not nil.

func (*AppUpdate) SetNillableDeleteAt

func (au *AppUpdate) SetNillableDeleteAt(t *time.Time) *AppUpdate

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*AppUpdate) SetNillableDescription

func (au *AppUpdate) SetNillableDescription(s *string) *AppUpdate

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AppUpdate) SetNillableEncryptedAppPrivateKey

func (au *AppUpdate) SetNillableEncryptedAppPrivateKey(s *string) *AppUpdate

SetNillableEncryptedAppPrivateKey sets the "encrypted_app_private_key" field if the given value is not nil.

func (*AppUpdate) SetNillableEncryptedAppPublicKey

func (au *AppUpdate) SetNillableEncryptedAppPublicKey(s *string) *AppUpdate

SetNillableEncryptedAppPublicKey sets the "encrypted_app_public_key" field if the given value is not nil.

func (*AppUpdate) SetNillableEncryptedOperatorRsaPublicKey

func (au *AppUpdate) SetNillableEncryptedOperatorRsaPublicKey(s *string) *AppUpdate

SetNillableEncryptedOperatorRsaPublicKey sets the "encrypted_operator_rsa_public_key" field if the given value is not nil.

func (*AppUpdate) SetNillableOperatorID

func (au *AppUpdate) SetNillableOperatorID(i *int) *AppUpdate

SetNillableOperatorID sets the "operator_id" field if the given value is not nil.

func (*AppUpdate) SetNillableStatus

func (au *AppUpdate) SetNillableStatus(i *int) *AppUpdate

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

func (*AppUpdate) SetNillableTitle

func (au *AppUpdate) SetNillableTitle(s *string) *AppUpdate

SetNillableTitle sets the "title" field if the given value is not nil.

func (*AppUpdate) SetOperatorID

func (au *AppUpdate) SetOperatorID(i int) *AppUpdate

SetOperatorID sets the "operator_id" field.

func (*AppUpdate) SetStatus

func (au *AppUpdate) SetStatus(i int) *AppUpdate

SetStatus sets the "status" field.

func (*AppUpdate) SetTitle

func (au *AppUpdate) SetTitle(s string) *AppUpdate

SetTitle sets the "title" field.

func (*AppUpdate) SetUpdatedAt

func (au *AppUpdate) SetUpdatedAt(t time.Time) *AppUpdate

SetUpdatedAt sets the "updated_at" field.

func (*AppUpdate) Where

func (au *AppUpdate) Where(ps ...predicate.App) *AppUpdate

Where appends a list predicates to the AppUpdate builder.

type AppUpdateOne

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

AppUpdateOne is the builder for updating a single App entity.

func (*AppUpdateOne) AddOperatorID

func (auo *AppUpdateOne) AddOperatorID(i int) *AppUpdateOne

AddOperatorID adds i to the "operator_id" field.

func (*AppUpdateOne) AddStatus

func (auo *AppUpdateOne) AddStatus(i int) *AppUpdateOne

AddStatus adds i to the "status" field.

func (*AppUpdateOne) ClearAppID

func (auo *AppUpdateOne) ClearAppID() *AppUpdateOne

ClearAppID clears the value of the "app_id" field.

func (*AppUpdateOne) ClearAppSecret

func (auo *AppUpdateOne) ClearAppSecret() *AppUpdateOne

ClearAppSecret clears the value of the "app_secret" field.

func (*AppUpdateOne) ClearConf

func (auo *AppUpdateOne) ClearConf() *AppUpdateOne

ClearConf clears the value of the "conf" field.

func (*AppUpdateOne) ClearDeleteAt

func (auo *AppUpdateOne) ClearDeleteAt() *AppUpdateOne

ClearDeleteAt clears the value of the "delete_at" field.

func (*AppUpdateOne) ClearDescription

func (auo *AppUpdateOne) ClearDescription() *AppUpdateOne

ClearDescription clears the value of the "description" field.

func (*AppUpdateOne) ClearEncryptedAppPrivateKey

func (auo *AppUpdateOne) ClearEncryptedAppPrivateKey() *AppUpdateOne

ClearEncryptedAppPrivateKey clears the value of the "encrypted_app_private_key" field.

func (*AppUpdateOne) ClearEncryptedAppPublicKey

func (auo *AppUpdateOne) ClearEncryptedAppPublicKey() *AppUpdateOne

ClearEncryptedAppPublicKey clears the value of the "encrypted_app_public_key" field.

func (*AppUpdateOne) ClearEncryptedOperatorRsaPublicKey

func (auo *AppUpdateOne) ClearEncryptedOperatorRsaPublicKey() *AppUpdateOne

ClearEncryptedOperatorRsaPublicKey clears the value of the "encrypted_operator_rsa_public_key" field.

func (*AppUpdateOne) ClearIPWhitelist

func (auo *AppUpdateOne) ClearIPWhitelist() *AppUpdateOne

ClearIPWhitelist clears the value of the "ip_whitelist" field.

func (*AppUpdateOne) ClearOperatorID

func (auo *AppUpdateOne) ClearOperatorID() *AppUpdateOne

ClearOperatorID clears the value of the "operator_id" field.

func (*AppUpdateOne) ClearStatus

func (auo *AppUpdateOne) ClearStatus() *AppUpdateOne

ClearStatus clears the value of the "status" field.

func (*AppUpdateOne) ClearTitle

func (auo *AppUpdateOne) ClearTitle() *AppUpdateOne

ClearTitle clears the value of the "title" field.

func (*AppUpdateOne) ClearUpdatedAt

func (auo *AppUpdateOne) ClearUpdatedAt() *AppUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*AppUpdateOne) Exec

func (auo *AppUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*AppUpdateOne) ExecX

func (auo *AppUpdateOne) ExecX(ctx context.Context)

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

func (*AppUpdateOne) Mutation

func (auo *AppUpdateOne) Mutation() *AppMutation

Mutation returns the AppMutation object of the builder.

func (*AppUpdateOne) Save

func (auo *AppUpdateOne) Save(ctx context.Context) (*App, error)

Save executes the query and returns the updated App entity.

func (*AppUpdateOne) SaveX

func (auo *AppUpdateOne) SaveX(ctx context.Context) *App

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

func (*AppUpdateOne) Select

func (auo *AppUpdateOne) Select(field string, fields ...string) *AppUpdateOne

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

func (*AppUpdateOne) SetAppID

func (auo *AppUpdateOne) SetAppID(s string) *AppUpdateOne

SetAppID sets the "app_id" field.

func (*AppUpdateOne) SetAppSecret

func (auo *AppUpdateOne) SetAppSecret(s string) *AppUpdateOne

SetAppSecret sets the "app_secret" field.

func (*AppUpdateOne) SetConf

func (auo *AppUpdateOne) SetConf(s string) *AppUpdateOne

SetConf sets the "conf" field.

func (*AppUpdateOne) SetDeleteAt

func (auo *AppUpdateOne) SetDeleteAt(t time.Time) *AppUpdateOne

SetDeleteAt sets the "delete_at" field.

func (*AppUpdateOne) SetDescription

func (auo *AppUpdateOne) SetDescription(s string) *AppUpdateOne

SetDescription sets the "description" field.

func (*AppUpdateOne) SetEncryptedAppPrivateKey

func (auo *AppUpdateOne) SetEncryptedAppPrivateKey(s string) *AppUpdateOne

SetEncryptedAppPrivateKey sets the "encrypted_app_private_key" field.

func (*AppUpdateOne) SetEncryptedAppPublicKey

func (auo *AppUpdateOne) SetEncryptedAppPublicKey(s string) *AppUpdateOne

SetEncryptedAppPublicKey sets the "encrypted_app_public_key" field.

func (*AppUpdateOne) SetEncryptedOperatorRsaPublicKey

func (auo *AppUpdateOne) SetEncryptedOperatorRsaPublicKey(s string) *AppUpdateOne

SetEncryptedOperatorRsaPublicKey sets the "encrypted_operator_rsa_public_key" field.

func (*AppUpdateOne) SetIPWhitelist

func (auo *AppUpdateOne) SetIPWhitelist(m []map[string]interface{}) *AppUpdateOne

SetIPWhitelist sets the "ip_whitelist" field.

func (*AppUpdateOne) SetNillableAppID

func (auo *AppUpdateOne) SetNillableAppID(s *string) *AppUpdateOne

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*AppUpdateOne) SetNillableAppSecret

func (auo *AppUpdateOne) SetNillableAppSecret(s *string) *AppUpdateOne

SetNillableAppSecret sets the "app_secret" field if the given value is not nil.

func (*AppUpdateOne) SetNillableConf

func (auo *AppUpdateOne) SetNillableConf(s *string) *AppUpdateOne

SetNillableConf sets the "conf" field if the given value is not nil.

func (*AppUpdateOne) SetNillableDeleteAt

func (auo *AppUpdateOne) SetNillableDeleteAt(t *time.Time) *AppUpdateOne

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*AppUpdateOne) SetNillableDescription

func (auo *AppUpdateOne) SetNillableDescription(s *string) *AppUpdateOne

SetNillableDescription sets the "description" field if the given value is not nil.

func (*AppUpdateOne) SetNillableEncryptedAppPrivateKey

func (auo *AppUpdateOne) SetNillableEncryptedAppPrivateKey(s *string) *AppUpdateOne

SetNillableEncryptedAppPrivateKey sets the "encrypted_app_private_key" field if the given value is not nil.

func (*AppUpdateOne) SetNillableEncryptedAppPublicKey

func (auo *AppUpdateOne) SetNillableEncryptedAppPublicKey(s *string) *AppUpdateOne

SetNillableEncryptedAppPublicKey sets the "encrypted_app_public_key" field if the given value is not nil.

func (*AppUpdateOne) SetNillableEncryptedOperatorRsaPublicKey

func (auo *AppUpdateOne) SetNillableEncryptedOperatorRsaPublicKey(s *string) *AppUpdateOne

SetNillableEncryptedOperatorRsaPublicKey sets the "encrypted_operator_rsa_public_key" field if the given value is not nil.

func (*AppUpdateOne) SetNillableOperatorID

func (auo *AppUpdateOne) SetNillableOperatorID(i *int) *AppUpdateOne

SetNillableOperatorID sets the "operator_id" field if the given value is not nil.

func (*AppUpdateOne) SetNillableStatus

func (auo *AppUpdateOne) SetNillableStatus(i *int) *AppUpdateOne

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

func (*AppUpdateOne) SetNillableTitle

func (auo *AppUpdateOne) SetNillableTitle(s *string) *AppUpdateOne

SetNillableTitle sets the "title" field if the given value is not nil.

func (*AppUpdateOne) SetOperatorID

func (auo *AppUpdateOne) SetOperatorID(i int) *AppUpdateOne

SetOperatorID sets the "operator_id" field.

func (*AppUpdateOne) SetStatus

func (auo *AppUpdateOne) SetStatus(i int) *AppUpdateOne

SetStatus sets the "status" field.

func (*AppUpdateOne) SetTitle

func (auo *AppUpdateOne) SetTitle(s string) *AppUpdateOne

SetTitle sets the "title" field.

func (*AppUpdateOne) SetUpdatedAt

func (auo *AppUpdateOne) SetUpdatedAt(t time.Time) *AppUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Apps

type Apps []*App

Apps is a parsable slice of App.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// App is the client for interacting with the App builders.
	App *AppClient
	// Media is the client for interacting with the Media builders.
	Media *MediaClient
	// Operator is the client for interacting with the Operator builders.
	Operator *OperatorClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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().
	App.
	Query().
	Count(ctx)

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 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 Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type Media

type Media struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeleteAt holds the value of the "delete_at" field.
	DeleteAt time.Time `json:"delete_at,omitempty"`
	// Hash holds the value of the "hash" field.
	Hash string `json:"hash,omitempty"`
	// UserID holds the value of the "user_id" field.
	// 本系统用户id
	UserID int `json:"user_id,omitempty"`
	// AppID holds the value of the "app_id" field.
	AppID int `json:"app_id,omitempty"`
	// Sn holds the value of the "sn" field.
	Sn string `json:"sn,omitempty"`
	// OrgFileName holds the value of the "org_file_name" field.
	// 原始文件名
	OrgFileName string `json:"org_file_name,omitempty"`
	// FileName holds the value of the "file_name" field.
	// 保存的文件名称
	FileName string `json:"file_name,omitempty"`
	// Size holds the value of the "size" field.
	// 尺寸信息
	Size schema.MediaSize `json:"size,omitempty"`
	// Mime holds the value of the "mime" field.
	// 文件mime
	Mime string `json:"mime,omitempty"`
	// Ext holds the value of the "ext" field.
	// 扩展名
	Ext string `json:"ext,omitempty"`
	// RefCount holds the value of the "ref_count" field.
	// 引用计数
	RefCount int `json:"ref_count,omitempty"`
	// Level holds the value of the "level" field.
	// 资源的级别 普通, 敏感资料
	Level int `json:"level,omitempty"`
	// Type holds the value of the "type" field.
	Type int `json:"type,omitempty"`
	// Status holds the value of the "status" field.
	Status int `json:"status,omitempty"`
	// ReasonType holds the value of the "reason_type" field.
	ReasonType int `json:"reason_type,omitempty"`
	// SavePath holds the value of the "save_path" field.
	// 保存路径
	SavePath string `json:"save_path,omitempty"`
	// FullPath holds the value of the "full_path" field.
	FullPath string `json:"full_path,omitempty"`
	// IsEncrypted holds the value of the "is_encrypted" field.
	IsEncrypted bool `json:"is_encrypted,omitempty"`
	// Reason holds the value of the "reason" field.
	// 图片被强制操作或审核失败的理由/原因
	Reason string `json:"reason,omitempty"`
	// OutUserID holds the value of the "out_user_id" field.
	// 外部用户id
	OutUserID int64 `json:"out_user_id,omitempty"`
	// CompanyID holds the value of the "company_id" field.
	// 公司id
	CompanyID int64 `json:"company_id,omitempty"`
	// contains filtered or unexported fields
}

Media is the model entity for the Media schema.

func (*Media) String

func (m *Media) String() string

String implements the fmt.Stringer.

func (*Media) Unwrap

func (m *Media) Unwrap() *Media

Unwrap unwraps the Media 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 (*Media) Update

func (m *Media) Update() *MediaUpdateOne

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

type MediaClient

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

MediaClient is a client for the Media schema.

func NewMediaClient

func NewMediaClient(c config) *MediaClient

NewMediaClient returns a client for the Media from the given config.

func (*MediaClient) Create

func (c *MediaClient) Create() *MediaCreate

Create returns a create builder for Media.

func (*MediaClient) CreateBulk

func (c *MediaClient) CreateBulk(builders ...*MediaCreate) *MediaCreateBulk

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

func (*MediaClient) Delete

func (c *MediaClient) Delete() *MediaDelete

Delete returns a delete builder for Media.

func (*MediaClient) DeleteOne

func (c *MediaClient) DeleteOne(m *Media) *MediaDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*MediaClient) DeleteOneID

func (c *MediaClient) DeleteOneID(id int) *MediaDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*MediaClient) Get

func (c *MediaClient) Get(ctx context.Context, id int) (*Media, error)

Get returns a Media entity by its id.

func (*MediaClient) GetX

func (c *MediaClient) GetX(ctx context.Context, id int) *Media

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

func (*MediaClient) Hooks

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

Hooks returns the client hooks.

func (*MediaClient) Query

func (c *MediaClient) Query() *MediaQuery

Query returns a query builder for Media.

func (*MediaClient) Update

func (c *MediaClient) Update() *MediaUpdate

Update returns an update builder for Media.

func (*MediaClient) UpdateOne

func (c *MediaClient) UpdateOne(m *Media) *MediaUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MediaClient) UpdateOneID

func (c *MediaClient) UpdateOneID(id int) *MediaUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MediaClient) Use

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

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

type MediaCreate

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

MediaCreate is the builder for creating a Media entity.

func (*MediaCreate) Exec

func (mc *MediaCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*MediaCreate) ExecX

func (mc *MediaCreate) ExecX(ctx context.Context)

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

func (*MediaCreate) Mutation

func (mc *MediaCreate) Mutation() *MediaMutation

Mutation returns the MediaMutation object of the builder.

func (*MediaCreate) Save

func (mc *MediaCreate) Save(ctx context.Context) (*Media, error)

Save creates the Media in the database.

func (*MediaCreate) SaveX

func (mc *MediaCreate) SaveX(ctx context.Context) *Media

SaveX calls Save and panics if Save returns an error.

func (*MediaCreate) SetAppID

func (mc *MediaCreate) SetAppID(i int) *MediaCreate

SetAppID sets the "app_id" field.

func (*MediaCreate) SetCompanyID

func (mc *MediaCreate) SetCompanyID(i int64) *MediaCreate

SetCompanyID sets the "company_id" field.

func (*MediaCreate) SetCreatedAt

func (mc *MediaCreate) SetCreatedAt(t time.Time) *MediaCreate

SetCreatedAt sets the "created_at" field.

func (*MediaCreate) SetDeleteAt

func (mc *MediaCreate) SetDeleteAt(t time.Time) *MediaCreate

SetDeleteAt sets the "delete_at" field.

func (*MediaCreate) SetExt

func (mc *MediaCreate) SetExt(s string) *MediaCreate

SetExt sets the "ext" field.

func (*MediaCreate) SetFileName

func (mc *MediaCreate) SetFileName(s string) *MediaCreate

SetFileName sets the "file_name" field.

func (*MediaCreate) SetFullPath

func (mc *MediaCreate) SetFullPath(s string) *MediaCreate

SetFullPath sets the "full_path" field.

func (*MediaCreate) SetHash

func (mc *MediaCreate) SetHash(s string) *MediaCreate

SetHash sets the "hash" field.

func (*MediaCreate) SetIsEncrypted

func (mc *MediaCreate) SetIsEncrypted(b bool) *MediaCreate

SetIsEncrypted sets the "is_encrypted" field.

func (*MediaCreate) SetLevel

func (mc *MediaCreate) SetLevel(i int) *MediaCreate

SetLevel sets the "level" field.

func (*MediaCreate) SetMime

func (mc *MediaCreate) SetMime(s string) *MediaCreate

SetMime sets the "mime" field.

func (*MediaCreate) SetNillableAppID

func (mc *MediaCreate) SetNillableAppID(i *int) *MediaCreate

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*MediaCreate) SetNillableCompanyID

func (mc *MediaCreate) SetNillableCompanyID(i *int64) *MediaCreate

SetNillableCompanyID sets the "company_id" field if the given value is not nil.

func (*MediaCreate) SetNillableCreatedAt

func (mc *MediaCreate) SetNillableCreatedAt(t *time.Time) *MediaCreate

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

func (*MediaCreate) SetNillableDeleteAt

func (mc *MediaCreate) SetNillableDeleteAt(t *time.Time) *MediaCreate

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*MediaCreate) SetNillableExt

func (mc *MediaCreate) SetNillableExt(s *string) *MediaCreate

SetNillableExt sets the "ext" field if the given value is not nil.

func (*MediaCreate) SetNillableFullPath

func (mc *MediaCreate) SetNillableFullPath(s *string) *MediaCreate

SetNillableFullPath sets the "full_path" field if the given value is not nil.

func (*MediaCreate) SetNillableHash

func (mc *MediaCreate) SetNillableHash(s *string) *MediaCreate

SetNillableHash sets the "hash" field if the given value is not nil.

func (*MediaCreate) SetNillableIsEncrypted

func (mc *MediaCreate) SetNillableIsEncrypted(b *bool) *MediaCreate

SetNillableIsEncrypted sets the "is_encrypted" field if the given value is not nil.

func (*MediaCreate) SetNillableLevel

func (mc *MediaCreate) SetNillableLevel(i *int) *MediaCreate

SetNillableLevel sets the "level" field if the given value is not nil.

func (*MediaCreate) SetNillableMime

func (mc *MediaCreate) SetNillableMime(s *string) *MediaCreate

SetNillableMime sets the "mime" field if the given value is not nil.

func (*MediaCreate) SetNillableOutUserID

func (mc *MediaCreate) SetNillableOutUserID(i *int64) *MediaCreate

SetNillableOutUserID sets the "out_user_id" field if the given value is not nil.

func (*MediaCreate) SetNillableReason

func (mc *MediaCreate) SetNillableReason(s *string) *MediaCreate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*MediaCreate) SetNillableReasonType

func (mc *MediaCreate) SetNillableReasonType(i *int) *MediaCreate

SetNillableReasonType sets the "reason_type" field if the given value is not nil.

func (*MediaCreate) SetNillableRefCount

func (mc *MediaCreate) SetNillableRefCount(i *int) *MediaCreate

SetNillableRefCount sets the "ref_count" field if the given value is not nil.

func (*MediaCreate) SetNillableSavePath

func (mc *MediaCreate) SetNillableSavePath(s *string) *MediaCreate

SetNillableSavePath sets the "save_path" field if the given value is not nil.

func (*MediaCreate) SetNillableSize

func (mc *MediaCreate) SetNillableSize(ss *schema.MediaSize) *MediaCreate

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

func (*MediaCreate) SetNillableSn

func (mc *MediaCreate) SetNillableSn(s *string) *MediaCreate

SetNillableSn sets the "sn" field if the given value is not nil.

func (*MediaCreate) SetNillableStatus

func (mc *MediaCreate) SetNillableStatus(i *int) *MediaCreate

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

func (*MediaCreate) SetNillableType

func (mc *MediaCreate) SetNillableType(i *int) *MediaCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*MediaCreate) SetNillableUpdatedAt

func (mc *MediaCreate) SetNillableUpdatedAt(t *time.Time) *MediaCreate

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

func (*MediaCreate) SetNillableUserID

func (mc *MediaCreate) SetNillableUserID(i *int) *MediaCreate

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

func (*MediaCreate) SetOrgFileName

func (mc *MediaCreate) SetOrgFileName(s string) *MediaCreate

SetOrgFileName sets the "org_file_name" field.

func (*MediaCreate) SetOutUserID

func (mc *MediaCreate) SetOutUserID(i int64) *MediaCreate

SetOutUserID sets the "out_user_id" field.

func (*MediaCreate) SetReason

func (mc *MediaCreate) SetReason(s string) *MediaCreate

SetReason sets the "reason" field.

func (*MediaCreate) SetReasonType

func (mc *MediaCreate) SetReasonType(i int) *MediaCreate

SetReasonType sets the "reason_type" field.

func (*MediaCreate) SetRefCount

func (mc *MediaCreate) SetRefCount(i int) *MediaCreate

SetRefCount sets the "ref_count" field.

func (*MediaCreate) SetSavePath

func (mc *MediaCreate) SetSavePath(s string) *MediaCreate

SetSavePath sets the "save_path" field.

func (*MediaCreate) SetSize

func (mc *MediaCreate) SetSize(ss schema.MediaSize) *MediaCreate

SetSize sets the "size" field.

func (*MediaCreate) SetSn

func (mc *MediaCreate) SetSn(s string) *MediaCreate

SetSn sets the "sn" field.

func (*MediaCreate) SetStatus

func (mc *MediaCreate) SetStatus(i int) *MediaCreate

SetStatus sets the "status" field.

func (*MediaCreate) SetType

func (mc *MediaCreate) SetType(i int) *MediaCreate

SetType sets the "type" field.

func (*MediaCreate) SetUpdatedAt

func (mc *MediaCreate) SetUpdatedAt(t time.Time) *MediaCreate

SetUpdatedAt sets the "updated_at" field.

func (*MediaCreate) SetUserID

func (mc *MediaCreate) SetUserID(i int) *MediaCreate

SetUserID sets the "user_id" field.

type MediaCreateBulk

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

MediaCreateBulk is the builder for creating many Media entities in bulk.

func (*MediaCreateBulk) Exec

func (mcb *MediaCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*MediaCreateBulk) ExecX

func (mcb *MediaCreateBulk) ExecX(ctx context.Context)

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

func (*MediaCreateBulk) Save

func (mcb *MediaCreateBulk) Save(ctx context.Context) ([]*Media, error)

Save creates the Media entities in the database.

func (*MediaCreateBulk) SaveX

func (mcb *MediaCreateBulk) SaveX(ctx context.Context) []*Media

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

type MediaDelete

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

MediaDelete is the builder for deleting a Media entity.

func (*MediaDelete) Exec

func (md *MediaDelete) Exec(ctx context.Context) (int, error)

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

func (*MediaDelete) ExecX

func (md *MediaDelete) ExecX(ctx context.Context) int

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

func (*MediaDelete) Where

func (md *MediaDelete) Where(ps ...predicate.Media) *MediaDelete

Where appends a list predicates to the MediaDelete builder.

type MediaDeleteOne

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

MediaDeleteOne is the builder for deleting a single Media entity.

func (*MediaDeleteOne) Exec

func (mdo *MediaDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*MediaDeleteOne) ExecX

func (mdo *MediaDeleteOne) ExecX(ctx context.Context)

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

type MediaGroupBy

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

MediaGroupBy is the group-by builder for Media entities.

func (*MediaGroupBy) Aggregate

func (mgb *MediaGroupBy) Aggregate(fns ...AggregateFunc) *MediaGroupBy

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

func (*MediaGroupBy) Bool

func (mgb *MediaGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MediaGroupBy) BoolX

func (mgb *MediaGroupBy) BoolX(ctx context.Context) bool

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

func (*MediaGroupBy) Bools

func (mgb *MediaGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*MediaGroupBy) BoolsX

func (mgb *MediaGroupBy) BoolsX(ctx context.Context) []bool

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

func (*MediaGroupBy) Float64

func (mgb *MediaGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MediaGroupBy) Float64X

func (mgb *MediaGroupBy) Float64X(ctx context.Context) float64

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

func (*MediaGroupBy) Float64s

func (mgb *MediaGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*MediaGroupBy) Float64sX

func (mgb *MediaGroupBy) Float64sX(ctx context.Context) []float64

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

func (*MediaGroupBy) Int

func (mgb *MediaGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MediaGroupBy) IntX

func (mgb *MediaGroupBy) IntX(ctx context.Context) int

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

func (*MediaGroupBy) Ints

func (mgb *MediaGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*MediaGroupBy) IntsX

func (mgb *MediaGroupBy) IntsX(ctx context.Context) []int

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

func (*MediaGroupBy) Scan

func (mgb *MediaGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*MediaGroupBy) ScanX

func (mgb *MediaGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*MediaGroupBy) String

func (mgb *MediaGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*MediaGroupBy) StringX

func (mgb *MediaGroupBy) StringX(ctx context.Context) string

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

func (*MediaGroupBy) Strings

func (mgb *MediaGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*MediaGroupBy) StringsX

func (mgb *MediaGroupBy) StringsX(ctx context.Context) []string

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

type MediaMutation

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

MediaMutation represents an operation that mutates the Media nodes in the graph.

func (*MediaMutation) AddAppID

func (m *MediaMutation) AddAppID(i int)

AddAppID adds i to the "app_id" field.

func (*MediaMutation) AddCompanyID

func (m *MediaMutation) AddCompanyID(i int64)

AddCompanyID adds i to the "company_id" field.

func (*MediaMutation) AddField

func (m *MediaMutation) 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 (*MediaMutation) AddLevel

func (m *MediaMutation) AddLevel(i int)

AddLevel adds i to the "level" field.

func (*MediaMutation) AddOutUserID

func (m *MediaMutation) AddOutUserID(i int64)

AddOutUserID adds i to the "out_user_id" field.

func (*MediaMutation) AddReasonType

func (m *MediaMutation) AddReasonType(i int)

AddReasonType adds i to the "reason_type" field.

func (*MediaMutation) AddRefCount

func (m *MediaMutation) AddRefCount(i int)

AddRefCount adds i to the "ref_count" field.

func (*MediaMutation) AddStatus

func (m *MediaMutation) AddStatus(i int)

AddStatus adds i to the "status" field.

func (*MediaMutation) AddType

func (m *MediaMutation) AddType(i int)

AddType adds i to the "type" field.

func (*MediaMutation) AddUserID

func (m *MediaMutation) AddUserID(i int)

AddUserID adds i to the "user_id" field.

func (*MediaMutation) AddedAppID

func (m *MediaMutation) AddedAppID() (r int, exists bool)

AddedAppID returns the value that was added to the "app_id" field in this mutation.

func (*MediaMutation) AddedCompanyID

func (m *MediaMutation) AddedCompanyID() (r int64, exists bool)

AddedCompanyID returns the value that was added to the "company_id" field in this mutation.

func (*MediaMutation) AddedEdges

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

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

func (*MediaMutation) AddedField

func (m *MediaMutation) 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 (*MediaMutation) AddedFields

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

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

func (*MediaMutation) AddedIDs

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

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

func (*MediaMutation) AddedLevel

func (m *MediaMutation) AddedLevel() (r int, exists bool)

AddedLevel returns the value that was added to the "level" field in this mutation.

func (*MediaMutation) AddedOutUserID

func (m *MediaMutation) AddedOutUserID() (r int64, exists bool)

AddedOutUserID returns the value that was added to the "out_user_id" field in this mutation.

func (*MediaMutation) AddedReasonType

func (m *MediaMutation) AddedReasonType() (r int, exists bool)

AddedReasonType returns the value that was added to the "reason_type" field in this mutation.

func (*MediaMutation) AddedRefCount

func (m *MediaMutation) AddedRefCount() (r int, exists bool)

AddedRefCount returns the value that was added to the "ref_count" field in this mutation.

func (*MediaMutation) AddedStatus

func (m *MediaMutation) AddedStatus() (r int, exists bool)

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

func (*MediaMutation) AddedType

func (m *MediaMutation) AddedType() (r int, exists bool)

AddedType returns the value that was added to the "type" field in this mutation.

func (*MediaMutation) AddedUserID

func (m *MediaMutation) AddedUserID() (r int, exists bool)

AddedUserID returns the value that was added to the "user_id" field in this mutation.

func (*MediaMutation) AppID

func (m *MediaMutation) AppID() (r int, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*MediaMutation) AppIDCleared

func (m *MediaMutation) AppIDCleared() bool

AppIDCleared returns if the "app_id" field was cleared in this mutation.

func (*MediaMutation) ClearAppID

func (m *MediaMutation) ClearAppID()

ClearAppID clears the value of the "app_id" field.

func (*MediaMutation) ClearCompanyID

func (m *MediaMutation) ClearCompanyID()

ClearCompanyID clears the value of the "company_id" field.

func (*MediaMutation) ClearCreatedAt

func (m *MediaMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*MediaMutation) ClearDeleteAt

func (m *MediaMutation) ClearDeleteAt()

ClearDeleteAt clears the value of the "delete_at" field.

func (*MediaMutation) ClearEdge

func (m *MediaMutation) 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 (*MediaMutation) ClearExt

func (m *MediaMutation) ClearExt()

ClearExt clears the value of the "ext" field.

func (*MediaMutation) ClearField

func (m *MediaMutation) 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 (*MediaMutation) ClearFullPath

func (m *MediaMutation) ClearFullPath()

ClearFullPath clears the value of the "full_path" field.

func (*MediaMutation) ClearHash

func (m *MediaMutation) ClearHash()

ClearHash clears the value of the "hash" field.

func (*MediaMutation) ClearIsEncrypted

func (m *MediaMutation) ClearIsEncrypted()

ClearIsEncrypted clears the value of the "is_encrypted" field.

func (*MediaMutation) ClearLevel

func (m *MediaMutation) ClearLevel()

ClearLevel clears the value of the "level" field.

func (*MediaMutation) ClearMime

func (m *MediaMutation) ClearMime()

ClearMime clears the value of the "mime" field.

func (*MediaMutation) ClearOutUserID

func (m *MediaMutation) ClearOutUserID()

ClearOutUserID clears the value of the "out_user_id" field.

func (*MediaMutation) ClearReason

func (m *MediaMutation) ClearReason()

ClearReason clears the value of the "reason" field.

func (*MediaMutation) ClearReasonType

func (m *MediaMutation) ClearReasonType()

ClearReasonType clears the value of the "reason_type" field.

func (*MediaMutation) ClearRefCount

func (m *MediaMutation) ClearRefCount()

ClearRefCount clears the value of the "ref_count" field.

func (*MediaMutation) ClearSavePath

func (m *MediaMutation) ClearSavePath()

ClearSavePath clears the value of the "save_path" field.

func (*MediaMutation) ClearSize

func (m *MediaMutation) ClearSize()

ClearSize clears the value of the "size" field.

func (*MediaMutation) ClearSn

func (m *MediaMutation) ClearSn()

ClearSn clears the value of the "sn" field.

func (*MediaMutation) ClearStatus

func (m *MediaMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*MediaMutation) ClearType

func (m *MediaMutation) ClearType()

ClearType clears the value of the "type" field.

func (*MediaMutation) ClearUpdatedAt

func (m *MediaMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MediaMutation) ClearUserID

func (m *MediaMutation) ClearUserID()

ClearUserID clears the value of the "user_id" field.

func (*MediaMutation) ClearedEdges

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

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

func (*MediaMutation) ClearedFields

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

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

func (MediaMutation) Client

func (m MediaMutation) 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 (*MediaMutation) CompanyID

func (m *MediaMutation) CompanyID() (r int64, exists bool)

CompanyID returns the value of the "company_id" field in the mutation.

func (*MediaMutation) CompanyIDCleared

func (m *MediaMutation) CompanyIDCleared() bool

CompanyIDCleared returns if the "company_id" field was cleared in this mutation.

func (*MediaMutation) CreatedAt

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

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

func (*MediaMutation) CreatedAtCleared

func (m *MediaMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*MediaMutation) DeleteAt

func (m *MediaMutation) DeleteAt() (r time.Time, exists bool)

DeleteAt returns the value of the "delete_at" field in the mutation.

func (*MediaMutation) DeleteAtCleared

func (m *MediaMutation) DeleteAtCleared() bool

DeleteAtCleared returns if the "delete_at" field was cleared in this mutation.

func (*MediaMutation) EdgeCleared

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

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

func (*MediaMutation) Ext

func (m *MediaMutation) Ext() (r string, exists bool)

Ext returns the value of the "ext" field in the mutation.

func (*MediaMutation) ExtCleared

func (m *MediaMutation) ExtCleared() bool

ExtCleared returns if the "ext" field was cleared in this mutation.

func (*MediaMutation) Field

func (m *MediaMutation) 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 (*MediaMutation) FieldCleared

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

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

func (*MediaMutation) Fields

func (m *MediaMutation) 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 (*MediaMutation) FileName

func (m *MediaMutation) FileName() (r string, exists bool)

FileName returns the value of the "file_name" field in the mutation.

func (*MediaMutation) FullPath

func (m *MediaMutation) FullPath() (r string, exists bool)

FullPath returns the value of the "full_path" field in the mutation.

func (*MediaMutation) FullPathCleared

func (m *MediaMutation) FullPathCleared() bool

FullPathCleared returns if the "full_path" field was cleared in this mutation.

func (*MediaMutation) GetType

func (m *MediaMutation) GetType() (r int, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*MediaMutation) Hash

func (m *MediaMutation) Hash() (r string, exists bool)

Hash returns the value of the "hash" field in the mutation.

func (*MediaMutation) HashCleared

func (m *MediaMutation) HashCleared() bool

HashCleared returns if the "hash" field was cleared in this mutation.

func (*MediaMutation) ID

func (m *MediaMutation) ID() (id int, 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 (*MediaMutation) IDs

func (m *MediaMutation) IDs(ctx context.Context) ([]int, 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 (*MediaMutation) IsEncrypted

func (m *MediaMutation) IsEncrypted() (r bool, exists bool)

IsEncrypted returns the value of the "is_encrypted" field in the mutation.

func (*MediaMutation) IsEncryptedCleared

func (m *MediaMutation) IsEncryptedCleared() bool

IsEncryptedCleared returns if the "is_encrypted" field was cleared in this mutation.

func (*MediaMutation) Level

func (m *MediaMutation) Level() (r int, exists bool)

Level returns the value of the "level" field in the mutation.

func (*MediaMutation) LevelCleared

func (m *MediaMutation) LevelCleared() bool

LevelCleared returns if the "level" field was cleared in this mutation.

func (*MediaMutation) Mime

func (m *MediaMutation) Mime() (r string, exists bool)

Mime returns the value of the "mime" field in the mutation.

func (*MediaMutation) MimeCleared

func (m *MediaMutation) MimeCleared() bool

MimeCleared returns if the "mime" field was cleared in this mutation.

func (*MediaMutation) OldAppID

func (m *MediaMutation) OldAppID(ctx context.Context) (v int, err error)

OldAppID returns the old "app_id" field's value of the Media entity. If the Media 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 (*MediaMutation) OldCompanyID

func (m *MediaMutation) OldCompanyID(ctx context.Context) (v int64, err error)

OldCompanyID returns the old "company_id" field's value of the Media entity. If the Media 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 (*MediaMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Media entity. If the Media 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 (*MediaMutation) OldDeleteAt

func (m *MediaMutation) OldDeleteAt(ctx context.Context) (v time.Time, err error)

OldDeleteAt returns the old "delete_at" field's value of the Media entity. If the Media 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 (*MediaMutation) OldExt

func (m *MediaMutation) OldExt(ctx context.Context) (v string, err error)

OldExt returns the old "ext" field's value of the Media entity. If the Media 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 (*MediaMutation) OldField

func (m *MediaMutation) 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 (*MediaMutation) OldFileName

func (m *MediaMutation) OldFileName(ctx context.Context) (v string, err error)

OldFileName returns the old "file_name" field's value of the Media entity. If the Media 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 (*MediaMutation) OldFullPath

func (m *MediaMutation) OldFullPath(ctx context.Context) (v string, err error)

OldFullPath returns the old "full_path" field's value of the Media entity. If the Media 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 (*MediaMutation) OldHash

func (m *MediaMutation) OldHash(ctx context.Context) (v string, err error)

OldHash returns the old "hash" field's value of the Media entity. If the Media 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 (*MediaMutation) OldIsEncrypted

func (m *MediaMutation) OldIsEncrypted(ctx context.Context) (v bool, err error)

OldIsEncrypted returns the old "is_encrypted" field's value of the Media entity. If the Media 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 (*MediaMutation) OldLevel

func (m *MediaMutation) OldLevel(ctx context.Context) (v int, err error)

OldLevel returns the old "level" field's value of the Media entity. If the Media 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 (*MediaMutation) OldMime

func (m *MediaMutation) OldMime(ctx context.Context) (v string, err error)

OldMime returns the old "mime" field's value of the Media entity. If the Media 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 (*MediaMutation) OldOrgFileName

func (m *MediaMutation) OldOrgFileName(ctx context.Context) (v string, err error)

OldOrgFileName returns the old "org_file_name" field's value of the Media entity. If the Media 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 (*MediaMutation) OldOutUserID

func (m *MediaMutation) OldOutUserID(ctx context.Context) (v int64, err error)

OldOutUserID returns the old "out_user_id" field's value of the Media entity. If the Media 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 (*MediaMutation) OldReason

func (m *MediaMutation) OldReason(ctx context.Context) (v string, err error)

OldReason returns the old "reason" field's value of the Media entity. If the Media 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 (*MediaMutation) OldReasonType

func (m *MediaMutation) OldReasonType(ctx context.Context) (v int, err error)

OldReasonType returns the old "reason_type" field's value of the Media entity. If the Media 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 (*MediaMutation) OldRefCount

func (m *MediaMutation) OldRefCount(ctx context.Context) (v int, err error)

OldRefCount returns the old "ref_count" field's value of the Media entity. If the Media 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 (*MediaMutation) OldSavePath

func (m *MediaMutation) OldSavePath(ctx context.Context) (v string, err error)

OldSavePath returns the old "save_path" field's value of the Media entity. If the Media 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 (*MediaMutation) OldSize

func (m *MediaMutation) OldSize(ctx context.Context) (v schema.MediaSize, err error)

OldSize returns the old "size" field's value of the Media entity. If the Media 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 (*MediaMutation) OldSn

func (m *MediaMutation) OldSn(ctx context.Context) (v string, err error)

OldSn returns the old "sn" field's value of the Media entity. If the Media 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 (*MediaMutation) OldStatus

func (m *MediaMutation) OldStatus(ctx context.Context) (v int, err error)

OldStatus returns the old "status" field's value of the Media entity. If the Media 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 (*MediaMutation) OldType

func (m *MediaMutation) OldType(ctx context.Context) (v int, err error)

OldType returns the old "type" field's value of the Media entity. If the Media 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 (*MediaMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Media entity. If the Media 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 (*MediaMutation) OldUserID

func (m *MediaMutation) OldUserID(ctx context.Context) (v int, err error)

OldUserID returns the old "user_id" field's value of the Media entity. If the Media 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 (*MediaMutation) Op

func (m *MediaMutation) Op() Op

Op returns the operation name.

func (*MediaMutation) OrgFileName

func (m *MediaMutation) OrgFileName() (r string, exists bool)

OrgFileName returns the value of the "org_file_name" field in the mutation.

func (*MediaMutation) OutUserID

func (m *MediaMutation) OutUserID() (r int64, exists bool)

OutUserID returns the value of the "out_user_id" field in the mutation.

func (*MediaMutation) OutUserIDCleared

func (m *MediaMutation) OutUserIDCleared() bool

OutUserIDCleared returns if the "out_user_id" field was cleared in this mutation.

func (*MediaMutation) Reason

func (m *MediaMutation) Reason() (r string, exists bool)

Reason returns the value of the "reason" field in the mutation.

func (*MediaMutation) ReasonCleared

func (m *MediaMutation) ReasonCleared() bool

ReasonCleared returns if the "reason" field was cleared in this mutation.

func (*MediaMutation) ReasonType

func (m *MediaMutation) ReasonType() (r int, exists bool)

ReasonType returns the value of the "reason_type" field in the mutation.

func (*MediaMutation) ReasonTypeCleared

func (m *MediaMutation) ReasonTypeCleared() bool

ReasonTypeCleared returns if the "reason_type" field was cleared in this mutation.

func (*MediaMutation) RefCount

func (m *MediaMutation) RefCount() (r int, exists bool)

RefCount returns the value of the "ref_count" field in the mutation.

func (*MediaMutation) RefCountCleared

func (m *MediaMutation) RefCountCleared() bool

RefCountCleared returns if the "ref_count" field was cleared in this mutation.

func (*MediaMutation) RemovedEdges

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

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

func (*MediaMutation) RemovedIDs

func (m *MediaMutation) 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 (*MediaMutation) ResetAppID

func (m *MediaMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*MediaMutation) ResetCompanyID

func (m *MediaMutation) ResetCompanyID()

ResetCompanyID resets all changes to the "company_id" field.

func (*MediaMutation) ResetCreatedAt

func (m *MediaMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MediaMutation) ResetDeleteAt

func (m *MediaMutation) ResetDeleteAt()

ResetDeleteAt resets all changes to the "delete_at" field.

func (*MediaMutation) ResetEdge

func (m *MediaMutation) 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 (*MediaMutation) ResetExt

func (m *MediaMutation) ResetExt()

ResetExt resets all changes to the "ext" field.

func (*MediaMutation) ResetField

func (m *MediaMutation) 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 (*MediaMutation) ResetFileName

func (m *MediaMutation) ResetFileName()

ResetFileName resets all changes to the "file_name" field.

func (*MediaMutation) ResetFullPath

func (m *MediaMutation) ResetFullPath()

ResetFullPath resets all changes to the "full_path" field.

func (*MediaMutation) ResetHash

func (m *MediaMutation) ResetHash()

ResetHash resets all changes to the "hash" field.

func (*MediaMutation) ResetIsEncrypted

func (m *MediaMutation) ResetIsEncrypted()

ResetIsEncrypted resets all changes to the "is_encrypted" field.

func (*MediaMutation) ResetLevel

func (m *MediaMutation) ResetLevel()

ResetLevel resets all changes to the "level" field.

func (*MediaMutation) ResetMime

func (m *MediaMutation) ResetMime()

ResetMime resets all changes to the "mime" field.

func (*MediaMutation) ResetOrgFileName

func (m *MediaMutation) ResetOrgFileName()

ResetOrgFileName resets all changes to the "org_file_name" field.

func (*MediaMutation) ResetOutUserID

func (m *MediaMutation) ResetOutUserID()

ResetOutUserID resets all changes to the "out_user_id" field.

func (*MediaMutation) ResetReason

func (m *MediaMutation) ResetReason()

ResetReason resets all changes to the "reason" field.

func (*MediaMutation) ResetReasonType

func (m *MediaMutation) ResetReasonType()

ResetReasonType resets all changes to the "reason_type" field.

func (*MediaMutation) ResetRefCount

func (m *MediaMutation) ResetRefCount()

ResetRefCount resets all changes to the "ref_count" field.

func (*MediaMutation) ResetSavePath

func (m *MediaMutation) ResetSavePath()

ResetSavePath resets all changes to the "save_path" field.

func (*MediaMutation) ResetSize

func (m *MediaMutation) ResetSize()

ResetSize resets all changes to the "size" field.

func (*MediaMutation) ResetSn

func (m *MediaMutation) ResetSn()

ResetSn resets all changes to the "sn" field.

func (*MediaMutation) ResetStatus

func (m *MediaMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*MediaMutation) ResetType

func (m *MediaMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*MediaMutation) ResetUpdatedAt

func (m *MediaMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*MediaMutation) ResetUserID

func (m *MediaMutation) ResetUserID()

ResetUserID resets all changes to the "user_id" field.

func (*MediaMutation) SavePath

func (m *MediaMutation) SavePath() (r string, exists bool)

SavePath returns the value of the "save_path" field in the mutation.

func (*MediaMutation) SavePathCleared

func (m *MediaMutation) SavePathCleared() bool

SavePathCleared returns if the "save_path" field was cleared in this mutation.

func (*MediaMutation) SetAppID

func (m *MediaMutation) SetAppID(i int)

SetAppID sets the "app_id" field.

func (*MediaMutation) SetCompanyID

func (m *MediaMutation) SetCompanyID(i int64)

SetCompanyID sets the "company_id" field.

func (*MediaMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MediaMutation) SetDeleteAt

func (m *MediaMutation) SetDeleteAt(t time.Time)

SetDeleteAt sets the "delete_at" field.

func (*MediaMutation) SetExt

func (m *MediaMutation) SetExt(s string)

SetExt sets the "ext" field.

func (*MediaMutation) SetField

func (m *MediaMutation) 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 (*MediaMutation) SetFileName

func (m *MediaMutation) SetFileName(s string)

SetFileName sets the "file_name" field.

func (*MediaMutation) SetFullPath

func (m *MediaMutation) SetFullPath(s string)

SetFullPath sets the "full_path" field.

func (*MediaMutation) SetHash

func (m *MediaMutation) SetHash(s string)

SetHash sets the "hash" field.

func (*MediaMutation) SetIsEncrypted

func (m *MediaMutation) SetIsEncrypted(b bool)

SetIsEncrypted sets the "is_encrypted" field.

func (*MediaMutation) SetLevel

func (m *MediaMutation) SetLevel(i int)

SetLevel sets the "level" field.

func (*MediaMutation) SetMime

func (m *MediaMutation) SetMime(s string)

SetMime sets the "mime" field.

func (*MediaMutation) SetOrgFileName

func (m *MediaMutation) SetOrgFileName(s string)

SetOrgFileName sets the "org_file_name" field.

func (*MediaMutation) SetOutUserID

func (m *MediaMutation) SetOutUserID(i int64)

SetOutUserID sets the "out_user_id" field.

func (*MediaMutation) SetReason

func (m *MediaMutation) SetReason(s string)

SetReason sets the "reason" field.

func (*MediaMutation) SetReasonType

func (m *MediaMutation) SetReasonType(i int)

SetReasonType sets the "reason_type" field.

func (*MediaMutation) SetRefCount

func (m *MediaMutation) SetRefCount(i int)

SetRefCount sets the "ref_count" field.

func (*MediaMutation) SetSavePath

func (m *MediaMutation) SetSavePath(s string)

SetSavePath sets the "save_path" field.

func (*MediaMutation) SetSize

func (m *MediaMutation) SetSize(ss schema.MediaSize)

SetSize sets the "size" field.

func (*MediaMutation) SetSn

func (m *MediaMutation) SetSn(s string)

SetSn sets the "sn" field.

func (*MediaMutation) SetStatus

func (m *MediaMutation) SetStatus(i int)

SetStatus sets the "status" field.

func (*MediaMutation) SetType

func (m *MediaMutation) SetType(i int)

SetType sets the "type" field.

func (*MediaMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (*MediaMutation) SetUserID

func (m *MediaMutation) SetUserID(i int)

SetUserID sets the "user_id" field.

func (*MediaMutation) Size

func (m *MediaMutation) Size() (r schema.MediaSize, exists bool)

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

func (*MediaMutation) SizeCleared

func (m *MediaMutation) SizeCleared() bool

SizeCleared returns if the "size" field was cleared in this mutation.

func (*MediaMutation) Sn

func (m *MediaMutation) Sn() (r string, exists bool)

Sn returns the value of the "sn" field in the mutation.

func (*MediaMutation) SnCleared

func (m *MediaMutation) SnCleared() bool

SnCleared returns if the "sn" field was cleared in this mutation.

func (*MediaMutation) Status

func (m *MediaMutation) Status() (r int, exists bool)

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

func (*MediaMutation) StatusCleared

func (m *MediaMutation) StatusCleared() bool

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

func (MediaMutation) Tx

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

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

func (*MediaMutation) Type

func (m *MediaMutation) Type() string

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

func (*MediaMutation) TypeCleared

func (m *MediaMutation) TypeCleared() bool

TypeCleared returns if the "type" field was cleared in this mutation.

func (*MediaMutation) UpdatedAt

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

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

func (*MediaMutation) UpdatedAtCleared

func (m *MediaMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*MediaMutation) UserID

func (m *MediaMutation) UserID() (r int, exists bool)

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

func (*MediaMutation) UserIDCleared

func (m *MediaMutation) UserIDCleared() bool

UserIDCleared returns if the "user_id" field was cleared in this mutation.

func (*MediaMutation) Where

func (m *MediaMutation) Where(ps ...predicate.Media)

Where appends a list predicates to the MediaMutation builder.

type MediaQuery

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

MediaQuery is the builder for querying Media entities.

func (*MediaQuery) All

func (mq *MediaQuery) All(ctx context.Context) ([]*Media, error)

All executes the query and returns a list of MediaSlice.

func (*MediaQuery) AllX

func (mq *MediaQuery) AllX(ctx context.Context) []*Media

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

func (*MediaQuery) Clone

func (mq *MediaQuery) Clone() *MediaQuery

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

func (*MediaQuery) Count

func (mq *MediaQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*MediaQuery) CountX

func (mq *MediaQuery) CountX(ctx context.Context) int

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

func (*MediaQuery) Exist

func (mq *MediaQuery) Exist(ctx context.Context) (bool, error)

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

func (*MediaQuery) ExistX

func (mq *MediaQuery) ExistX(ctx context.Context) bool

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

func (*MediaQuery) First

func (mq *MediaQuery) First(ctx context.Context) (*Media, error)

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

func (*MediaQuery) FirstID

func (mq *MediaQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*MediaQuery) FirstIDX

func (mq *MediaQuery) FirstIDX(ctx context.Context) int

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

func (*MediaQuery) FirstX

func (mq *MediaQuery) FirstX(ctx context.Context) *Media

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

func (*MediaQuery) GroupBy

func (mq *MediaQuery) GroupBy(field string, fields ...string) *MediaGroupBy

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.Media.Query().
	GroupBy(media.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MediaQuery) IDs

func (mq *MediaQuery) IDs(ctx context.Context) ([]int, error)

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

func (*MediaQuery) IDsX

func (mq *MediaQuery) IDsX(ctx context.Context) []int

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

func (*MediaQuery) Limit

func (mq *MediaQuery) Limit(limit int) *MediaQuery

Limit adds a limit step to the query.

func (*MediaQuery) Offset

func (mq *MediaQuery) Offset(offset int) *MediaQuery

Offset adds an offset step to the query.

func (*MediaQuery) Only

func (mq *MediaQuery) Only(ctx context.Context) (*Media, error)

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

func (*MediaQuery) OnlyID

func (mq *MediaQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*MediaQuery) OnlyIDX

func (mq *MediaQuery) OnlyIDX(ctx context.Context) int

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

func (*MediaQuery) OnlyX

func (mq *MediaQuery) OnlyX(ctx context.Context) *Media

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

func (*MediaQuery) Order

func (mq *MediaQuery) Order(o ...OrderFunc) *MediaQuery

Order adds an order step to the query.

func (*MediaQuery) Select

func (mq *MediaQuery) Select(fields ...string) *MediaSelect

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.Media.Query().
	Select(media.FieldCreatedAt).
	Scan(ctx, &v)

func (*MediaQuery) Unique

func (mq *MediaQuery) Unique(unique bool) *MediaQuery

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 (*MediaQuery) Where

func (mq *MediaQuery) Where(ps ...predicate.Media) *MediaQuery

Where adds a new predicate for the MediaQuery builder.

type MediaSelect

type MediaSelect struct {
	*MediaQuery
	// contains filtered or unexported fields
}

MediaSelect is the builder for selecting fields of Media entities.

func (*MediaSelect) Bool

func (ms *MediaSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*MediaSelect) BoolX

func (ms *MediaSelect) BoolX(ctx context.Context) bool

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

func (*MediaSelect) Bools

func (ms *MediaSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*MediaSelect) BoolsX

func (ms *MediaSelect) BoolsX(ctx context.Context) []bool

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

func (*MediaSelect) Float64

func (ms *MediaSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*MediaSelect) Float64X

func (ms *MediaSelect) Float64X(ctx context.Context) float64

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

func (*MediaSelect) Float64s

func (ms *MediaSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*MediaSelect) Float64sX

func (ms *MediaSelect) Float64sX(ctx context.Context) []float64

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

func (*MediaSelect) Int

func (ms *MediaSelect) Int(ctx context.Context) (_ int, err error)

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

func (*MediaSelect) IntX

func (ms *MediaSelect) IntX(ctx context.Context) int

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

func (*MediaSelect) Ints

func (ms *MediaSelect) Ints(ctx context.Context) ([]int, error)

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

func (*MediaSelect) IntsX

func (ms *MediaSelect) IntsX(ctx context.Context) []int

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

func (*MediaSelect) Scan

func (ms *MediaSelect) Scan(ctx context.Context, v interface{}) error

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

func (*MediaSelect) ScanX

func (ms *MediaSelect) ScanX(ctx context.Context, v interface{})

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

func (*MediaSelect) String

func (ms *MediaSelect) String(ctx context.Context) (_ string, err error)

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

func (*MediaSelect) StringX

func (ms *MediaSelect) StringX(ctx context.Context) string

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

func (*MediaSelect) Strings

func (ms *MediaSelect) Strings(ctx context.Context) ([]string, error)

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

func (*MediaSelect) StringsX

func (ms *MediaSelect) StringsX(ctx context.Context) []string

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

type MediaSlice

type MediaSlice []*Media

MediaSlice is a parsable slice of Media.

type MediaUpdate

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

MediaUpdate is the builder for updating Media entities.

func (*MediaUpdate) AddAppID

func (mu *MediaUpdate) AddAppID(i int) *MediaUpdate

AddAppID adds i to the "app_id" field.

func (*MediaUpdate) AddCompanyID

func (mu *MediaUpdate) AddCompanyID(i int64) *MediaUpdate

AddCompanyID adds i to the "company_id" field.

func (*MediaUpdate) AddLevel

func (mu *MediaUpdate) AddLevel(i int) *MediaUpdate

AddLevel adds i to the "level" field.

func (*MediaUpdate) AddOutUserID

func (mu *MediaUpdate) AddOutUserID(i int64) *MediaUpdate

AddOutUserID adds i to the "out_user_id" field.

func (*MediaUpdate) AddReasonType

func (mu *MediaUpdate) AddReasonType(i int) *MediaUpdate

AddReasonType adds i to the "reason_type" field.

func (*MediaUpdate) AddRefCount

func (mu *MediaUpdate) AddRefCount(i int) *MediaUpdate

AddRefCount adds i to the "ref_count" field.

func (*MediaUpdate) AddStatus

func (mu *MediaUpdate) AddStatus(i int) *MediaUpdate

AddStatus adds i to the "status" field.

func (*MediaUpdate) AddType

func (mu *MediaUpdate) AddType(i int) *MediaUpdate

AddType adds i to the "type" field.

func (*MediaUpdate) AddUserID

func (mu *MediaUpdate) AddUserID(i int) *MediaUpdate

AddUserID adds i to the "user_id" field.

func (*MediaUpdate) ClearAppID

func (mu *MediaUpdate) ClearAppID() *MediaUpdate

ClearAppID clears the value of the "app_id" field.

func (*MediaUpdate) ClearCompanyID

func (mu *MediaUpdate) ClearCompanyID() *MediaUpdate

ClearCompanyID clears the value of the "company_id" field.

func (*MediaUpdate) ClearDeleteAt

func (mu *MediaUpdate) ClearDeleteAt() *MediaUpdate

ClearDeleteAt clears the value of the "delete_at" field.

func (*MediaUpdate) ClearExt

func (mu *MediaUpdate) ClearExt() *MediaUpdate

ClearExt clears the value of the "ext" field.

func (*MediaUpdate) ClearFullPath

func (mu *MediaUpdate) ClearFullPath() *MediaUpdate

ClearFullPath clears the value of the "full_path" field.

func (*MediaUpdate) ClearHash

func (mu *MediaUpdate) ClearHash() *MediaUpdate

ClearHash clears the value of the "hash" field.

func (*MediaUpdate) ClearIsEncrypted

func (mu *MediaUpdate) ClearIsEncrypted() *MediaUpdate

ClearIsEncrypted clears the value of the "is_encrypted" field.

func (*MediaUpdate) ClearLevel

func (mu *MediaUpdate) ClearLevel() *MediaUpdate

ClearLevel clears the value of the "level" field.

func (*MediaUpdate) ClearMime

func (mu *MediaUpdate) ClearMime() *MediaUpdate

ClearMime clears the value of the "mime" field.

func (*MediaUpdate) ClearOutUserID

func (mu *MediaUpdate) ClearOutUserID() *MediaUpdate

ClearOutUserID clears the value of the "out_user_id" field.

func (*MediaUpdate) ClearReason

func (mu *MediaUpdate) ClearReason() *MediaUpdate

ClearReason clears the value of the "reason" field.

func (*MediaUpdate) ClearReasonType

func (mu *MediaUpdate) ClearReasonType() *MediaUpdate

ClearReasonType clears the value of the "reason_type" field.

func (*MediaUpdate) ClearRefCount

func (mu *MediaUpdate) ClearRefCount() *MediaUpdate

ClearRefCount clears the value of the "ref_count" field.

func (*MediaUpdate) ClearSavePath

func (mu *MediaUpdate) ClearSavePath() *MediaUpdate

ClearSavePath clears the value of the "save_path" field.

func (*MediaUpdate) ClearSize

func (mu *MediaUpdate) ClearSize() *MediaUpdate

ClearSize clears the value of the "size" field.

func (*MediaUpdate) ClearSn

func (mu *MediaUpdate) ClearSn() *MediaUpdate

ClearSn clears the value of the "sn" field.

func (*MediaUpdate) ClearStatus

func (mu *MediaUpdate) ClearStatus() *MediaUpdate

ClearStatus clears the value of the "status" field.

func (*MediaUpdate) ClearType

func (mu *MediaUpdate) ClearType() *MediaUpdate

ClearType clears the value of the "type" field.

func (*MediaUpdate) ClearUpdatedAt

func (mu *MediaUpdate) ClearUpdatedAt() *MediaUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MediaUpdate) ClearUserID

func (mu *MediaUpdate) ClearUserID() *MediaUpdate

ClearUserID clears the value of the "user_id" field.

func (*MediaUpdate) Exec

func (mu *MediaUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MediaUpdate) ExecX

func (mu *MediaUpdate) ExecX(ctx context.Context)

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

func (*MediaUpdate) Mutation

func (mu *MediaUpdate) Mutation() *MediaMutation

Mutation returns the MediaMutation object of the builder.

func (*MediaUpdate) Save

func (mu *MediaUpdate) Save(ctx context.Context) (int, error)

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

func (*MediaUpdate) SaveX

func (mu *MediaUpdate) SaveX(ctx context.Context) int

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

func (*MediaUpdate) SetAppID

func (mu *MediaUpdate) SetAppID(i int) *MediaUpdate

SetAppID sets the "app_id" field.

func (*MediaUpdate) SetCompanyID

func (mu *MediaUpdate) SetCompanyID(i int64) *MediaUpdate

SetCompanyID sets the "company_id" field.

func (*MediaUpdate) SetDeleteAt

func (mu *MediaUpdate) SetDeleteAt(t time.Time) *MediaUpdate

SetDeleteAt sets the "delete_at" field.

func (*MediaUpdate) SetExt

func (mu *MediaUpdate) SetExt(s string) *MediaUpdate

SetExt sets the "ext" field.

func (*MediaUpdate) SetFileName

func (mu *MediaUpdate) SetFileName(s string) *MediaUpdate

SetFileName sets the "file_name" field.

func (*MediaUpdate) SetFullPath

func (mu *MediaUpdate) SetFullPath(s string) *MediaUpdate

SetFullPath sets the "full_path" field.

func (*MediaUpdate) SetHash

func (mu *MediaUpdate) SetHash(s string) *MediaUpdate

SetHash sets the "hash" field.

func (*MediaUpdate) SetIsEncrypted

func (mu *MediaUpdate) SetIsEncrypted(b bool) *MediaUpdate

SetIsEncrypted sets the "is_encrypted" field.

func (*MediaUpdate) SetLevel

func (mu *MediaUpdate) SetLevel(i int) *MediaUpdate

SetLevel sets the "level" field.

func (*MediaUpdate) SetMime

func (mu *MediaUpdate) SetMime(s string) *MediaUpdate

SetMime sets the "mime" field.

func (*MediaUpdate) SetNillableAppID

func (mu *MediaUpdate) SetNillableAppID(i *int) *MediaUpdate

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*MediaUpdate) SetNillableCompanyID

func (mu *MediaUpdate) SetNillableCompanyID(i *int64) *MediaUpdate

SetNillableCompanyID sets the "company_id" field if the given value is not nil.

func (*MediaUpdate) SetNillableDeleteAt

func (mu *MediaUpdate) SetNillableDeleteAt(t *time.Time) *MediaUpdate

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*MediaUpdate) SetNillableExt

func (mu *MediaUpdate) SetNillableExt(s *string) *MediaUpdate

SetNillableExt sets the "ext" field if the given value is not nil.

func (*MediaUpdate) SetNillableFullPath

func (mu *MediaUpdate) SetNillableFullPath(s *string) *MediaUpdate

SetNillableFullPath sets the "full_path" field if the given value is not nil.

func (*MediaUpdate) SetNillableHash

func (mu *MediaUpdate) SetNillableHash(s *string) *MediaUpdate

SetNillableHash sets the "hash" field if the given value is not nil.

func (*MediaUpdate) SetNillableIsEncrypted

func (mu *MediaUpdate) SetNillableIsEncrypted(b *bool) *MediaUpdate

SetNillableIsEncrypted sets the "is_encrypted" field if the given value is not nil.

func (*MediaUpdate) SetNillableLevel

func (mu *MediaUpdate) SetNillableLevel(i *int) *MediaUpdate

SetNillableLevel sets the "level" field if the given value is not nil.

func (*MediaUpdate) SetNillableMime

func (mu *MediaUpdate) SetNillableMime(s *string) *MediaUpdate

SetNillableMime sets the "mime" field if the given value is not nil.

func (*MediaUpdate) SetNillableOutUserID

func (mu *MediaUpdate) SetNillableOutUserID(i *int64) *MediaUpdate

SetNillableOutUserID sets the "out_user_id" field if the given value is not nil.

func (*MediaUpdate) SetNillableReason

func (mu *MediaUpdate) SetNillableReason(s *string) *MediaUpdate

SetNillableReason sets the "reason" field if the given value is not nil.

func (*MediaUpdate) SetNillableReasonType

func (mu *MediaUpdate) SetNillableReasonType(i *int) *MediaUpdate

SetNillableReasonType sets the "reason_type" field if the given value is not nil.

func (*MediaUpdate) SetNillableRefCount

func (mu *MediaUpdate) SetNillableRefCount(i *int) *MediaUpdate

SetNillableRefCount sets the "ref_count" field if the given value is not nil.

func (*MediaUpdate) SetNillableSavePath

func (mu *MediaUpdate) SetNillableSavePath(s *string) *MediaUpdate

SetNillableSavePath sets the "save_path" field if the given value is not nil.

func (*MediaUpdate) SetNillableSize

func (mu *MediaUpdate) SetNillableSize(ss *schema.MediaSize) *MediaUpdate

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

func (*MediaUpdate) SetNillableSn

func (mu *MediaUpdate) SetNillableSn(s *string) *MediaUpdate

SetNillableSn sets the "sn" field if the given value is not nil.

func (*MediaUpdate) SetNillableStatus

func (mu *MediaUpdate) SetNillableStatus(i *int) *MediaUpdate

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

func (*MediaUpdate) SetNillableType

func (mu *MediaUpdate) SetNillableType(i *int) *MediaUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*MediaUpdate) SetNillableUserID

func (mu *MediaUpdate) SetNillableUserID(i *int) *MediaUpdate

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

func (*MediaUpdate) SetOrgFileName

func (mu *MediaUpdate) SetOrgFileName(s string) *MediaUpdate

SetOrgFileName sets the "org_file_name" field.

func (*MediaUpdate) SetOutUserID

func (mu *MediaUpdate) SetOutUserID(i int64) *MediaUpdate

SetOutUserID sets the "out_user_id" field.

func (*MediaUpdate) SetReason

func (mu *MediaUpdate) SetReason(s string) *MediaUpdate

SetReason sets the "reason" field.

func (*MediaUpdate) SetReasonType

func (mu *MediaUpdate) SetReasonType(i int) *MediaUpdate

SetReasonType sets the "reason_type" field.

func (*MediaUpdate) SetRefCount

func (mu *MediaUpdate) SetRefCount(i int) *MediaUpdate

SetRefCount sets the "ref_count" field.

func (*MediaUpdate) SetSavePath

func (mu *MediaUpdate) SetSavePath(s string) *MediaUpdate

SetSavePath sets the "save_path" field.

func (*MediaUpdate) SetSize

func (mu *MediaUpdate) SetSize(ss schema.MediaSize) *MediaUpdate

SetSize sets the "size" field.

func (*MediaUpdate) SetSn

func (mu *MediaUpdate) SetSn(s string) *MediaUpdate

SetSn sets the "sn" field.

func (*MediaUpdate) SetStatus

func (mu *MediaUpdate) SetStatus(i int) *MediaUpdate

SetStatus sets the "status" field.

func (*MediaUpdate) SetType

func (mu *MediaUpdate) SetType(i int) *MediaUpdate

SetType sets the "type" field.

func (*MediaUpdate) SetUpdatedAt

func (mu *MediaUpdate) SetUpdatedAt(t time.Time) *MediaUpdate

SetUpdatedAt sets the "updated_at" field.

func (*MediaUpdate) SetUserID

func (mu *MediaUpdate) SetUserID(i int) *MediaUpdate

SetUserID sets the "user_id" field.

func (*MediaUpdate) Where

func (mu *MediaUpdate) Where(ps ...predicate.Media) *MediaUpdate

Where appends a list predicates to the MediaUpdate builder.

type MediaUpdateOne

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

MediaUpdateOne is the builder for updating a single Media entity.

func (*MediaUpdateOne) AddAppID

func (muo *MediaUpdateOne) AddAppID(i int) *MediaUpdateOne

AddAppID adds i to the "app_id" field.

func (*MediaUpdateOne) AddCompanyID

func (muo *MediaUpdateOne) AddCompanyID(i int64) *MediaUpdateOne

AddCompanyID adds i to the "company_id" field.

func (*MediaUpdateOne) AddLevel

func (muo *MediaUpdateOne) AddLevel(i int) *MediaUpdateOne

AddLevel adds i to the "level" field.

func (*MediaUpdateOne) AddOutUserID

func (muo *MediaUpdateOne) AddOutUserID(i int64) *MediaUpdateOne

AddOutUserID adds i to the "out_user_id" field.

func (*MediaUpdateOne) AddReasonType

func (muo *MediaUpdateOne) AddReasonType(i int) *MediaUpdateOne

AddReasonType adds i to the "reason_type" field.

func (*MediaUpdateOne) AddRefCount

func (muo *MediaUpdateOne) AddRefCount(i int) *MediaUpdateOne

AddRefCount adds i to the "ref_count" field.

func (*MediaUpdateOne) AddStatus

func (muo *MediaUpdateOne) AddStatus(i int) *MediaUpdateOne

AddStatus adds i to the "status" field.

func (*MediaUpdateOne) AddType

func (muo *MediaUpdateOne) AddType(i int) *MediaUpdateOne

AddType adds i to the "type" field.

func (*MediaUpdateOne) AddUserID

func (muo *MediaUpdateOne) AddUserID(i int) *MediaUpdateOne

AddUserID adds i to the "user_id" field.

func (*MediaUpdateOne) ClearAppID

func (muo *MediaUpdateOne) ClearAppID() *MediaUpdateOne

ClearAppID clears the value of the "app_id" field.

func (*MediaUpdateOne) ClearCompanyID

func (muo *MediaUpdateOne) ClearCompanyID() *MediaUpdateOne

ClearCompanyID clears the value of the "company_id" field.

func (*MediaUpdateOne) ClearDeleteAt

func (muo *MediaUpdateOne) ClearDeleteAt() *MediaUpdateOne

ClearDeleteAt clears the value of the "delete_at" field.

func (*MediaUpdateOne) ClearExt

func (muo *MediaUpdateOne) ClearExt() *MediaUpdateOne

ClearExt clears the value of the "ext" field.

func (*MediaUpdateOne) ClearFullPath

func (muo *MediaUpdateOne) ClearFullPath() *MediaUpdateOne

ClearFullPath clears the value of the "full_path" field.

func (*MediaUpdateOne) ClearHash

func (muo *MediaUpdateOne) ClearHash() *MediaUpdateOne

ClearHash clears the value of the "hash" field.

func (*MediaUpdateOne) ClearIsEncrypted

func (muo *MediaUpdateOne) ClearIsEncrypted() *MediaUpdateOne

ClearIsEncrypted clears the value of the "is_encrypted" field.

func (*MediaUpdateOne) ClearLevel

func (muo *MediaUpdateOne) ClearLevel() *MediaUpdateOne

ClearLevel clears the value of the "level" field.

func (*MediaUpdateOne) ClearMime

func (muo *MediaUpdateOne) ClearMime() *MediaUpdateOne

ClearMime clears the value of the "mime" field.

func (*MediaUpdateOne) ClearOutUserID

func (muo *MediaUpdateOne) ClearOutUserID() *MediaUpdateOne

ClearOutUserID clears the value of the "out_user_id" field.

func (*MediaUpdateOne) ClearReason

func (muo *MediaUpdateOne) ClearReason() *MediaUpdateOne

ClearReason clears the value of the "reason" field.

func (*MediaUpdateOne) ClearReasonType

func (muo *MediaUpdateOne) ClearReasonType() *MediaUpdateOne

ClearReasonType clears the value of the "reason_type" field.

func (*MediaUpdateOne) ClearRefCount

func (muo *MediaUpdateOne) ClearRefCount() *MediaUpdateOne

ClearRefCount clears the value of the "ref_count" field.

func (*MediaUpdateOne) ClearSavePath

func (muo *MediaUpdateOne) ClearSavePath() *MediaUpdateOne

ClearSavePath clears the value of the "save_path" field.

func (*MediaUpdateOne) ClearSize

func (muo *MediaUpdateOne) ClearSize() *MediaUpdateOne

ClearSize clears the value of the "size" field.

func (*MediaUpdateOne) ClearSn

func (muo *MediaUpdateOne) ClearSn() *MediaUpdateOne

ClearSn clears the value of the "sn" field.

func (*MediaUpdateOne) ClearStatus

func (muo *MediaUpdateOne) ClearStatus() *MediaUpdateOne

ClearStatus clears the value of the "status" field.

func (*MediaUpdateOne) ClearType

func (muo *MediaUpdateOne) ClearType() *MediaUpdateOne

ClearType clears the value of the "type" field.

func (*MediaUpdateOne) ClearUpdatedAt

func (muo *MediaUpdateOne) ClearUpdatedAt() *MediaUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*MediaUpdateOne) ClearUserID

func (muo *MediaUpdateOne) ClearUserID() *MediaUpdateOne

ClearUserID clears the value of the "user_id" field.

func (*MediaUpdateOne) Exec

func (muo *MediaUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MediaUpdateOne) ExecX

func (muo *MediaUpdateOne) ExecX(ctx context.Context)

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

func (*MediaUpdateOne) Mutation

func (muo *MediaUpdateOne) Mutation() *MediaMutation

Mutation returns the MediaMutation object of the builder.

func (*MediaUpdateOne) Save

func (muo *MediaUpdateOne) Save(ctx context.Context) (*Media, error)

Save executes the query and returns the updated Media entity.

func (*MediaUpdateOne) SaveX

func (muo *MediaUpdateOne) SaveX(ctx context.Context) *Media

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

func (*MediaUpdateOne) Select

func (muo *MediaUpdateOne) Select(field string, fields ...string) *MediaUpdateOne

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

func (*MediaUpdateOne) SetAppID

func (muo *MediaUpdateOne) SetAppID(i int) *MediaUpdateOne

SetAppID sets the "app_id" field.

func (*MediaUpdateOne) SetCompanyID

func (muo *MediaUpdateOne) SetCompanyID(i int64) *MediaUpdateOne

SetCompanyID sets the "company_id" field.

func (*MediaUpdateOne) SetDeleteAt

func (muo *MediaUpdateOne) SetDeleteAt(t time.Time) *MediaUpdateOne

SetDeleteAt sets the "delete_at" field.

func (*MediaUpdateOne) SetExt

func (muo *MediaUpdateOne) SetExt(s string) *MediaUpdateOne

SetExt sets the "ext" field.

func (*MediaUpdateOne) SetFileName

func (muo *MediaUpdateOne) SetFileName(s string) *MediaUpdateOne

SetFileName sets the "file_name" field.

func (*MediaUpdateOne) SetFullPath

func (muo *MediaUpdateOne) SetFullPath(s string) *MediaUpdateOne

SetFullPath sets the "full_path" field.

func (*MediaUpdateOne) SetHash

func (muo *MediaUpdateOne) SetHash(s string) *MediaUpdateOne

SetHash sets the "hash" field.

func (*MediaUpdateOne) SetIsEncrypted

func (muo *MediaUpdateOne) SetIsEncrypted(b bool) *MediaUpdateOne

SetIsEncrypted sets the "is_encrypted" field.

func (*MediaUpdateOne) SetLevel

func (muo *MediaUpdateOne) SetLevel(i int) *MediaUpdateOne

SetLevel sets the "level" field.

func (*MediaUpdateOne) SetMime

func (muo *MediaUpdateOne) SetMime(s string) *MediaUpdateOne

SetMime sets the "mime" field.

func (*MediaUpdateOne) SetNillableAppID

func (muo *MediaUpdateOne) SetNillableAppID(i *int) *MediaUpdateOne

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableCompanyID

func (muo *MediaUpdateOne) SetNillableCompanyID(i *int64) *MediaUpdateOne

SetNillableCompanyID sets the "company_id" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableDeleteAt

func (muo *MediaUpdateOne) SetNillableDeleteAt(t *time.Time) *MediaUpdateOne

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableExt

func (muo *MediaUpdateOne) SetNillableExt(s *string) *MediaUpdateOne

SetNillableExt sets the "ext" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableFullPath

func (muo *MediaUpdateOne) SetNillableFullPath(s *string) *MediaUpdateOne

SetNillableFullPath sets the "full_path" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableHash

func (muo *MediaUpdateOne) SetNillableHash(s *string) *MediaUpdateOne

SetNillableHash sets the "hash" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableIsEncrypted

func (muo *MediaUpdateOne) SetNillableIsEncrypted(b *bool) *MediaUpdateOne

SetNillableIsEncrypted sets the "is_encrypted" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableLevel

func (muo *MediaUpdateOne) SetNillableLevel(i *int) *MediaUpdateOne

SetNillableLevel sets the "level" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableMime

func (muo *MediaUpdateOne) SetNillableMime(s *string) *MediaUpdateOne

SetNillableMime sets the "mime" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableOutUserID

func (muo *MediaUpdateOne) SetNillableOutUserID(i *int64) *MediaUpdateOne

SetNillableOutUserID sets the "out_user_id" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableReason

func (muo *MediaUpdateOne) SetNillableReason(s *string) *MediaUpdateOne

SetNillableReason sets the "reason" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableReasonType

func (muo *MediaUpdateOne) SetNillableReasonType(i *int) *MediaUpdateOne

SetNillableReasonType sets the "reason_type" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableRefCount

func (muo *MediaUpdateOne) SetNillableRefCount(i *int) *MediaUpdateOne

SetNillableRefCount sets the "ref_count" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableSavePath

func (muo *MediaUpdateOne) SetNillableSavePath(s *string) *MediaUpdateOne

SetNillableSavePath sets the "save_path" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableSize

func (muo *MediaUpdateOne) SetNillableSize(ss *schema.MediaSize) *MediaUpdateOne

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

func (*MediaUpdateOne) SetNillableSn

func (muo *MediaUpdateOne) SetNillableSn(s *string) *MediaUpdateOne

SetNillableSn sets the "sn" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableStatus

func (muo *MediaUpdateOne) SetNillableStatus(i *int) *MediaUpdateOne

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

func (*MediaUpdateOne) SetNillableType

func (muo *MediaUpdateOne) SetNillableType(i *int) *MediaUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*MediaUpdateOne) SetNillableUserID

func (muo *MediaUpdateOne) SetNillableUserID(i *int) *MediaUpdateOne

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

func (*MediaUpdateOne) SetOrgFileName

func (muo *MediaUpdateOne) SetOrgFileName(s string) *MediaUpdateOne

SetOrgFileName sets the "org_file_name" field.

func (*MediaUpdateOne) SetOutUserID

func (muo *MediaUpdateOne) SetOutUserID(i int64) *MediaUpdateOne

SetOutUserID sets the "out_user_id" field.

func (*MediaUpdateOne) SetReason

func (muo *MediaUpdateOne) SetReason(s string) *MediaUpdateOne

SetReason sets the "reason" field.

func (*MediaUpdateOne) SetReasonType

func (muo *MediaUpdateOne) SetReasonType(i int) *MediaUpdateOne

SetReasonType sets the "reason_type" field.

func (*MediaUpdateOne) SetRefCount

func (muo *MediaUpdateOne) SetRefCount(i int) *MediaUpdateOne

SetRefCount sets the "ref_count" field.

func (*MediaUpdateOne) SetSavePath

func (muo *MediaUpdateOne) SetSavePath(s string) *MediaUpdateOne

SetSavePath sets the "save_path" field.

func (*MediaUpdateOne) SetSize

func (muo *MediaUpdateOne) SetSize(ss schema.MediaSize) *MediaUpdateOne

SetSize sets the "size" field.

func (*MediaUpdateOne) SetSn

func (muo *MediaUpdateOne) SetSn(s string) *MediaUpdateOne

SetSn sets the "sn" field.

func (*MediaUpdateOne) SetStatus

func (muo *MediaUpdateOne) SetStatus(i int) *MediaUpdateOne

SetStatus sets the "status" field.

func (*MediaUpdateOne) SetType

func (muo *MediaUpdateOne) SetType(i int) *MediaUpdateOne

SetType sets the "type" field.

func (*MediaUpdateOne) SetUpdatedAt

func (muo *MediaUpdateOne) SetUpdatedAt(t time.Time) *MediaUpdateOne

SetUpdatedAt sets the "updated_at" field.

func (*MediaUpdateOne) SetUserID

func (muo *MediaUpdateOne) SetUserID(i int) *MediaUpdateOne

SetUserID sets the "user_id" field.

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 Operator

type Operator struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeleteAt holds the value of the "delete_at" field.
	DeleteAt time.Time `json:"delete_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// Nickname holds the value of the "nickname" field.
	Nickname string `json:"nickname,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// Avatar holds the value of the "avatar" field.
	Avatar string `json:"avatar,omitempty"`
	// RememberToken holds the value of the "remember_token" field.
	RememberToken string `json:"remember_token,omitempty"`
	// contains filtered or unexported fields
}

Operator is the model entity for the Operator schema.

func (*Operator) String

func (o *Operator) String() string

String implements the fmt.Stringer.

func (*Operator) Unwrap

func (o *Operator) Unwrap() *Operator

Unwrap unwraps the Operator 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 (*Operator) Update

func (o *Operator) Update() *OperatorUpdateOne

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

type OperatorClient

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

OperatorClient is a client for the Operator schema.

func NewOperatorClient

func NewOperatorClient(c config) *OperatorClient

NewOperatorClient returns a client for the Operator from the given config.

func (*OperatorClient) Create

func (c *OperatorClient) Create() *OperatorCreate

Create returns a create builder for Operator.

func (*OperatorClient) CreateBulk

func (c *OperatorClient) CreateBulk(builders ...*OperatorCreate) *OperatorCreateBulk

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

func (*OperatorClient) Delete

func (c *OperatorClient) Delete() *OperatorDelete

Delete returns a delete builder for Operator.

func (*OperatorClient) DeleteOne

func (c *OperatorClient) DeleteOne(o *Operator) *OperatorDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*OperatorClient) DeleteOneID

func (c *OperatorClient) DeleteOneID(id int) *OperatorDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*OperatorClient) Get

func (c *OperatorClient) Get(ctx context.Context, id int) (*Operator, error)

Get returns a Operator entity by its id.

func (*OperatorClient) GetX

func (c *OperatorClient) GetX(ctx context.Context, id int) *Operator

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

func (*OperatorClient) Hooks

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

Hooks returns the client hooks.

func (*OperatorClient) Query

func (c *OperatorClient) Query() *OperatorQuery

Query returns a query builder for Operator.

func (*OperatorClient) Update

func (c *OperatorClient) Update() *OperatorUpdate

Update returns an update builder for Operator.

func (*OperatorClient) UpdateOne

func (c *OperatorClient) UpdateOne(o *Operator) *OperatorUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OperatorClient) UpdateOneID

func (c *OperatorClient) UpdateOneID(id int) *OperatorUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OperatorClient) Use

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

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

type OperatorCreate

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

OperatorCreate is the builder for creating a Operator entity.

func (*OperatorCreate) Exec

func (oc *OperatorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OperatorCreate) ExecX

func (oc *OperatorCreate) ExecX(ctx context.Context)

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

func (*OperatorCreate) Mutation

func (oc *OperatorCreate) Mutation() *OperatorMutation

Mutation returns the OperatorMutation object of the builder.

func (*OperatorCreate) Save

func (oc *OperatorCreate) Save(ctx context.Context) (*Operator, error)

Save creates the Operator in the database.

func (*OperatorCreate) SaveX

func (oc *OperatorCreate) SaveX(ctx context.Context) *Operator

SaveX calls Save and panics if Save returns an error.

func (*OperatorCreate) SetAvatar

func (oc *OperatorCreate) SetAvatar(s string) *OperatorCreate

SetAvatar sets the "avatar" field.

func (*OperatorCreate) SetCreatedAt

func (oc *OperatorCreate) SetCreatedAt(t time.Time) *OperatorCreate

SetCreatedAt sets the "created_at" field.

func (*OperatorCreate) SetDeleteAt

func (oc *OperatorCreate) SetDeleteAt(t time.Time) *OperatorCreate

SetDeleteAt sets the "delete_at" field.

func (*OperatorCreate) SetEmail

func (oc *OperatorCreate) SetEmail(s string) *OperatorCreate

SetEmail sets the "email" field.

func (*OperatorCreate) SetName

func (oc *OperatorCreate) SetName(s string) *OperatorCreate

SetName sets the "name" field.

func (*OperatorCreate) SetNickname

func (oc *OperatorCreate) SetNickname(s string) *OperatorCreate

SetNickname sets the "nickname" field.

func (*OperatorCreate) SetNillableAvatar

func (oc *OperatorCreate) SetNillableAvatar(s *string) *OperatorCreate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*OperatorCreate) SetNillableCreatedAt

func (oc *OperatorCreate) SetNillableCreatedAt(t *time.Time) *OperatorCreate

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

func (*OperatorCreate) SetNillableDeleteAt

func (oc *OperatorCreate) SetNillableDeleteAt(t *time.Time) *OperatorCreate

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*OperatorCreate) SetNillableEmail

func (oc *OperatorCreate) SetNillableEmail(s *string) *OperatorCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*OperatorCreate) SetNillableName

func (oc *OperatorCreate) SetNillableName(s *string) *OperatorCreate

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

func (*OperatorCreate) SetNillableNickname

func (oc *OperatorCreate) SetNillableNickname(s *string) *OperatorCreate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*OperatorCreate) SetNillableRememberToken

func (oc *OperatorCreate) SetNillableRememberToken(s *string) *OperatorCreate

SetNillableRememberToken sets the "remember_token" field if the given value is not nil.

func (*OperatorCreate) SetNillableUpdatedAt

func (oc *OperatorCreate) SetNillableUpdatedAt(t *time.Time) *OperatorCreate

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

func (*OperatorCreate) SetPassword

func (oc *OperatorCreate) SetPassword(s string) *OperatorCreate

SetPassword sets the "password" field.

func (*OperatorCreate) SetPhone

func (oc *OperatorCreate) SetPhone(s string) *OperatorCreate

SetPhone sets the "phone" field.

func (*OperatorCreate) SetRememberToken

func (oc *OperatorCreate) SetRememberToken(s string) *OperatorCreate

SetRememberToken sets the "remember_token" field.

func (*OperatorCreate) SetUpdatedAt

func (oc *OperatorCreate) SetUpdatedAt(t time.Time) *OperatorCreate

SetUpdatedAt sets the "updated_at" field.

type OperatorCreateBulk

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

OperatorCreateBulk is the builder for creating many Operator entities in bulk.

func (*OperatorCreateBulk) Exec

func (ocb *OperatorCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OperatorCreateBulk) ExecX

func (ocb *OperatorCreateBulk) ExecX(ctx context.Context)

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

func (*OperatorCreateBulk) Save

func (ocb *OperatorCreateBulk) Save(ctx context.Context) ([]*Operator, error)

Save creates the Operator entities in the database.

func (*OperatorCreateBulk) SaveX

func (ocb *OperatorCreateBulk) SaveX(ctx context.Context) []*Operator

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

type OperatorDelete

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

OperatorDelete is the builder for deleting a Operator entity.

func (*OperatorDelete) Exec

func (od *OperatorDelete) Exec(ctx context.Context) (int, error)

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

func (*OperatorDelete) ExecX

func (od *OperatorDelete) ExecX(ctx context.Context) int

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

func (*OperatorDelete) Where

func (od *OperatorDelete) Where(ps ...predicate.Operator) *OperatorDelete

Where appends a list predicates to the OperatorDelete builder.

type OperatorDeleteOne

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

OperatorDeleteOne is the builder for deleting a single Operator entity.

func (*OperatorDeleteOne) Exec

func (odo *OperatorDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OperatorDeleteOne) ExecX

func (odo *OperatorDeleteOne) ExecX(ctx context.Context)

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

type OperatorGroupBy

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

OperatorGroupBy is the group-by builder for Operator entities.

func (*OperatorGroupBy) Aggregate

func (ogb *OperatorGroupBy) Aggregate(fns ...AggregateFunc) *OperatorGroupBy

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

func (*OperatorGroupBy) Bool

func (ogb *OperatorGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*OperatorGroupBy) BoolX

func (ogb *OperatorGroupBy) BoolX(ctx context.Context) bool

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

func (*OperatorGroupBy) Bools

func (ogb *OperatorGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*OperatorGroupBy) BoolsX

func (ogb *OperatorGroupBy) BoolsX(ctx context.Context) []bool

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

func (*OperatorGroupBy) Float64

func (ogb *OperatorGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*OperatorGroupBy) Float64X

func (ogb *OperatorGroupBy) Float64X(ctx context.Context) float64

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

func (*OperatorGroupBy) Float64s

func (ogb *OperatorGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*OperatorGroupBy) Float64sX

func (ogb *OperatorGroupBy) Float64sX(ctx context.Context) []float64

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

func (*OperatorGroupBy) Int

func (ogb *OperatorGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*OperatorGroupBy) IntX

func (ogb *OperatorGroupBy) IntX(ctx context.Context) int

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

func (*OperatorGroupBy) Ints

func (ogb *OperatorGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*OperatorGroupBy) IntsX

func (ogb *OperatorGroupBy) IntsX(ctx context.Context) []int

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

func (*OperatorGroupBy) Scan

func (ogb *OperatorGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*OperatorGroupBy) ScanX

func (ogb *OperatorGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*OperatorGroupBy) String

func (ogb *OperatorGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*OperatorGroupBy) StringX

func (ogb *OperatorGroupBy) StringX(ctx context.Context) string

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

func (*OperatorGroupBy) Strings

func (ogb *OperatorGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*OperatorGroupBy) StringsX

func (ogb *OperatorGroupBy) StringsX(ctx context.Context) []string

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

type OperatorMutation

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

OperatorMutation represents an operation that mutates the Operator nodes in the graph.

func (*OperatorMutation) AddField

func (m *OperatorMutation) 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 (*OperatorMutation) AddedEdges

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

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

func (*OperatorMutation) AddedField

func (m *OperatorMutation) 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 (*OperatorMutation) AddedFields

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

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

func (*OperatorMutation) AddedIDs

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

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

func (*OperatorMutation) Avatar

func (m *OperatorMutation) Avatar() (r string, exists bool)

Avatar returns the value of the "avatar" field in the mutation.

func (*OperatorMutation) AvatarCleared

func (m *OperatorMutation) AvatarCleared() bool

AvatarCleared returns if the "avatar" field was cleared in this mutation.

func (*OperatorMutation) ClearAvatar

func (m *OperatorMutation) ClearAvatar()

ClearAvatar clears the value of the "avatar" field.

func (*OperatorMutation) ClearCreatedAt

func (m *OperatorMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*OperatorMutation) ClearDeleteAt

func (m *OperatorMutation) ClearDeleteAt()

ClearDeleteAt clears the value of the "delete_at" field.

func (*OperatorMutation) ClearEdge

func (m *OperatorMutation) 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 (*OperatorMutation) ClearEmail

func (m *OperatorMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*OperatorMutation) ClearField

func (m *OperatorMutation) 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 (*OperatorMutation) ClearName

func (m *OperatorMutation) ClearName()

ClearName clears the value of the "name" field.

func (*OperatorMutation) ClearNickname

func (m *OperatorMutation) ClearNickname()

ClearNickname clears the value of the "nickname" field.

func (*OperatorMutation) ClearRememberToken

func (m *OperatorMutation) ClearRememberToken()

ClearRememberToken clears the value of the "remember_token" field.

func (*OperatorMutation) ClearUpdatedAt

func (m *OperatorMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*OperatorMutation) ClearedEdges

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

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

func (*OperatorMutation) ClearedFields

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

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

func (OperatorMutation) Client

func (m OperatorMutation) 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 (*OperatorMutation) CreatedAt

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

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

func (*OperatorMutation) CreatedAtCleared

func (m *OperatorMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*OperatorMutation) DeleteAt

func (m *OperatorMutation) DeleteAt() (r time.Time, exists bool)

DeleteAt returns the value of the "delete_at" field in the mutation.

func (*OperatorMutation) DeleteAtCleared

func (m *OperatorMutation) DeleteAtCleared() bool

DeleteAtCleared returns if the "delete_at" field was cleared in this mutation.

func (*OperatorMutation) EdgeCleared

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

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

func (*OperatorMutation) Email

func (m *OperatorMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*OperatorMutation) EmailCleared

func (m *OperatorMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*OperatorMutation) Field

func (m *OperatorMutation) 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 (*OperatorMutation) FieldCleared

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

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

func (*OperatorMutation) Fields

func (m *OperatorMutation) 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 (*OperatorMutation) ID

func (m *OperatorMutation) ID() (id int, 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 (*OperatorMutation) IDs

func (m *OperatorMutation) IDs(ctx context.Context) ([]int, 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 (*OperatorMutation) Name

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

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

func (*OperatorMutation) NameCleared

func (m *OperatorMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*OperatorMutation) Nickname

func (m *OperatorMutation) Nickname() (r string, exists bool)

Nickname returns the value of the "nickname" field in the mutation.

func (*OperatorMutation) NicknameCleared

func (m *OperatorMutation) NicknameCleared() bool

NicknameCleared returns if the "nickname" field was cleared in this mutation.

func (*OperatorMutation) OldAvatar

func (m *OperatorMutation) OldAvatar(ctx context.Context) (v string, err error)

OldAvatar returns the old "avatar" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldDeleteAt

func (m *OperatorMutation) OldDeleteAt(ctx context.Context) (v time.Time, err error)

OldDeleteAt returns the old "delete_at" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldEmail

func (m *OperatorMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldField

func (m *OperatorMutation) 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 (*OperatorMutation) OldName

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

OldName returns the old "name" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldNickname

func (m *OperatorMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old "nickname" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldPassword

func (m *OperatorMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldPhone

func (m *OperatorMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldRememberToken

func (m *OperatorMutation) OldRememberToken(ctx context.Context) (v string, err error)

OldRememberToken returns the old "remember_token" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the Operator entity. If the Operator 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 (*OperatorMutation) Op

func (m *OperatorMutation) Op() Op

Op returns the operation name.

func (*OperatorMutation) Password

func (m *OperatorMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*OperatorMutation) Phone

func (m *OperatorMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*OperatorMutation) RememberToken

func (m *OperatorMutation) RememberToken() (r string, exists bool)

RememberToken returns the value of the "remember_token" field in the mutation.

func (*OperatorMutation) RememberTokenCleared

func (m *OperatorMutation) RememberTokenCleared() bool

RememberTokenCleared returns if the "remember_token" field was cleared in this mutation.

func (*OperatorMutation) RemovedEdges

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

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

func (*OperatorMutation) RemovedIDs

func (m *OperatorMutation) 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 (*OperatorMutation) ResetAvatar

func (m *OperatorMutation) ResetAvatar()

ResetAvatar resets all changes to the "avatar" field.

func (*OperatorMutation) ResetCreatedAt

func (m *OperatorMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*OperatorMutation) ResetDeleteAt

func (m *OperatorMutation) ResetDeleteAt()

ResetDeleteAt resets all changes to the "delete_at" field.

func (*OperatorMutation) ResetEdge

func (m *OperatorMutation) 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 (*OperatorMutation) ResetEmail

func (m *OperatorMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*OperatorMutation) ResetField

func (m *OperatorMutation) 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 (*OperatorMutation) ResetName

func (m *OperatorMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*OperatorMutation) ResetNickname

func (m *OperatorMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*OperatorMutation) ResetPassword

func (m *OperatorMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*OperatorMutation) ResetPhone

func (m *OperatorMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*OperatorMutation) ResetRememberToken

func (m *OperatorMutation) ResetRememberToken()

ResetRememberToken resets all changes to the "remember_token" field.

func (*OperatorMutation) ResetUpdatedAt

func (m *OperatorMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*OperatorMutation) SetAvatar

func (m *OperatorMutation) SetAvatar(s string)

SetAvatar sets the "avatar" field.

func (*OperatorMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*OperatorMutation) SetDeleteAt

func (m *OperatorMutation) SetDeleteAt(t time.Time)

SetDeleteAt sets the "delete_at" field.

func (*OperatorMutation) SetEmail

func (m *OperatorMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*OperatorMutation) SetField

func (m *OperatorMutation) 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 (*OperatorMutation) SetName

func (m *OperatorMutation) SetName(s string)

SetName sets the "name" field.

func (*OperatorMutation) SetNickname

func (m *OperatorMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*OperatorMutation) SetPassword

func (m *OperatorMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*OperatorMutation) SetPhone

func (m *OperatorMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*OperatorMutation) SetRememberToken

func (m *OperatorMutation) SetRememberToken(s string)

SetRememberToken sets the "remember_token" field.

func (*OperatorMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (OperatorMutation) Tx

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

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

func (*OperatorMutation) Type

func (m *OperatorMutation) Type() string

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

func (*OperatorMutation) UpdatedAt

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

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

func (*OperatorMutation) UpdatedAtCleared

func (m *OperatorMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*OperatorMutation) Where

func (m *OperatorMutation) Where(ps ...predicate.Operator)

Where appends a list predicates to the OperatorMutation builder.

type OperatorQuery

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

OperatorQuery is the builder for querying Operator entities.

func (*OperatorQuery) All

func (oq *OperatorQuery) All(ctx context.Context) ([]*Operator, error)

All executes the query and returns a list of Operators.

func (*OperatorQuery) AllX

func (oq *OperatorQuery) AllX(ctx context.Context) []*Operator

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

func (*OperatorQuery) Clone

func (oq *OperatorQuery) Clone() *OperatorQuery

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

func (*OperatorQuery) Count

func (oq *OperatorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OperatorQuery) CountX

func (oq *OperatorQuery) CountX(ctx context.Context) int

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

func (*OperatorQuery) Exist

func (oq *OperatorQuery) Exist(ctx context.Context) (bool, error)

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

func (*OperatorQuery) ExistX

func (oq *OperatorQuery) ExistX(ctx context.Context) bool

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

func (*OperatorQuery) First

func (oq *OperatorQuery) First(ctx context.Context) (*Operator, error)

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

func (*OperatorQuery) FirstID

func (oq *OperatorQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OperatorQuery) FirstIDX

func (oq *OperatorQuery) FirstIDX(ctx context.Context) int

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

func (*OperatorQuery) FirstX

func (oq *OperatorQuery) FirstX(ctx context.Context) *Operator

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

func (*OperatorQuery) GroupBy

func (oq *OperatorQuery) GroupBy(field string, fields ...string) *OperatorGroupBy

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.Operator.Query().
	GroupBy(operator.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OperatorQuery) IDs

func (oq *OperatorQuery) IDs(ctx context.Context) ([]int, error)

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

func (*OperatorQuery) IDsX

func (oq *OperatorQuery) IDsX(ctx context.Context) []int

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

func (*OperatorQuery) Limit

func (oq *OperatorQuery) Limit(limit int) *OperatorQuery

Limit adds a limit step to the query.

func (*OperatorQuery) Offset

func (oq *OperatorQuery) Offset(offset int) *OperatorQuery

Offset adds an offset step to the query.

func (*OperatorQuery) Only

func (oq *OperatorQuery) Only(ctx context.Context) (*Operator, error)

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

func (*OperatorQuery) OnlyID

func (oq *OperatorQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OperatorQuery) OnlyIDX

func (oq *OperatorQuery) OnlyIDX(ctx context.Context) int

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

func (*OperatorQuery) OnlyX

func (oq *OperatorQuery) OnlyX(ctx context.Context) *Operator

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

func (*OperatorQuery) Order

func (oq *OperatorQuery) Order(o ...OrderFunc) *OperatorQuery

Order adds an order step to the query.

func (*OperatorQuery) Select

func (oq *OperatorQuery) Select(fields ...string) *OperatorSelect

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.Operator.Query().
	Select(operator.FieldCreatedAt).
	Scan(ctx, &v)

func (*OperatorQuery) Unique

func (oq *OperatorQuery) Unique(unique bool) *OperatorQuery

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 (*OperatorQuery) Where

func (oq *OperatorQuery) Where(ps ...predicate.Operator) *OperatorQuery

Where adds a new predicate for the OperatorQuery builder.

type OperatorSelect

type OperatorSelect struct {
	*OperatorQuery
	// contains filtered or unexported fields
}

OperatorSelect is the builder for selecting fields of Operator entities.

func (*OperatorSelect) Bool

func (os *OperatorSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*OperatorSelect) BoolX

func (os *OperatorSelect) BoolX(ctx context.Context) bool

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

func (*OperatorSelect) Bools

func (os *OperatorSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*OperatorSelect) BoolsX

func (os *OperatorSelect) BoolsX(ctx context.Context) []bool

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

func (*OperatorSelect) Float64

func (os *OperatorSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*OperatorSelect) Float64X

func (os *OperatorSelect) Float64X(ctx context.Context) float64

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

func (*OperatorSelect) Float64s

func (os *OperatorSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*OperatorSelect) Float64sX

func (os *OperatorSelect) Float64sX(ctx context.Context) []float64

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

func (*OperatorSelect) Int

func (os *OperatorSelect) Int(ctx context.Context) (_ int, err error)

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

func (*OperatorSelect) IntX

func (os *OperatorSelect) IntX(ctx context.Context) int

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

func (*OperatorSelect) Ints

func (os *OperatorSelect) Ints(ctx context.Context) ([]int, error)

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

func (*OperatorSelect) IntsX

func (os *OperatorSelect) IntsX(ctx context.Context) []int

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

func (*OperatorSelect) Scan

func (os *OperatorSelect) Scan(ctx context.Context, v interface{}) error

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

func (*OperatorSelect) ScanX

func (os *OperatorSelect) ScanX(ctx context.Context, v interface{})

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

func (*OperatorSelect) String

func (os *OperatorSelect) String(ctx context.Context) (_ string, err error)

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

func (*OperatorSelect) StringX

func (os *OperatorSelect) StringX(ctx context.Context) string

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

func (*OperatorSelect) Strings

func (os *OperatorSelect) Strings(ctx context.Context) ([]string, error)

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

func (*OperatorSelect) StringsX

func (os *OperatorSelect) StringsX(ctx context.Context) []string

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

type OperatorUpdate

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

OperatorUpdate is the builder for updating Operator entities.

func (*OperatorUpdate) ClearAvatar

func (ou *OperatorUpdate) ClearAvatar() *OperatorUpdate

ClearAvatar clears the value of the "avatar" field.

func (*OperatorUpdate) ClearDeleteAt

func (ou *OperatorUpdate) ClearDeleteAt() *OperatorUpdate

ClearDeleteAt clears the value of the "delete_at" field.

func (*OperatorUpdate) ClearEmail

func (ou *OperatorUpdate) ClearEmail() *OperatorUpdate

ClearEmail clears the value of the "email" field.

func (*OperatorUpdate) ClearName

func (ou *OperatorUpdate) ClearName() *OperatorUpdate

ClearName clears the value of the "name" field.

func (*OperatorUpdate) ClearNickname

func (ou *OperatorUpdate) ClearNickname() *OperatorUpdate

ClearNickname clears the value of the "nickname" field.

func (*OperatorUpdate) ClearRememberToken

func (ou *OperatorUpdate) ClearRememberToken() *OperatorUpdate

ClearRememberToken clears the value of the "remember_token" field.

func (*OperatorUpdate) ClearUpdatedAt

func (ou *OperatorUpdate) ClearUpdatedAt() *OperatorUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*OperatorUpdate) Exec

func (ou *OperatorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OperatorUpdate) ExecX

func (ou *OperatorUpdate) ExecX(ctx context.Context)

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

func (*OperatorUpdate) Mutation

func (ou *OperatorUpdate) Mutation() *OperatorMutation

Mutation returns the OperatorMutation object of the builder.

func (*OperatorUpdate) Save

func (ou *OperatorUpdate) Save(ctx context.Context) (int, error)

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

func (*OperatorUpdate) SaveX

func (ou *OperatorUpdate) SaveX(ctx context.Context) int

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

func (*OperatorUpdate) SetAvatar

func (ou *OperatorUpdate) SetAvatar(s string) *OperatorUpdate

SetAvatar sets the "avatar" field.

func (*OperatorUpdate) SetDeleteAt

func (ou *OperatorUpdate) SetDeleteAt(t time.Time) *OperatorUpdate

SetDeleteAt sets the "delete_at" field.

func (*OperatorUpdate) SetEmail

func (ou *OperatorUpdate) SetEmail(s string) *OperatorUpdate

SetEmail sets the "email" field.

func (*OperatorUpdate) SetName

func (ou *OperatorUpdate) SetName(s string) *OperatorUpdate

SetName sets the "name" field.

func (*OperatorUpdate) SetNickname

func (ou *OperatorUpdate) SetNickname(s string) *OperatorUpdate

SetNickname sets the "nickname" field.

func (*OperatorUpdate) SetNillableAvatar

func (ou *OperatorUpdate) SetNillableAvatar(s *string) *OperatorUpdate

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*OperatorUpdate) SetNillableDeleteAt

func (ou *OperatorUpdate) SetNillableDeleteAt(t *time.Time) *OperatorUpdate

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*OperatorUpdate) SetNillableEmail

func (ou *OperatorUpdate) SetNillableEmail(s *string) *OperatorUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*OperatorUpdate) SetNillableName

func (ou *OperatorUpdate) SetNillableName(s *string) *OperatorUpdate

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

func (*OperatorUpdate) SetNillableNickname

func (ou *OperatorUpdate) SetNillableNickname(s *string) *OperatorUpdate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*OperatorUpdate) SetNillableRememberToken

func (ou *OperatorUpdate) SetNillableRememberToken(s *string) *OperatorUpdate

SetNillableRememberToken sets the "remember_token" field if the given value is not nil.

func (*OperatorUpdate) SetPassword

func (ou *OperatorUpdate) SetPassword(s string) *OperatorUpdate

SetPassword sets the "password" field.

func (*OperatorUpdate) SetPhone

func (ou *OperatorUpdate) SetPhone(s string) *OperatorUpdate

SetPhone sets the "phone" field.

func (*OperatorUpdate) SetRememberToken

func (ou *OperatorUpdate) SetRememberToken(s string) *OperatorUpdate

SetRememberToken sets the "remember_token" field.

func (*OperatorUpdate) SetUpdatedAt

func (ou *OperatorUpdate) SetUpdatedAt(t time.Time) *OperatorUpdate

SetUpdatedAt sets the "updated_at" field.

func (*OperatorUpdate) Where

func (ou *OperatorUpdate) Where(ps ...predicate.Operator) *OperatorUpdate

Where appends a list predicates to the OperatorUpdate builder.

type OperatorUpdateOne

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

OperatorUpdateOne is the builder for updating a single Operator entity.

func (*OperatorUpdateOne) ClearAvatar

func (ouo *OperatorUpdateOne) ClearAvatar() *OperatorUpdateOne

ClearAvatar clears the value of the "avatar" field.

func (*OperatorUpdateOne) ClearDeleteAt

func (ouo *OperatorUpdateOne) ClearDeleteAt() *OperatorUpdateOne

ClearDeleteAt clears the value of the "delete_at" field.

func (*OperatorUpdateOne) ClearEmail

func (ouo *OperatorUpdateOne) ClearEmail() *OperatorUpdateOne

ClearEmail clears the value of the "email" field.

func (*OperatorUpdateOne) ClearName

func (ouo *OperatorUpdateOne) ClearName() *OperatorUpdateOne

ClearName clears the value of the "name" field.

func (*OperatorUpdateOne) ClearNickname

func (ouo *OperatorUpdateOne) ClearNickname() *OperatorUpdateOne

ClearNickname clears the value of the "nickname" field.

func (*OperatorUpdateOne) ClearRememberToken

func (ouo *OperatorUpdateOne) ClearRememberToken() *OperatorUpdateOne

ClearRememberToken clears the value of the "remember_token" field.

func (*OperatorUpdateOne) ClearUpdatedAt

func (ouo *OperatorUpdateOne) ClearUpdatedAt() *OperatorUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*OperatorUpdateOne) Exec

func (ouo *OperatorUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OperatorUpdateOne) ExecX

func (ouo *OperatorUpdateOne) ExecX(ctx context.Context)

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

func (*OperatorUpdateOne) Mutation

func (ouo *OperatorUpdateOne) Mutation() *OperatorMutation

Mutation returns the OperatorMutation object of the builder.

func (*OperatorUpdateOne) Save

func (ouo *OperatorUpdateOne) Save(ctx context.Context) (*Operator, error)

Save executes the query and returns the updated Operator entity.

func (*OperatorUpdateOne) SaveX

func (ouo *OperatorUpdateOne) SaveX(ctx context.Context) *Operator

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

func (*OperatorUpdateOne) Select

func (ouo *OperatorUpdateOne) Select(field string, fields ...string) *OperatorUpdateOne

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

func (*OperatorUpdateOne) SetAvatar

func (ouo *OperatorUpdateOne) SetAvatar(s string) *OperatorUpdateOne

SetAvatar sets the "avatar" field.

func (*OperatorUpdateOne) SetDeleteAt

func (ouo *OperatorUpdateOne) SetDeleteAt(t time.Time) *OperatorUpdateOne

SetDeleteAt sets the "delete_at" field.

func (*OperatorUpdateOne) SetEmail

func (ouo *OperatorUpdateOne) SetEmail(s string) *OperatorUpdateOne

SetEmail sets the "email" field.

func (*OperatorUpdateOne) SetName

func (ouo *OperatorUpdateOne) SetName(s string) *OperatorUpdateOne

SetName sets the "name" field.

func (*OperatorUpdateOne) SetNickname

func (ouo *OperatorUpdateOne) SetNickname(s string) *OperatorUpdateOne

SetNickname sets the "nickname" field.

func (*OperatorUpdateOne) SetNillableAvatar

func (ouo *OperatorUpdateOne) SetNillableAvatar(s *string) *OperatorUpdateOne

SetNillableAvatar sets the "avatar" field if the given value is not nil.

func (*OperatorUpdateOne) SetNillableDeleteAt

func (ouo *OperatorUpdateOne) SetNillableDeleteAt(t *time.Time) *OperatorUpdateOne

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*OperatorUpdateOne) SetNillableEmail

func (ouo *OperatorUpdateOne) SetNillableEmail(s *string) *OperatorUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*OperatorUpdateOne) SetNillableName

func (ouo *OperatorUpdateOne) SetNillableName(s *string) *OperatorUpdateOne

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

func (*OperatorUpdateOne) SetNillableNickname

func (ouo *OperatorUpdateOne) SetNillableNickname(s *string) *OperatorUpdateOne

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*OperatorUpdateOne) SetNillableRememberToken

func (ouo *OperatorUpdateOne) SetNillableRememberToken(s *string) *OperatorUpdateOne

SetNillableRememberToken sets the "remember_token" field if the given value is not nil.

func (*OperatorUpdateOne) SetPassword

func (ouo *OperatorUpdateOne) SetPassword(s string) *OperatorUpdateOne

SetPassword sets the "password" field.

func (*OperatorUpdateOne) SetPhone

func (ouo *OperatorUpdateOne) SetPhone(s string) *OperatorUpdateOne

SetPhone sets the "phone" field.

func (*OperatorUpdateOne) SetRememberToken

func (ouo *OperatorUpdateOne) SetRememberToken(s string) *OperatorUpdateOne

SetRememberToken sets the "remember_token" field.

func (*OperatorUpdateOne) SetUpdatedAt

func (ouo *OperatorUpdateOne) SetUpdatedAt(t time.Time) *OperatorUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Operators

type Operators []*Operator

Operators is a parsable slice of Operator.

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(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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 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 Tx

type Tx struct {

	// App is the client for interacting with the App builders.
	App *AppClient
	// Media is the client for interacting with the Media builders.
	Media *MediaClient
	// Operator is the client for interacting with the Operator builders.
	Operator *OperatorClient
	// User is the client for interacting with the User builders.
	User *UserClient
	// 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) 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) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type User

type User struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// DeleteAt holds the value of the "delete_at" field.
	DeleteAt time.Time `json:"delete_at,omitempty"`
	// CompanyID holds the value of the "company_id" field.
	CompanyID int `json:"company_id,omitempty"`
	// AppID holds the value of the "app_id" field.
	AppID int `json:"app_id,omitempty"`
	// OutUserID holds the value of the "out_user_id" field.
	OutUserID int `json:"out_user_id,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// Email holds the value of the "email" field.
	Email string `json:"email,omitempty"`
	// Nickname holds the value of the "nickname" field.
	Nickname string `json:"nickname,omitempty"`
	// Phone holds the value of the "phone" field.
	Phone string `json:"phone,omitempty"`
	// contains filtered or unexported fields
}

User is the model entity for the User schema.

func (*User) String

func (u *User) String() string

String implements the fmt.Stringer.

func (*User) Unwrap

func (u *User) Unwrap() *User

Unwrap unwraps the User 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 (*User) Update

func (u *User) Update() *UserUpdateOne

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

type UserClient

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

UserClient is a client for the User schema.

func NewUserClient

func NewUserClient(c config) *UserClient

NewUserClient returns a client for the User from the given config.

func (*UserClient) Create

func (c *UserClient) Create() *UserCreate

Create returns a create builder for User.

func (*UserClient) CreateBulk

func (c *UserClient) CreateBulk(builders ...*UserCreate) *UserCreateBulk

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

func (*UserClient) Delete

func (c *UserClient) Delete() *UserDelete

Delete returns a delete builder for User.

func (*UserClient) DeleteOne

func (c *UserClient) DeleteOne(u *User) *UserDeleteOne

DeleteOne returns a delete builder for the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id int) *UserDeleteOne

DeleteOneID returns a delete builder for the given id.

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id int) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id int) *User

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

func (*UserClient) Hooks

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

Hooks returns the client hooks.

func (*UserClient) Query

func (c *UserClient) Query() *UserQuery

Query returns a query builder for User.

func (*UserClient) Update

func (c *UserClient) Update() *UserUpdate

Update returns an update builder for User.

func (*UserClient) UpdateOne

func (c *UserClient) UpdateOne(u *User) *UserUpdateOne

UpdateOne returns an update builder for the given entity.

func (*UserClient) UpdateOneID

func (c *UserClient) UpdateOneID(id int) *UserUpdateOne

UpdateOneID returns an update builder for the given id.

func (*UserClient) Use

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

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

type UserCreate

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

UserCreate is the builder for creating a User entity.

func (*UserCreate) Exec

func (uc *UserCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreate) ExecX

func (uc *UserCreate) ExecX(ctx context.Context)

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

func (*UserCreate) Mutation

func (uc *UserCreate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserCreate) Save

func (uc *UserCreate) Save(ctx context.Context) (*User, error)

Save creates the User in the database.

func (*UserCreate) SaveX

func (uc *UserCreate) SaveX(ctx context.Context) *User

SaveX calls Save and panics if Save returns an error.

func (*UserCreate) SetAppID

func (uc *UserCreate) SetAppID(i int) *UserCreate

SetAppID sets the "app_id" field.

func (*UserCreate) SetCompanyID

func (uc *UserCreate) SetCompanyID(i int) *UserCreate

SetCompanyID sets the "company_id" field.

func (*UserCreate) SetCreatedAt

func (uc *UserCreate) SetCreatedAt(t time.Time) *UserCreate

SetCreatedAt sets the "created_at" field.

func (*UserCreate) SetDeleteAt

func (uc *UserCreate) SetDeleteAt(t time.Time) *UserCreate

SetDeleteAt sets the "delete_at" field.

func (*UserCreate) SetEmail

func (uc *UserCreate) SetEmail(s string) *UserCreate

SetEmail sets the "email" field.

func (*UserCreate) SetName

func (uc *UserCreate) SetName(s string) *UserCreate

SetName sets the "name" field.

func (*UserCreate) SetNickname

func (uc *UserCreate) SetNickname(s string) *UserCreate

SetNickname sets the "nickname" field.

func (*UserCreate) SetNillableAppID

func (uc *UserCreate) SetNillableAppID(i *int) *UserCreate

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*UserCreate) SetNillableCompanyID

func (uc *UserCreate) SetNillableCompanyID(i *int) *UserCreate

SetNillableCompanyID sets the "company_id" field if the given value is not nil.

func (*UserCreate) SetNillableCreatedAt

func (uc *UserCreate) SetNillableCreatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetNillableDeleteAt

func (uc *UserCreate) SetNillableDeleteAt(t *time.Time) *UserCreate

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*UserCreate) SetNillableEmail

func (uc *UserCreate) SetNillableEmail(s *string) *UserCreate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserCreate) SetNillableName

func (uc *UserCreate) SetNillableName(s *string) *UserCreate

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

func (*UserCreate) SetNillableNickname

func (uc *UserCreate) SetNillableNickname(s *string) *UserCreate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*UserCreate) SetNillableOutUserID

func (uc *UserCreate) SetNillableOutUserID(i *int) *UserCreate

SetNillableOutUserID sets the "out_user_id" field if the given value is not nil.

func (*UserCreate) SetNillableUpdatedAt

func (uc *UserCreate) SetNillableUpdatedAt(t *time.Time) *UserCreate

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

func (*UserCreate) SetOutUserID

func (uc *UserCreate) SetOutUserID(i int) *UserCreate

SetOutUserID sets the "out_user_id" field.

func (*UserCreate) SetPhone

func (uc *UserCreate) SetPhone(s string) *UserCreate

SetPhone sets the "phone" field.

func (*UserCreate) SetUpdatedAt

func (uc *UserCreate) SetUpdatedAt(t time.Time) *UserCreate

SetUpdatedAt sets the "updated_at" field.

type UserCreateBulk

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

UserCreateBulk is the builder for creating many User entities in bulk.

func (*UserCreateBulk) Exec

func (ucb *UserCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*UserCreateBulk) ExecX

func (ucb *UserCreateBulk) ExecX(ctx context.Context)

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

func (*UserCreateBulk) Save

func (ucb *UserCreateBulk) Save(ctx context.Context) ([]*User, error)

Save creates the User entities in the database.

func (*UserCreateBulk) SaveX

func (ucb *UserCreateBulk) SaveX(ctx context.Context) []*User

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

type UserDelete

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

UserDelete is the builder for deleting a User entity.

func (*UserDelete) Exec

func (ud *UserDelete) Exec(ctx context.Context) (int, error)

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

func (*UserDelete) ExecX

func (ud *UserDelete) ExecX(ctx context.Context) int

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

func (*UserDelete) Where

func (ud *UserDelete) Where(ps ...predicate.User) *UserDelete

Where appends a list predicates to the UserDelete builder.

type UserDeleteOne

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

UserDeleteOne is the builder for deleting a single User entity.

func (*UserDeleteOne) Exec

func (udo *UserDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*UserDeleteOne) ExecX

func (udo *UserDeleteOne) ExecX(ctx context.Context)

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

type UserGroupBy

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

UserGroupBy is the group-by builder for User entities.

func (*UserGroupBy) Aggregate

func (ugb *UserGroupBy) Aggregate(fns ...AggregateFunc) *UserGroupBy

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

func (*UserGroupBy) Bool

func (ugb *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) BoolX

func (ugb *UserGroupBy) BoolX(ctx context.Context) bool

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

func (*UserGroupBy) Bools

func (ugb *UserGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) BoolsX

func (ugb *UserGroupBy) BoolsX(ctx context.Context) []bool

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

func (*UserGroupBy) Float64

func (ugb *UserGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64X

func (ugb *UserGroupBy) Float64X(ctx context.Context) float64

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

func (*UserGroupBy) Float64s

func (ugb *UserGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) Float64sX

func (ugb *UserGroupBy) Float64sX(ctx context.Context) []float64

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

func (*UserGroupBy) Int

func (ugb *UserGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntX

func (ugb *UserGroupBy) IntX(ctx context.Context) int

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

func (*UserGroupBy) Ints

func (ugb *UserGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) IntsX

func (ugb *UserGroupBy) IntsX(ctx context.Context) []int

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

func (*UserGroupBy) Scan

func (ugb *UserGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*UserGroupBy) ScanX

func (ugb *UserGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*UserGroupBy) String

func (ugb *UserGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a group-by query. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringX

func (ugb *UserGroupBy) StringX(ctx context.Context) string

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

func (*UserGroupBy) Strings

func (ugb *UserGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from group-by. It is only allowed when executing a group-by query with one field.

func (*UserGroupBy) StringsX

func (ugb *UserGroupBy) StringsX(ctx context.Context) []string

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

type UserMutation

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

UserMutation represents an operation that mutates the User nodes in the graph.

func (*UserMutation) AddAppID

func (m *UserMutation) AddAppID(i int)

AddAppID adds i to the "app_id" field.

func (*UserMutation) AddCompanyID

func (m *UserMutation) AddCompanyID(i int)

AddCompanyID adds i to the "company_id" field.

func (*UserMutation) AddField

func (m *UserMutation) 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 (*UserMutation) AddOutUserID

func (m *UserMutation) AddOutUserID(i int)

AddOutUserID adds i to the "out_user_id" field.

func (*UserMutation) AddedAppID

func (m *UserMutation) AddedAppID() (r int, exists bool)

AddedAppID returns the value that was added to the "app_id" field in this mutation.

func (*UserMutation) AddedCompanyID

func (m *UserMutation) AddedCompanyID() (r int, exists bool)

AddedCompanyID returns the value that was added to the "company_id" field in this mutation.

func (*UserMutation) AddedEdges

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

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

func (*UserMutation) AddedField

func (m *UserMutation) 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 (*UserMutation) AddedFields

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

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

func (*UserMutation) AddedIDs

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

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

func (*UserMutation) AddedOutUserID

func (m *UserMutation) AddedOutUserID() (r int, exists bool)

AddedOutUserID returns the value that was added to the "out_user_id" field in this mutation.

func (*UserMutation) AppID

func (m *UserMutation) AppID() (r int, exists bool)

AppID returns the value of the "app_id" field in the mutation.

func (*UserMutation) AppIDCleared

func (m *UserMutation) AppIDCleared() bool

AppIDCleared returns if the "app_id" field was cleared in this mutation.

func (*UserMutation) ClearAppID

func (m *UserMutation) ClearAppID()

ClearAppID clears the value of the "app_id" field.

func (*UserMutation) ClearCompanyID

func (m *UserMutation) ClearCompanyID()

ClearCompanyID clears the value of the "company_id" field.

func (*UserMutation) ClearCreatedAt

func (m *UserMutation) ClearCreatedAt()

ClearCreatedAt clears the value of the "created_at" field.

func (*UserMutation) ClearDeleteAt

func (m *UserMutation) ClearDeleteAt()

ClearDeleteAt clears the value of the "delete_at" field.

func (*UserMutation) ClearEdge

func (m *UserMutation) 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 (*UserMutation) ClearEmail

func (m *UserMutation) ClearEmail()

ClearEmail clears the value of the "email" field.

func (*UserMutation) ClearField

func (m *UserMutation) 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 (*UserMutation) ClearName

func (m *UserMutation) ClearName()

ClearName clears the value of the "name" field.

func (*UserMutation) ClearNickname

func (m *UserMutation) ClearNickname()

ClearNickname clears the value of the "nickname" field.

func (*UserMutation) ClearOutUserID

func (m *UserMutation) ClearOutUserID()

ClearOutUserID clears the value of the "out_user_id" field.

func (*UserMutation) ClearUpdatedAt

func (m *UserMutation) ClearUpdatedAt()

ClearUpdatedAt clears the value of the "updated_at" field.

func (*UserMutation) ClearedEdges

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

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

func (*UserMutation) ClearedFields

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

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

func (UserMutation) Client

func (m UserMutation) 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 (*UserMutation) CompanyID

func (m *UserMutation) CompanyID() (r int, exists bool)

CompanyID returns the value of the "company_id" field in the mutation.

func (*UserMutation) CompanyIDCleared

func (m *UserMutation) CompanyIDCleared() bool

CompanyIDCleared returns if the "company_id" field was cleared in this mutation.

func (*UserMutation) CreatedAt

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

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

func (*UserMutation) CreatedAtCleared

func (m *UserMutation) CreatedAtCleared() bool

CreatedAtCleared returns if the "created_at" field was cleared in this mutation.

func (*UserMutation) DeleteAt

func (m *UserMutation) DeleteAt() (r time.Time, exists bool)

DeleteAt returns the value of the "delete_at" field in the mutation.

func (*UserMutation) DeleteAtCleared

func (m *UserMutation) DeleteAtCleared() bool

DeleteAtCleared returns if the "delete_at" field was cleared in this mutation.

func (*UserMutation) EdgeCleared

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

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

func (*UserMutation) Email

func (m *UserMutation) Email() (r string, exists bool)

Email returns the value of the "email" field in the mutation.

func (*UserMutation) EmailCleared

func (m *UserMutation) EmailCleared() bool

EmailCleared returns if the "email" field was cleared in this mutation.

func (*UserMutation) Field

func (m *UserMutation) 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 (*UserMutation) FieldCleared

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

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

func (*UserMutation) Fields

func (m *UserMutation) 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 (*UserMutation) ID

func (m *UserMutation) ID() (id int, 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 (*UserMutation) IDs

func (m *UserMutation) IDs(ctx context.Context) ([]int, 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 (*UserMutation) Name

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

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

func (*UserMutation) NameCleared

func (m *UserMutation) NameCleared() bool

NameCleared returns if the "name" field was cleared in this mutation.

func (*UserMutation) Nickname

func (m *UserMutation) Nickname() (r string, exists bool)

Nickname returns the value of the "nickname" field in the mutation.

func (*UserMutation) NicknameCleared

func (m *UserMutation) NicknameCleared() bool

NicknameCleared returns if the "nickname" field was cleared in this mutation.

func (*UserMutation) OldAppID

func (m *UserMutation) OldAppID(ctx context.Context) (v int, err error)

OldAppID returns the old "app_id" field's value of the User entity. If the User 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 (*UserMutation) OldCompanyID

func (m *UserMutation) OldCompanyID(ctx context.Context) (v int, err error)

OldCompanyID returns the old "company_id" field's value of the User entity. If the User 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 (*UserMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the User entity. If the User 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 (*UserMutation) OldDeleteAt

func (m *UserMutation) OldDeleteAt(ctx context.Context) (v time.Time, err error)

OldDeleteAt returns the old "delete_at" field's value of the User entity. If the User 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 (*UserMutation) OldEmail

func (m *UserMutation) OldEmail(ctx context.Context) (v string, err error)

OldEmail returns the old "email" field's value of the User entity. If the User 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 (*UserMutation) OldField

func (m *UserMutation) 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 (*UserMutation) OldName

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

OldName returns the old "name" field's value of the User entity. If the User 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 (*UserMutation) OldNickname

func (m *UserMutation) OldNickname(ctx context.Context) (v string, err error)

OldNickname returns the old "nickname" field's value of the User entity. If the User 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 (*UserMutation) OldOutUserID

func (m *UserMutation) OldOutUserID(ctx context.Context) (v int, err error)

OldOutUserID returns the old "out_user_id" field's value of the User entity. If the User 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 (*UserMutation) OldPhone

func (m *UserMutation) OldPhone(ctx context.Context) (v string, err error)

OldPhone returns the old "phone" field's value of the User entity. If the User 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 (*UserMutation) OldUpdatedAt

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

OldUpdatedAt returns the old "updated_at" field's value of the User entity. If the User 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 (*UserMutation) Op

func (m *UserMutation) Op() Op

Op returns the operation name.

func (*UserMutation) OutUserID

func (m *UserMutation) OutUserID() (r int, exists bool)

OutUserID returns the value of the "out_user_id" field in the mutation.

func (*UserMutation) OutUserIDCleared

func (m *UserMutation) OutUserIDCleared() bool

OutUserIDCleared returns if the "out_user_id" field was cleared in this mutation.

func (*UserMutation) Phone

func (m *UserMutation) Phone() (r string, exists bool)

Phone returns the value of the "phone" field in the mutation.

func (*UserMutation) RemovedEdges

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

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

func (*UserMutation) RemovedIDs

func (m *UserMutation) 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 (*UserMutation) ResetAppID

func (m *UserMutation) ResetAppID()

ResetAppID resets all changes to the "app_id" field.

func (*UserMutation) ResetCompanyID

func (m *UserMutation) ResetCompanyID()

ResetCompanyID resets all changes to the "company_id" field.

func (*UserMutation) ResetCreatedAt

func (m *UserMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*UserMutation) ResetDeleteAt

func (m *UserMutation) ResetDeleteAt()

ResetDeleteAt resets all changes to the "delete_at" field.

func (*UserMutation) ResetEdge

func (m *UserMutation) 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 (*UserMutation) ResetEmail

func (m *UserMutation) ResetEmail()

ResetEmail resets all changes to the "email" field.

func (*UserMutation) ResetField

func (m *UserMutation) 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 (*UserMutation) ResetName

func (m *UserMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*UserMutation) ResetNickname

func (m *UserMutation) ResetNickname()

ResetNickname resets all changes to the "nickname" field.

func (*UserMutation) ResetOutUserID

func (m *UserMutation) ResetOutUserID()

ResetOutUserID resets all changes to the "out_user_id" field.

func (*UserMutation) ResetPhone

func (m *UserMutation) ResetPhone()

ResetPhone resets all changes to the "phone" field.

func (*UserMutation) ResetUpdatedAt

func (m *UserMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*UserMutation) SetAppID

func (m *UserMutation) SetAppID(i int)

SetAppID sets the "app_id" field.

func (*UserMutation) SetCompanyID

func (m *UserMutation) SetCompanyID(i int)

SetCompanyID sets the "company_id" field.

func (*UserMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*UserMutation) SetDeleteAt

func (m *UserMutation) SetDeleteAt(t time.Time)

SetDeleteAt sets the "delete_at" field.

func (*UserMutation) SetEmail

func (m *UserMutation) SetEmail(s string)

SetEmail sets the "email" field.

func (*UserMutation) SetField

func (m *UserMutation) 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 (*UserMutation) SetName

func (m *UserMutation) SetName(s string)

SetName sets the "name" field.

func (*UserMutation) SetNickname

func (m *UserMutation) SetNickname(s string)

SetNickname sets the "nickname" field.

func (*UserMutation) SetOutUserID

func (m *UserMutation) SetOutUserID(i int)

SetOutUserID sets the "out_user_id" field.

func (*UserMutation) SetPhone

func (m *UserMutation) SetPhone(s string)

SetPhone sets the "phone" field.

func (*UserMutation) SetUpdatedAt

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

SetUpdatedAt sets the "updated_at" field.

func (UserMutation) Tx

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

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

func (*UserMutation) Type

func (m *UserMutation) Type() string

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

func (*UserMutation) UpdatedAt

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

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

func (*UserMutation) UpdatedAtCleared

func (m *UserMutation) UpdatedAtCleared() bool

UpdatedAtCleared returns if the "updated_at" field was cleared in this mutation.

func (*UserMutation) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) All

func (uq *UserQuery) All(ctx context.Context) ([]*User, error)

All executes the query and returns a list of Users.

func (*UserQuery) AllX

func (uq *UserQuery) AllX(ctx context.Context) []*User

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

func (*UserQuery) Clone

func (uq *UserQuery) Clone() *UserQuery

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

func (*UserQuery) Count

func (uq *UserQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*UserQuery) CountX

func (uq *UserQuery) CountX(ctx context.Context) int

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

func (*UserQuery) Exist

func (uq *UserQuery) Exist(ctx context.Context) (bool, error)

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

func (*UserQuery) ExistX

func (uq *UserQuery) ExistX(ctx context.Context) bool

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

func (*UserQuery) First

func (uq *UserQuery) First(ctx context.Context) (*User, error)

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

func (*UserQuery) FirstID

func (uq *UserQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*UserQuery) FirstIDX

func (uq *UserQuery) FirstIDX(ctx context.Context) int

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

func (*UserQuery) FirstX

func (uq *UserQuery) FirstX(ctx context.Context) *User

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

func (*UserQuery) GroupBy

func (uq *UserQuery) GroupBy(field string, fields ...string) *UserGroupBy

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.User.Query().
	GroupBy(user.FieldCreatedAt).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) ([]int, error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []int

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

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

Limit adds a limit step to the query.

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset adds an offset step to the query.

func (*UserQuery) Only

func (uq *UserQuery) Only(ctx context.Context) (*User, error)

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

func (*UserQuery) OnlyID

func (uq *UserQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*UserQuery) OnlyIDX

func (uq *UserQuery) OnlyIDX(ctx context.Context) int

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

func (*UserQuery) OnlyX

func (uq *UserQuery) OnlyX(ctx context.Context) *User

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

func (*UserQuery) Order

func (uq *UserQuery) Order(o ...OrderFunc) *UserQuery

Order adds an order step to the query.

func (*UserQuery) Select

func (uq *UserQuery) Select(fields ...string) *UserSelect

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.User.Query().
	Select(user.FieldCreatedAt).
	Scan(ctx, &v)

func (*UserQuery) Unique

func (uq *UserQuery) Unique(unique bool) *UserQuery

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 (*UserQuery) Where

func (uq *UserQuery) Where(ps ...predicate.User) *UserQuery

Where adds a new predicate for the UserQuery builder.

type UserSelect

type UserSelect struct {
	*UserQuery
	// contains filtered or unexported fields
}

UserSelect is the builder for selecting fields of User entities.

func (*UserSelect) Bool

func (us *UserSelect) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserSelect) BoolX

func (us *UserSelect) BoolX(ctx context.Context) bool

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

func (*UserSelect) Bools

func (us *UserSelect) Bools(ctx context.Context) ([]bool, error)

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

func (*UserSelect) BoolsX

func (us *UserSelect) BoolsX(ctx context.Context) []bool

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

func (*UserSelect) Float64

func (us *UserSelect) Float64(ctx context.Context) (_ float64, err error)

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

func (*UserSelect) Float64X

func (us *UserSelect) Float64X(ctx context.Context) float64

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

func (*UserSelect) Float64s

func (us *UserSelect) Float64s(ctx context.Context) ([]float64, error)

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

func (*UserSelect) Float64sX

func (us *UserSelect) Float64sX(ctx context.Context) []float64

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

func (*UserSelect) Int

func (us *UserSelect) Int(ctx context.Context) (_ int, err error)

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

func (*UserSelect) IntX

func (us *UserSelect) IntX(ctx context.Context) int

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

func (*UserSelect) Ints

func (us *UserSelect) Ints(ctx context.Context) ([]int, error)

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

func (*UserSelect) IntsX

func (us *UserSelect) IntsX(ctx context.Context) []int

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

func (*UserSelect) Scan

func (us *UserSelect) Scan(ctx context.Context, v interface{}) error

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

func (*UserSelect) ScanX

func (us *UserSelect) ScanX(ctx context.Context, v interface{})

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

func (*UserSelect) String

func (us *UserSelect) String(ctx context.Context) (_ string, err error)

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

func (*UserSelect) StringX

func (us *UserSelect) StringX(ctx context.Context) string

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

func (*UserSelect) Strings

func (us *UserSelect) Strings(ctx context.Context) ([]string, error)

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

func (*UserSelect) StringsX

func (us *UserSelect) StringsX(ctx context.Context) []string

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

type UserUpdate

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

UserUpdate is the builder for updating User entities.

func (*UserUpdate) AddAppID

func (uu *UserUpdate) AddAppID(i int) *UserUpdate

AddAppID adds i to the "app_id" field.

func (*UserUpdate) AddCompanyID

func (uu *UserUpdate) AddCompanyID(i int) *UserUpdate

AddCompanyID adds i to the "company_id" field.

func (*UserUpdate) AddOutUserID

func (uu *UserUpdate) AddOutUserID(i int) *UserUpdate

AddOutUserID adds i to the "out_user_id" field.

func (*UserUpdate) ClearAppID

func (uu *UserUpdate) ClearAppID() *UserUpdate

ClearAppID clears the value of the "app_id" field.

func (*UserUpdate) ClearCompanyID

func (uu *UserUpdate) ClearCompanyID() *UserUpdate

ClearCompanyID clears the value of the "company_id" field.

func (*UserUpdate) ClearDeleteAt

func (uu *UserUpdate) ClearDeleteAt() *UserUpdate

ClearDeleteAt clears the value of the "delete_at" field.

func (*UserUpdate) ClearEmail

func (uu *UserUpdate) ClearEmail() *UserUpdate

ClearEmail clears the value of the "email" field.

func (*UserUpdate) ClearName

func (uu *UserUpdate) ClearName() *UserUpdate

ClearName clears the value of the "name" field.

func (*UserUpdate) ClearNickname

func (uu *UserUpdate) ClearNickname() *UserUpdate

ClearNickname clears the value of the "nickname" field.

func (*UserUpdate) ClearOutUserID

func (uu *UserUpdate) ClearOutUserID() *UserUpdate

ClearOutUserID clears the value of the "out_user_id" field.

func (*UserUpdate) ClearUpdatedAt

func (uu *UserUpdate) ClearUpdatedAt() *UserUpdate

ClearUpdatedAt clears the value of the "updated_at" field.

func (*UserUpdate) Exec

func (uu *UserUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*UserUpdate) ExecX

func (uu *UserUpdate) ExecX(ctx context.Context)

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

func (*UserUpdate) Mutation

func (uu *UserUpdate) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdate) Save

func (uu *UserUpdate) Save(ctx context.Context) (int, error)

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

func (*UserUpdate) SaveX

func (uu *UserUpdate) SaveX(ctx context.Context) int

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

func (*UserUpdate) SetAppID

func (uu *UserUpdate) SetAppID(i int) *UserUpdate

SetAppID sets the "app_id" field.

func (*UserUpdate) SetCompanyID

func (uu *UserUpdate) SetCompanyID(i int) *UserUpdate

SetCompanyID sets the "company_id" field.

func (*UserUpdate) SetDeleteAt

func (uu *UserUpdate) SetDeleteAt(t time.Time) *UserUpdate

SetDeleteAt sets the "delete_at" field.

func (*UserUpdate) SetEmail

func (uu *UserUpdate) SetEmail(s string) *UserUpdate

SetEmail sets the "email" field.

func (*UserUpdate) SetName

func (uu *UserUpdate) SetName(s string) *UserUpdate

SetName sets the "name" field.

func (*UserUpdate) SetNickname

func (uu *UserUpdate) SetNickname(s string) *UserUpdate

SetNickname sets the "nickname" field.

func (*UserUpdate) SetNillableAppID

func (uu *UserUpdate) SetNillableAppID(i *int) *UserUpdate

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*UserUpdate) SetNillableCompanyID

func (uu *UserUpdate) SetNillableCompanyID(i *int) *UserUpdate

SetNillableCompanyID sets the "company_id" field if the given value is not nil.

func (*UserUpdate) SetNillableDeleteAt

func (uu *UserUpdate) SetNillableDeleteAt(t *time.Time) *UserUpdate

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*UserUpdate) SetNillableEmail

func (uu *UserUpdate) SetNillableEmail(s *string) *UserUpdate

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdate) SetNillableName

func (uu *UserUpdate) SetNillableName(s *string) *UserUpdate

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

func (*UserUpdate) SetNillableNickname

func (uu *UserUpdate) SetNillableNickname(s *string) *UserUpdate

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*UserUpdate) SetNillableOutUserID

func (uu *UserUpdate) SetNillableOutUserID(i *int) *UserUpdate

SetNillableOutUserID sets the "out_user_id" field if the given value is not nil.

func (*UserUpdate) SetOutUserID

func (uu *UserUpdate) SetOutUserID(i int) *UserUpdate

SetOutUserID sets the "out_user_id" field.

func (*UserUpdate) SetPhone

func (uu *UserUpdate) SetPhone(s string) *UserUpdate

SetPhone sets the "phone" field.

func (*UserUpdate) SetUpdatedAt

func (uu *UserUpdate) SetUpdatedAt(t time.Time) *UserUpdate

SetUpdatedAt sets the "updated_at" field.

func (*UserUpdate) Where

func (uu *UserUpdate) Where(ps ...predicate.User) *UserUpdate

Where appends a list predicates to the UserUpdate builder.

type UserUpdateOne

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

UserUpdateOne is the builder for updating a single User entity.

func (*UserUpdateOne) AddAppID

func (uuo *UserUpdateOne) AddAppID(i int) *UserUpdateOne

AddAppID adds i to the "app_id" field.

func (*UserUpdateOne) AddCompanyID

func (uuo *UserUpdateOne) AddCompanyID(i int) *UserUpdateOne

AddCompanyID adds i to the "company_id" field.

func (*UserUpdateOne) AddOutUserID

func (uuo *UserUpdateOne) AddOutUserID(i int) *UserUpdateOne

AddOutUserID adds i to the "out_user_id" field.

func (*UserUpdateOne) ClearAppID

func (uuo *UserUpdateOne) ClearAppID() *UserUpdateOne

ClearAppID clears the value of the "app_id" field.

func (*UserUpdateOne) ClearCompanyID

func (uuo *UserUpdateOne) ClearCompanyID() *UserUpdateOne

ClearCompanyID clears the value of the "company_id" field.

func (*UserUpdateOne) ClearDeleteAt

func (uuo *UserUpdateOne) ClearDeleteAt() *UserUpdateOne

ClearDeleteAt clears the value of the "delete_at" field.

func (*UserUpdateOne) ClearEmail

func (uuo *UserUpdateOne) ClearEmail() *UserUpdateOne

ClearEmail clears the value of the "email" field.

func (*UserUpdateOne) ClearName

func (uuo *UserUpdateOne) ClearName() *UserUpdateOne

ClearName clears the value of the "name" field.

func (*UserUpdateOne) ClearNickname

func (uuo *UserUpdateOne) ClearNickname() *UserUpdateOne

ClearNickname clears the value of the "nickname" field.

func (*UserUpdateOne) ClearOutUserID

func (uuo *UserUpdateOne) ClearOutUserID() *UserUpdateOne

ClearOutUserID clears the value of the "out_user_id" field.

func (*UserUpdateOne) ClearUpdatedAt

func (uuo *UserUpdateOne) ClearUpdatedAt() *UserUpdateOne

ClearUpdatedAt clears the value of the "updated_at" field.

func (*UserUpdateOne) Exec

func (uuo *UserUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*UserUpdateOne) ExecX

func (uuo *UserUpdateOne) ExecX(ctx context.Context)

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

func (*UserUpdateOne) Mutation

func (uuo *UserUpdateOne) Mutation() *UserMutation

Mutation returns the UserMutation object of the builder.

func (*UserUpdateOne) Save

func (uuo *UserUpdateOne) Save(ctx context.Context) (*User, error)

Save executes the query and returns the updated User entity.

func (*UserUpdateOne) SaveX

func (uuo *UserUpdateOne) SaveX(ctx context.Context) *User

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

func (*UserUpdateOne) Select

func (uuo *UserUpdateOne) Select(field string, fields ...string) *UserUpdateOne

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

func (*UserUpdateOne) SetAppID

func (uuo *UserUpdateOne) SetAppID(i int) *UserUpdateOne

SetAppID sets the "app_id" field.

func (*UserUpdateOne) SetCompanyID

func (uuo *UserUpdateOne) SetCompanyID(i int) *UserUpdateOne

SetCompanyID sets the "company_id" field.

func (*UserUpdateOne) SetDeleteAt

func (uuo *UserUpdateOne) SetDeleteAt(t time.Time) *UserUpdateOne

SetDeleteAt sets the "delete_at" field.

func (*UserUpdateOne) SetEmail

func (uuo *UserUpdateOne) SetEmail(s string) *UserUpdateOne

SetEmail sets the "email" field.

func (*UserUpdateOne) SetName

func (uuo *UserUpdateOne) SetName(s string) *UserUpdateOne

SetName sets the "name" field.

func (*UserUpdateOne) SetNickname

func (uuo *UserUpdateOne) SetNickname(s string) *UserUpdateOne

SetNickname sets the "nickname" field.

func (*UserUpdateOne) SetNillableAppID

func (uuo *UserUpdateOne) SetNillableAppID(i *int) *UserUpdateOne

SetNillableAppID sets the "app_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCompanyID

func (uuo *UserUpdateOne) SetNillableCompanyID(i *int) *UserUpdateOne

SetNillableCompanyID sets the "company_id" field if the given value is not nil.

func (*UserUpdateOne) SetNillableDeleteAt

func (uuo *UserUpdateOne) SetNillableDeleteAt(t *time.Time) *UserUpdateOne

SetNillableDeleteAt sets the "delete_at" field if the given value is not nil.

func (*UserUpdateOne) SetNillableEmail

func (uuo *UserUpdateOne) SetNillableEmail(s *string) *UserUpdateOne

SetNillableEmail sets the "email" field if the given value is not nil.

func (*UserUpdateOne) SetNillableName

func (uuo *UserUpdateOne) SetNillableName(s *string) *UserUpdateOne

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

func (*UserUpdateOne) SetNillableNickname

func (uuo *UserUpdateOne) SetNillableNickname(s *string) *UserUpdateOne

SetNillableNickname sets the "nickname" field if the given value is not nil.

func (*UserUpdateOne) SetNillableOutUserID

func (uuo *UserUpdateOne) SetNillableOutUserID(i *int) *UserUpdateOne

SetNillableOutUserID sets the "out_user_id" field if the given value is not nil.

func (*UserUpdateOne) SetOutUserID

func (uuo *UserUpdateOne) SetOutUserID(i int) *UserUpdateOne

SetOutUserID sets the "out_user_id" field.

func (*UserUpdateOne) SetPhone

func (uuo *UserUpdateOne) SetPhone(s string) *UserUpdateOne

SetPhone sets the "phone" field.

func (*UserUpdateOne) SetUpdatedAt

func (uuo *UserUpdateOne) SetUpdatedAt(t time.Time) *UserUpdateOne

SetUpdatedAt sets the "updated_at" field.

type Users

type Users []*User

Users is a parsable slice of User.

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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