gen

package
v0.14.5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: Apache-2.0 Imports: 20 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.
	TypeUser = "User"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// 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().
	User.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) 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 InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...any)) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector. Deprecated: Use Asc/Desc functions or the package builders instead.

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// 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.
	// User ID
	ID uint `json:"id,omitempty"`
	// Mnemonic words
	Words string `json:"words,omitempty"`
	// Network type
	Network string `json:"network,omitempty"`
	// User address
	Address string `json:"address,omitempty"`
	// User private key
	PrivateKey string `json:"private_key,omitempty"`
	// 主币余额
	Balance decimal.Decimal `json:"balance,omitempty"`
	// 主币余额更新时间
	BalanceUpdateTime int `json:"balance_update_time,omitempty"`
	// 代币信息:名称/余额/更新时间
	TokenInfo map[string]interface{} `json:"token_info,omitempty"`
	// Creation time
	CreateTime int `json:"create_time,omitempty"`
	// Creation date
	CreateDate time.Time `json:"create_date,omitempty"`
	// 是否发起过转账
	IsTransfer int8 `json:"is_transfer,omitempty"`
	// 代币总价值
	TotalTokenValue decimal.Decimal `json:"total_token_value,omitempty"`
	// 波场模式:归集/锁定
	TrxMode user.TrxMode `json:"trx_mode,omitempty"`
	// 波场地址类型:单签/多签
	TrxAddrType user.TrxAddrType `json:"trx_addr_type,omitempty"`
	// Private address for transactions
	TrxPrivAddr string `json:"trx_priv_addr,omitempty"`
	// Private key for transactions
	TrxPrivPkey string `json:"trx_priv_pkey,omitempty"`
	// AES encryption type
	AesType int8 `json:"aes_type,omitempty"`
	// 是否可以领取空投:0 未知 1是/2否
	CanClaimAirdrop int8 `json:"can_claim_airdrop,omitempty"`
	// 下次可以领取空投时间
	NextAirdropClaimTime int `json:"next_airdrop_claim_time,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.

func (*User) Value

func (u *User) Value(name string) (ent.Value, error)

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

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 builder for creating a User entity.

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 builder for deleting the given entity.

func (*UserClient) DeleteOneID

func (c *UserClient) DeleteOneID(id uint) *UserDeleteOne

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

func (*UserClient) Get

func (c *UserClient) Get(ctx context.Context, id uint) (*User, error)

Get returns a User entity by its id.

func (*UserClient) GetX

func (c *UserClient) GetX(ctx context.Context, id uint) *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) Intercept

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

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

func (*UserClient) Interceptors

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

Interceptors returns the client interceptors.

func (*UserClient) MapCreateBulk

func (c *UserClient) MapCreateBulk(slice any, setFunc func(*UserCreate, int)) *UserCreateBulk

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

func (*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 uint) *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) SetAddress

func (uc *UserCreate) SetAddress(s string) *UserCreate

SetAddress sets the "address" field.

func (*UserCreate) SetAesType

func (uc *UserCreate) SetAesType(i int8) *UserCreate

SetAesType sets the "aes_type" field.

func (*UserCreate) SetBalance

func (uc *UserCreate) SetBalance(d decimal.Decimal) *UserCreate

SetBalance sets the "balance" field.

func (*UserCreate) SetBalanceUpdateTime

func (uc *UserCreate) SetBalanceUpdateTime(i int) *UserCreate

SetBalanceUpdateTime sets the "balance_update_time" field.

func (*UserCreate) SetCanClaimAirdrop added in v0.14.3

func (uc *UserCreate) SetCanClaimAirdrop(i int8) *UserCreate

SetCanClaimAirdrop sets the "can_claim_airdrop" field.

func (*UserCreate) SetCreateDate

func (uc *UserCreate) SetCreateDate(t time.Time) *UserCreate

SetCreateDate sets the "create_date" field.

func (*UserCreate) SetCreateTime

func (uc *UserCreate) SetCreateTime(i int) *UserCreate

SetCreateTime sets the "create_time" field.

func (*UserCreate) SetID

func (uc *UserCreate) SetID(u uint) *UserCreate

SetID sets the "id" field.

func (*UserCreate) SetIsTransfer

func (uc *UserCreate) SetIsTransfer(i int8) *UserCreate

SetIsTransfer sets the "is_transfer" field.

func (*UserCreate) SetNetwork

func (uc *UserCreate) SetNetwork(s string) *UserCreate

SetNetwork sets the "network" field.

func (*UserCreate) SetNextAirdropClaimTime added in v0.14.3

func (uc *UserCreate) SetNextAirdropClaimTime(i int) *UserCreate

SetNextAirdropClaimTime sets the "next_airdrop_claim_time" field.

func (*UserCreate) SetNillableAddress

func (uc *UserCreate) SetNillableAddress(s *string) *UserCreate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*UserCreate) SetNillableAesType

func (uc *UserCreate) SetNillableAesType(i *int8) *UserCreate

SetNillableAesType sets the "aes_type" field if the given value is not nil.

func (*UserCreate) SetNillableBalance

func (uc *UserCreate) SetNillableBalance(d *decimal.Decimal) *UserCreate

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*UserCreate) SetNillableBalanceUpdateTime

func (uc *UserCreate) SetNillableBalanceUpdateTime(i *int) *UserCreate

SetNillableBalanceUpdateTime sets the "balance_update_time" field if the given value is not nil.

func (*UserCreate) SetNillableCanClaimAirdrop added in v0.14.3

func (uc *UserCreate) SetNillableCanClaimAirdrop(i *int8) *UserCreate

SetNillableCanClaimAirdrop sets the "can_claim_airdrop" field if the given value is not nil.

func (*UserCreate) SetNillableCreateDate

func (uc *UserCreate) SetNillableCreateDate(t *time.Time) *UserCreate

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserCreate) SetNillableCreateTime

func (uc *UserCreate) SetNillableCreateTime(i *int) *UserCreate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserCreate) SetNillableIsTransfer

func (uc *UserCreate) SetNillableIsTransfer(i *int8) *UserCreate

SetNillableIsTransfer sets the "is_transfer" field if the given value is not nil.

func (*UserCreate) SetNillableNetwork

func (uc *UserCreate) SetNillableNetwork(s *string) *UserCreate

SetNillableNetwork sets the "network" field if the given value is not nil.

func (*UserCreate) SetNillableNextAirdropClaimTime added in v0.14.3

func (uc *UserCreate) SetNillableNextAirdropClaimTime(i *int) *UserCreate

SetNillableNextAirdropClaimTime sets the "next_airdrop_claim_time" field if the given value is not nil.

func (*UserCreate) SetNillablePrivateKey

func (uc *UserCreate) SetNillablePrivateKey(s *string) *UserCreate

SetNillablePrivateKey sets the "private_key" field if the given value is not nil.

func (*UserCreate) SetNillableTotalTokenValue

func (uc *UserCreate) SetNillableTotalTokenValue(d *decimal.Decimal) *UserCreate

SetNillableTotalTokenValue sets the "total_token_value" field if the given value is not nil.

func (*UserCreate) SetNillableTrxAddrType

func (uc *UserCreate) SetNillableTrxAddrType(uat *user.TrxAddrType) *UserCreate

SetNillableTrxAddrType sets the "trx_addr_type" field if the given value is not nil.

func (*UserCreate) SetNillableTrxMode

func (uc *UserCreate) SetNillableTrxMode(um *user.TrxMode) *UserCreate

SetNillableTrxMode sets the "trx_mode" field if the given value is not nil.

func (*UserCreate) SetNillableTrxPrivAddr

func (uc *UserCreate) SetNillableTrxPrivAddr(s *string) *UserCreate

SetNillableTrxPrivAddr sets the "trx_priv_addr" field if the given value is not nil.

func (*UserCreate) SetNillableTrxPrivPkey

func (uc *UserCreate) SetNillableTrxPrivPkey(s *string) *UserCreate

SetNillableTrxPrivPkey sets the "trx_priv_pkey" field if the given value is not nil.

func (*UserCreate) SetNillableWords

func (uc *UserCreate) SetNillableWords(s *string) *UserCreate

SetNillableWords sets the "words" field if the given value is not nil.

func (*UserCreate) SetPrivateKey

func (uc *UserCreate) SetPrivateKey(s string) *UserCreate

SetPrivateKey sets the "private_key" field.

func (*UserCreate) SetTokenInfo

func (uc *UserCreate) SetTokenInfo(m map[string]interface{}) *UserCreate

SetTokenInfo sets the "token_info" field.

func (*UserCreate) SetTotalTokenValue

func (uc *UserCreate) SetTotalTokenValue(d decimal.Decimal) *UserCreate

SetTotalTokenValue sets the "total_token_value" field.

func (*UserCreate) SetTrxAddrType

func (uc *UserCreate) SetTrxAddrType(uat user.TrxAddrType) *UserCreate

SetTrxAddrType sets the "trx_addr_type" field.

func (*UserCreate) SetTrxMode

func (uc *UserCreate) SetTrxMode(um user.TrxMode) *UserCreate

SetTrxMode sets the "trx_mode" field.

func (*UserCreate) SetTrxPrivAddr

func (uc *UserCreate) SetTrxPrivAddr(s string) *UserCreate

SetTrxPrivAddr sets the "trx_priv_addr" field.

func (*UserCreate) SetTrxPrivPkey

func (uc *UserCreate) SetTrxPrivPkey(s string) *UserCreate

SetTrxPrivPkey sets the "trx_priv_pkey" field.

func (*UserCreate) SetWords

func (uc *UserCreate) SetWords(s string) *UserCreate

SetWords sets the "words" 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.

func (*UserDeleteOne) Where

func (udo *UserDeleteOne) Where(ps ...predicate.User) *UserDeleteOne

Where appends a list predicates to the UserDelete builder.

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 (s *UserGroupBy) Bool(ctx context.Context) (_ bool, err error)

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

func (*UserGroupBy) BoolX

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

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

func (*UserGroupBy) Bools

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

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

func (*UserGroupBy) BoolsX

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

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

func (*UserGroupBy) Float64

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

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

func (*UserGroupBy) Float64X

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

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

func (*UserGroupBy) Float64s

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

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

func (*UserGroupBy) Float64sX

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

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

func (*UserGroupBy) Int

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

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

func (*UserGroupBy) IntX

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

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

func (*UserGroupBy) Ints

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

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

func (*UserGroupBy) IntsX

func (s *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 any) error

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

func (*UserGroupBy) ScanX

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

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

func (*UserGroupBy) String

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

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

func (*UserGroupBy) StringX

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

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

func (*UserGroupBy) Strings

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

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

func (*UserGroupBy) StringsX

func (s *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) AddAesType

func (m *UserMutation) AddAesType(i int8)

AddAesType adds i to the "aes_type" field.

func (*UserMutation) AddBalanceUpdateTime

func (m *UserMutation) AddBalanceUpdateTime(i int)

AddBalanceUpdateTime adds i to the "balance_update_time" field.

func (*UserMutation) AddCanClaimAirdrop added in v0.14.3

func (m *UserMutation) AddCanClaimAirdrop(i int8)

AddCanClaimAirdrop adds i to the "can_claim_airdrop" field.

func (*UserMutation) AddCreateTime

func (m *UserMutation) AddCreateTime(i int)

AddCreateTime adds i to the "create_time" 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) AddIsTransfer

func (m *UserMutation) AddIsTransfer(i int8)

AddIsTransfer adds i to the "is_transfer" field.

func (*UserMutation) AddNextAirdropClaimTime added in v0.14.3

func (m *UserMutation) AddNextAirdropClaimTime(i int)

AddNextAirdropClaimTime adds i to the "next_airdrop_claim_time" field.

func (*UserMutation) AddedAesType

func (m *UserMutation) AddedAesType() (r int8, exists bool)

AddedAesType returns the value that was added to the "aes_type" field in this mutation.

func (*UserMutation) AddedBalanceUpdateTime

func (m *UserMutation) AddedBalanceUpdateTime() (r int, exists bool)

AddedBalanceUpdateTime returns the value that was added to the "balance_update_time" field in this mutation.

func (*UserMutation) AddedCanClaimAirdrop added in v0.14.3

func (m *UserMutation) AddedCanClaimAirdrop() (r int8, exists bool)

AddedCanClaimAirdrop returns the value that was added to the "can_claim_airdrop" field in this mutation.

func (*UserMutation) AddedCreateTime

func (m *UserMutation) AddedCreateTime() (r int, exists bool)

AddedCreateTime returns the value that was added to the "create_time" 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) AddedIsTransfer

func (m *UserMutation) AddedIsTransfer() (r int8, exists bool)

AddedIsTransfer returns the value that was added to the "is_transfer" field in this mutation.

func (*UserMutation) AddedNextAirdropClaimTime added in v0.14.3

func (m *UserMutation) AddedNextAirdropClaimTime() (r int, exists bool)

AddedNextAirdropClaimTime returns the value that was added to the "next_airdrop_claim_time" field in this mutation.

func (*UserMutation) Address

func (m *UserMutation) Address() (r string, exists bool)

Address returns the value of the "address" field in the mutation.

func (*UserMutation) AddressCleared

func (m *UserMutation) AddressCleared() bool

AddressCleared returns if the "address" field was cleared in this mutation.

func (*UserMutation) AesType

func (m *UserMutation) AesType() (r int8, exists bool)

AesType returns the value of the "aes_type" field in the mutation.

func (*UserMutation) AesTypeCleared

func (m *UserMutation) AesTypeCleared() bool

AesTypeCleared returns if the "aes_type" field was cleared in this mutation.

func (*UserMutation) Balance

func (m *UserMutation) Balance() (r decimal.Decimal, exists bool)

Balance returns the value of the "balance" field in the mutation.

func (*UserMutation) BalanceUpdateTime

func (m *UserMutation) BalanceUpdateTime() (r int, exists bool)

BalanceUpdateTime returns the value of the "balance_update_time" field in the mutation.

func (*UserMutation) BalanceUpdateTimeCleared

func (m *UserMutation) BalanceUpdateTimeCleared() bool

BalanceUpdateTimeCleared returns if the "balance_update_time" field was cleared in this mutation.

func (*UserMutation) CanClaimAirdrop added in v0.14.3

func (m *UserMutation) CanClaimAirdrop() (r int8, exists bool)

CanClaimAirdrop returns the value of the "can_claim_airdrop" field in the mutation.

func (*UserMutation) CanClaimAirdropCleared added in v0.14.3

func (m *UserMutation) CanClaimAirdropCleared() bool

CanClaimAirdropCleared returns if the "can_claim_airdrop" field was cleared in this mutation.

func (*UserMutation) ClearAddress

func (m *UserMutation) ClearAddress()

ClearAddress clears the value of the "address" field.

func (*UserMutation) ClearAesType

func (m *UserMutation) ClearAesType()

ClearAesType clears the value of the "aes_type" field.

func (*UserMutation) ClearBalanceUpdateTime

func (m *UserMutation) ClearBalanceUpdateTime()

ClearBalanceUpdateTime clears the value of the "balance_update_time" field.

func (*UserMutation) ClearCanClaimAirdrop added in v0.14.3

func (m *UserMutation) ClearCanClaimAirdrop()

ClearCanClaimAirdrop clears the value of the "can_claim_airdrop" field.

func (*UserMutation) ClearCreateDate

func (m *UserMutation) ClearCreateDate()

ClearCreateDate clears the value of the "create_date" field.

func (*UserMutation) ClearCreateTime

func (m *UserMutation) ClearCreateTime()

ClearCreateTime clears the value of the "create_time" 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) 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) ClearIsTransfer

func (m *UserMutation) ClearIsTransfer()

ClearIsTransfer clears the value of the "is_transfer" field.

func (*UserMutation) ClearNetwork

func (m *UserMutation) ClearNetwork()

ClearNetwork clears the value of the "network" field.

func (*UserMutation) ClearNextAirdropClaimTime added in v0.14.3

func (m *UserMutation) ClearNextAirdropClaimTime()

ClearNextAirdropClaimTime clears the value of the "next_airdrop_claim_time" field.

func (*UserMutation) ClearPrivateKey

func (m *UserMutation) ClearPrivateKey()

ClearPrivateKey clears the value of the "private_key" field.

func (*UserMutation) ClearTokenInfo

func (m *UserMutation) ClearTokenInfo()

ClearTokenInfo clears the value of the "token_info" field.

func (*UserMutation) ClearTrxAddrType

func (m *UserMutation) ClearTrxAddrType()

ClearTrxAddrType clears the value of the "trx_addr_type" field.

func (*UserMutation) ClearTrxMode

func (m *UserMutation) ClearTrxMode()

ClearTrxMode clears the value of the "trx_mode" field.

func (*UserMutation) ClearTrxPrivAddr

func (m *UserMutation) ClearTrxPrivAddr()

ClearTrxPrivAddr clears the value of the "trx_priv_addr" field.

func (*UserMutation) ClearTrxPrivPkey

func (m *UserMutation) ClearTrxPrivPkey()

ClearTrxPrivPkey clears the value of the "trx_priv_pkey" field.

func (*UserMutation) ClearWords

func (m *UserMutation) ClearWords()

ClearWords clears the value of the "words" 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) CreateDate

func (m *UserMutation) CreateDate() (r time.Time, exists bool)

CreateDate returns the value of the "create_date" field in the mutation.

func (*UserMutation) CreateDateCleared

func (m *UserMutation) CreateDateCleared() bool

CreateDateCleared returns if the "create_date" field was cleared in this mutation.

func (*UserMutation) CreateTime

func (m *UserMutation) CreateTime() (r int, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*UserMutation) CreateTimeCleared

func (m *UserMutation) CreateTimeCleared() bool

CreateTimeCleared returns if the "create_time" 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) 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 uint, 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) ([]uint, 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) IsTransfer

func (m *UserMutation) IsTransfer() (r int8, exists bool)

IsTransfer returns the value of the "is_transfer" field in the mutation.

func (*UserMutation) IsTransferCleared

func (m *UserMutation) IsTransferCleared() bool

IsTransferCleared returns if the "is_transfer" field was cleared in this mutation.

func (*UserMutation) Network

func (m *UserMutation) Network() (r string, exists bool)

Network returns the value of the "network" field in the mutation.

func (*UserMutation) NetworkCleared

func (m *UserMutation) NetworkCleared() bool

NetworkCleared returns if the "network" field was cleared in this mutation.

func (*UserMutation) NextAirdropClaimTime added in v0.14.3

func (m *UserMutation) NextAirdropClaimTime() (r int, exists bool)

NextAirdropClaimTime returns the value of the "next_airdrop_claim_time" field in the mutation.

func (*UserMutation) NextAirdropClaimTimeCleared added in v0.14.3

func (m *UserMutation) NextAirdropClaimTimeCleared() bool

NextAirdropClaimTimeCleared returns if the "next_airdrop_claim_time" field was cleared in this mutation.

func (*UserMutation) OldAddress

func (m *UserMutation) OldAddress(ctx context.Context) (v string, err error)

OldAddress returns the old "address" 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) OldAesType

func (m *UserMutation) OldAesType(ctx context.Context) (v int8, err error)

OldAesType returns the old "aes_type" 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) OldBalance

func (m *UserMutation) OldBalance(ctx context.Context) (v decimal.Decimal, err error)

OldBalance returns the old "balance" 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) OldBalanceUpdateTime

func (m *UserMutation) OldBalanceUpdateTime(ctx context.Context) (v int, err error)

OldBalanceUpdateTime returns the old "balance_update_time" 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) OldCanClaimAirdrop added in v0.14.3

func (m *UserMutation) OldCanClaimAirdrop(ctx context.Context) (v int8, err error)

OldCanClaimAirdrop returns the old "can_claim_airdrop" 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) OldCreateDate

func (m *UserMutation) OldCreateDate(ctx context.Context) (v time.Time, err error)

OldCreateDate returns the old "create_date" 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) OldCreateTime

func (m *UserMutation) OldCreateTime(ctx context.Context) (v int, err error)

OldCreateTime returns the old "create_time" 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) OldIsTransfer

func (m *UserMutation) OldIsTransfer(ctx context.Context) (v int8, err error)

OldIsTransfer returns the old "is_transfer" 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) OldNetwork

func (m *UserMutation) OldNetwork(ctx context.Context) (v string, err error)

OldNetwork returns the old "network" 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) OldNextAirdropClaimTime added in v0.14.3

func (m *UserMutation) OldNextAirdropClaimTime(ctx context.Context) (v int, err error)

OldNextAirdropClaimTime returns the old "next_airdrop_claim_time" 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) OldPrivateKey

func (m *UserMutation) OldPrivateKey(ctx context.Context) (v string, err error)

OldPrivateKey returns the old "private_key" 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) OldTokenInfo

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

OldTokenInfo returns the old "token_info" 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) OldTotalTokenValue

func (m *UserMutation) OldTotalTokenValue(ctx context.Context) (v decimal.Decimal, err error)

OldTotalTokenValue returns the old "total_token_value" 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) OldTrxAddrType

func (m *UserMutation) OldTrxAddrType(ctx context.Context) (v user.TrxAddrType, err error)

OldTrxAddrType returns the old "trx_addr_type" 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) OldTrxMode

func (m *UserMutation) OldTrxMode(ctx context.Context) (v user.TrxMode, err error)

OldTrxMode returns the old "trx_mode" 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) OldTrxPrivAddr

func (m *UserMutation) OldTrxPrivAddr(ctx context.Context) (v string, err error)

OldTrxPrivAddr returns the old "trx_priv_addr" 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) OldTrxPrivPkey

func (m *UserMutation) OldTrxPrivPkey(ctx context.Context) (v string, err error)

OldTrxPrivPkey returns the old "trx_priv_pkey" 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) OldWords

func (m *UserMutation) OldWords(ctx context.Context) (v string, err error)

OldWords returns the old "words" 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) PrivateKey

func (m *UserMutation) PrivateKey() (r string, exists bool)

PrivateKey returns the value of the "private_key" field in the mutation.

func (*UserMutation) PrivateKeyCleared

func (m *UserMutation) PrivateKeyCleared() bool

PrivateKeyCleared returns if the "private_key" field was cleared in this 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) ResetAddress

func (m *UserMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*UserMutation) ResetAesType

func (m *UserMutation) ResetAesType()

ResetAesType resets all changes to the "aes_type" field.

func (*UserMutation) ResetBalance

func (m *UserMutation) ResetBalance()

ResetBalance resets all changes to the "balance" field.

func (*UserMutation) ResetBalanceUpdateTime

func (m *UserMutation) ResetBalanceUpdateTime()

ResetBalanceUpdateTime resets all changes to the "balance_update_time" field.

func (*UserMutation) ResetCanClaimAirdrop added in v0.14.3

func (m *UserMutation) ResetCanClaimAirdrop()

ResetCanClaimAirdrop resets all changes to the "can_claim_airdrop" field.

func (*UserMutation) ResetCreateDate

func (m *UserMutation) ResetCreateDate()

ResetCreateDate resets all changes to the "create_date" field.

func (*UserMutation) ResetCreateTime

func (m *UserMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" 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) 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) ResetIsTransfer

func (m *UserMutation) ResetIsTransfer()

ResetIsTransfer resets all changes to the "is_transfer" field.

func (*UserMutation) ResetNetwork

func (m *UserMutation) ResetNetwork()

ResetNetwork resets all changes to the "network" field.

func (*UserMutation) ResetNextAirdropClaimTime added in v0.14.3

func (m *UserMutation) ResetNextAirdropClaimTime()

ResetNextAirdropClaimTime resets all changes to the "next_airdrop_claim_time" field.

func (*UserMutation) ResetPrivateKey

func (m *UserMutation) ResetPrivateKey()

ResetPrivateKey resets all changes to the "private_key" field.

func (*UserMutation) ResetTokenInfo

func (m *UserMutation) ResetTokenInfo()

ResetTokenInfo resets all changes to the "token_info" field.

func (*UserMutation) ResetTotalTokenValue

func (m *UserMutation) ResetTotalTokenValue()

ResetTotalTokenValue resets all changes to the "total_token_value" field.

func (*UserMutation) ResetTrxAddrType

func (m *UserMutation) ResetTrxAddrType()

ResetTrxAddrType resets all changes to the "trx_addr_type" field.

func (*UserMutation) ResetTrxMode

func (m *UserMutation) ResetTrxMode()

ResetTrxMode resets all changes to the "trx_mode" field.

func (*UserMutation) ResetTrxPrivAddr

func (m *UserMutation) ResetTrxPrivAddr()

ResetTrxPrivAddr resets all changes to the "trx_priv_addr" field.

func (*UserMutation) ResetTrxPrivPkey

func (m *UserMutation) ResetTrxPrivPkey()

ResetTrxPrivPkey resets all changes to the "trx_priv_pkey" field.

func (*UserMutation) ResetWords

func (m *UserMutation) ResetWords()

ResetWords resets all changes to the "words" field.

func (*UserMutation) SetAddress

func (m *UserMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*UserMutation) SetAesType

func (m *UserMutation) SetAesType(i int8)

SetAesType sets the "aes_type" field.

func (*UserMutation) SetBalance

func (m *UserMutation) SetBalance(d decimal.Decimal)

SetBalance sets the "balance" field.

func (*UserMutation) SetBalanceUpdateTime

func (m *UserMutation) SetBalanceUpdateTime(i int)

SetBalanceUpdateTime sets the "balance_update_time" field.

func (*UserMutation) SetCanClaimAirdrop added in v0.14.3

func (m *UserMutation) SetCanClaimAirdrop(i int8)

SetCanClaimAirdrop sets the "can_claim_airdrop" field.

func (*UserMutation) SetCreateDate

func (m *UserMutation) SetCreateDate(t time.Time)

SetCreateDate sets the "create_date" field.

func (*UserMutation) SetCreateTime

func (m *UserMutation) SetCreateTime(i int)

SetCreateTime sets the "create_time" 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) SetID

func (m *UserMutation) SetID(id uint)

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

func (*UserMutation) SetIsTransfer

func (m *UserMutation) SetIsTransfer(i int8)

SetIsTransfer sets the "is_transfer" field.

func (*UserMutation) SetNetwork

func (m *UserMutation) SetNetwork(s string)

SetNetwork sets the "network" field.

func (*UserMutation) SetNextAirdropClaimTime added in v0.14.3

func (m *UserMutation) SetNextAirdropClaimTime(i int)

SetNextAirdropClaimTime sets the "next_airdrop_claim_time" field.

func (*UserMutation) SetOp

func (m *UserMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*UserMutation) SetPrivateKey

func (m *UserMutation) SetPrivateKey(s string)

SetPrivateKey sets the "private_key" field.

func (*UserMutation) SetTokenInfo

func (m *UserMutation) SetTokenInfo(value map[string]interface{})

SetTokenInfo sets the "token_info" field.

func (*UserMutation) SetTotalTokenValue

func (m *UserMutation) SetTotalTokenValue(d decimal.Decimal)

SetTotalTokenValue sets the "total_token_value" field.

func (*UserMutation) SetTrxAddrType

func (m *UserMutation) SetTrxAddrType(uat user.TrxAddrType)

SetTrxAddrType sets the "trx_addr_type" field.

func (*UserMutation) SetTrxMode

func (m *UserMutation) SetTrxMode(um user.TrxMode)

SetTrxMode sets the "trx_mode" field.

func (*UserMutation) SetTrxPrivAddr

func (m *UserMutation) SetTrxPrivAddr(s string)

SetTrxPrivAddr sets the "trx_priv_addr" field.

func (*UserMutation) SetTrxPrivPkey

func (m *UserMutation) SetTrxPrivPkey(s string)

SetTrxPrivPkey sets the "trx_priv_pkey" field.

func (*UserMutation) SetWords

func (m *UserMutation) SetWords(s string)

SetWords sets the "words" field.

func (*UserMutation) TokenInfo

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

TokenInfo returns the value of the "token_info" field in the mutation.

func (*UserMutation) TokenInfoCleared

func (m *UserMutation) TokenInfoCleared() bool

TokenInfoCleared returns if the "token_info" field was cleared in this mutation.

func (*UserMutation) TotalTokenValue

func (m *UserMutation) TotalTokenValue() (r decimal.Decimal, exists bool)

TotalTokenValue returns the value of the "total_token_value" field in the mutation.

func (*UserMutation) TrxAddrType

func (m *UserMutation) TrxAddrType() (r user.TrxAddrType, exists bool)

TrxAddrType returns the value of the "trx_addr_type" field in the mutation.

func (*UserMutation) TrxAddrTypeCleared

func (m *UserMutation) TrxAddrTypeCleared() bool

TrxAddrTypeCleared returns if the "trx_addr_type" field was cleared in this mutation.

func (*UserMutation) TrxMode

func (m *UserMutation) TrxMode() (r user.TrxMode, exists bool)

TrxMode returns the value of the "trx_mode" field in the mutation.

func (*UserMutation) TrxModeCleared

func (m *UserMutation) TrxModeCleared() bool

TrxModeCleared returns if the "trx_mode" field was cleared in this mutation.

func (*UserMutation) TrxPrivAddr

func (m *UserMutation) TrxPrivAddr() (r string, exists bool)

TrxPrivAddr returns the value of the "trx_priv_addr" field in the mutation.

func (*UserMutation) TrxPrivAddrCleared

func (m *UserMutation) TrxPrivAddrCleared() bool

TrxPrivAddrCleared returns if the "trx_priv_addr" field was cleared in this mutation.

func (*UserMutation) TrxPrivPkey

func (m *UserMutation) TrxPrivPkey() (r string, exists bool)

TrxPrivPkey returns the value of the "trx_priv_pkey" field in the mutation.

func (*UserMutation) TrxPrivPkeyCleared

func (m *UserMutation) TrxPrivPkeyCleared() bool

TrxPrivPkeyCleared returns if the "trx_priv_pkey" field was cleared in this mutation.

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) Where

func (m *UserMutation) Where(ps ...predicate.User)

Where appends a list predicates to the UserMutation builder.

func (*UserMutation) WhereP

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

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

func (*UserMutation) Words

func (m *UserMutation) Words() (r string, exists bool)

Words returns the value of the "words" field in the mutation.

func (*UserMutation) WordsCleared

func (m *UserMutation) WordsCleared() bool

WordsCleared returns if the "words" field was cleared in this mutation.

type UserQuery

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

UserQuery is the builder for querying User entities.

func (*UserQuery) Aggregate

func (uq *UserQuery) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate returns a UserSelect configured with the given aggregations.

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 uint, 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) uint

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 {
	Words string `json:"words,omitempty"`
	Count int `json:"count,omitempty"`
}

client.User.Query().
	GroupBy(user.FieldWords).
	Aggregate(gen.Count()).
	Scan(ctx, &v)

func (*UserQuery) IDs

func (uq *UserQuery) IDs(ctx context.Context) (ids []uint, err error)

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

func (*UserQuery) IDsX

func (uq *UserQuery) IDsX(ctx context.Context) []uint

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

func (*UserQuery) Limit

func (uq *UserQuery) Limit(limit int) *UserQuery

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

func (*UserQuery) Offset

func (uq *UserQuery) Offset(offset int) *UserQuery

Offset to start from.

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 uint, 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) uint

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 ...user.OrderOption) *UserQuery

Order specifies how the records should be ordered.

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 {
	Words string `json:"words,omitempty"`
}

client.User.Query().
	Select(user.FieldWords).
	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) Aggregate

func (us *UserSelect) Aggregate(fns ...AggregateFunc) *UserSelect

Aggregate adds the given aggregation functions to the selector query.

func (*UserSelect) Bool

func (s *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 (s *UserSelect) BoolX(ctx context.Context) bool

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

func (*UserSelect) Bools

func (s *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 (s *UserSelect) BoolsX(ctx context.Context) []bool

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

func (*UserSelect) Float64

func (s *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 (s *UserSelect) Float64X(ctx context.Context) float64

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

func (*UserSelect) Float64s

func (s *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 (s *UserSelect) Float64sX(ctx context.Context) []float64

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

func (*UserSelect) Int

func (s *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 (s *UserSelect) IntX(ctx context.Context) int

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

func (*UserSelect) Ints

func (s *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 (s *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 any) error

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

func (*UserSelect) ScanX

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

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

func (*UserSelect) String

func (s *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 (s *UserSelect) StringX(ctx context.Context) string

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

func (*UserSelect) Strings

func (s *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 (s *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) AddAesType

func (uu *UserUpdate) AddAesType(i int8) *UserUpdate

AddAesType adds i to the "aes_type" field.

func (*UserUpdate) AddBalanceUpdateTime

func (uu *UserUpdate) AddBalanceUpdateTime(i int) *UserUpdate

AddBalanceUpdateTime adds i to the "balance_update_time" field.

func (*UserUpdate) AddCanClaimAirdrop added in v0.14.3

func (uu *UserUpdate) AddCanClaimAirdrop(i int8) *UserUpdate

AddCanClaimAirdrop adds i to the "can_claim_airdrop" field.

func (*UserUpdate) AddCreateTime

func (uu *UserUpdate) AddCreateTime(i int) *UserUpdate

AddCreateTime adds i to the "create_time" field.

func (*UserUpdate) AddIsTransfer

func (uu *UserUpdate) AddIsTransfer(i int8) *UserUpdate

AddIsTransfer adds i to the "is_transfer" field.

func (*UserUpdate) AddNextAirdropClaimTime added in v0.14.3

func (uu *UserUpdate) AddNextAirdropClaimTime(i int) *UserUpdate

AddNextAirdropClaimTime adds i to the "next_airdrop_claim_time" field.

func (*UserUpdate) ClearAddress

func (uu *UserUpdate) ClearAddress() *UserUpdate

ClearAddress clears the value of the "address" field.

func (*UserUpdate) ClearAesType

func (uu *UserUpdate) ClearAesType() *UserUpdate

ClearAesType clears the value of the "aes_type" field.

func (*UserUpdate) ClearBalanceUpdateTime

func (uu *UserUpdate) ClearBalanceUpdateTime() *UserUpdate

ClearBalanceUpdateTime clears the value of the "balance_update_time" field.

func (*UserUpdate) ClearCanClaimAirdrop added in v0.14.3

func (uu *UserUpdate) ClearCanClaimAirdrop() *UserUpdate

ClearCanClaimAirdrop clears the value of the "can_claim_airdrop" field.

func (*UserUpdate) ClearCreateDate

func (uu *UserUpdate) ClearCreateDate() *UserUpdate

ClearCreateDate clears the value of the "create_date" field.

func (*UserUpdate) ClearCreateTime

func (uu *UserUpdate) ClearCreateTime() *UserUpdate

ClearCreateTime clears the value of the "create_time" field.

func (*UserUpdate) ClearIsTransfer

func (uu *UserUpdate) ClearIsTransfer() *UserUpdate

ClearIsTransfer clears the value of the "is_transfer" field.

func (*UserUpdate) ClearNetwork

func (uu *UserUpdate) ClearNetwork() *UserUpdate

ClearNetwork clears the value of the "network" field.

func (*UserUpdate) ClearNextAirdropClaimTime added in v0.14.3

func (uu *UserUpdate) ClearNextAirdropClaimTime() *UserUpdate

ClearNextAirdropClaimTime clears the value of the "next_airdrop_claim_time" field.

func (*UserUpdate) ClearPrivateKey

func (uu *UserUpdate) ClearPrivateKey() *UserUpdate

ClearPrivateKey clears the value of the "private_key" field.

func (*UserUpdate) ClearTokenInfo

func (uu *UserUpdate) ClearTokenInfo() *UserUpdate

ClearTokenInfo clears the value of the "token_info" field.

func (*UserUpdate) ClearTrxAddrType

func (uu *UserUpdate) ClearTrxAddrType() *UserUpdate

ClearTrxAddrType clears the value of the "trx_addr_type" field.

func (*UserUpdate) ClearTrxMode

func (uu *UserUpdate) ClearTrxMode() *UserUpdate

ClearTrxMode clears the value of the "trx_mode" field.

func (*UserUpdate) ClearTrxPrivAddr

func (uu *UserUpdate) ClearTrxPrivAddr() *UserUpdate

ClearTrxPrivAddr clears the value of the "trx_priv_addr" field.

func (*UserUpdate) ClearTrxPrivPkey

func (uu *UserUpdate) ClearTrxPrivPkey() *UserUpdate

ClearTrxPrivPkey clears the value of the "trx_priv_pkey" field.

func (*UserUpdate) ClearWords

func (uu *UserUpdate) ClearWords() *UserUpdate

ClearWords clears the value of the "words" 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) SetAddress

func (uu *UserUpdate) SetAddress(s string) *UserUpdate

SetAddress sets the "address" field.

func (*UserUpdate) SetAesType

func (uu *UserUpdate) SetAesType(i int8) *UserUpdate

SetAesType sets the "aes_type" field.

func (*UserUpdate) SetBalance

func (uu *UserUpdate) SetBalance(d decimal.Decimal) *UserUpdate

SetBalance sets the "balance" field.

func (*UserUpdate) SetBalanceUpdateTime

func (uu *UserUpdate) SetBalanceUpdateTime(i int) *UserUpdate

SetBalanceUpdateTime sets the "balance_update_time" field.

func (*UserUpdate) SetCanClaimAirdrop added in v0.14.3

func (uu *UserUpdate) SetCanClaimAirdrop(i int8) *UserUpdate

SetCanClaimAirdrop sets the "can_claim_airdrop" field.

func (*UserUpdate) SetCreateDate

func (uu *UserUpdate) SetCreateDate(t time.Time) *UserUpdate

SetCreateDate sets the "create_date" field.

func (*UserUpdate) SetCreateTime

func (uu *UserUpdate) SetCreateTime(i int) *UserUpdate

SetCreateTime sets the "create_time" field.

func (*UserUpdate) SetIsTransfer

func (uu *UserUpdate) SetIsTransfer(i int8) *UserUpdate

SetIsTransfer sets the "is_transfer" field.

func (*UserUpdate) SetNetwork

func (uu *UserUpdate) SetNetwork(s string) *UserUpdate

SetNetwork sets the "network" field.

func (*UserUpdate) SetNextAirdropClaimTime added in v0.14.3

func (uu *UserUpdate) SetNextAirdropClaimTime(i int) *UserUpdate

SetNextAirdropClaimTime sets the "next_airdrop_claim_time" field.

func (*UserUpdate) SetNillableAddress

func (uu *UserUpdate) SetNillableAddress(s *string) *UserUpdate

SetNillableAddress sets the "address" field if the given value is not nil.

func (*UserUpdate) SetNillableAesType

func (uu *UserUpdate) SetNillableAesType(i *int8) *UserUpdate

SetNillableAesType sets the "aes_type" field if the given value is not nil.

func (*UserUpdate) SetNillableBalance

func (uu *UserUpdate) SetNillableBalance(d *decimal.Decimal) *UserUpdate

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*UserUpdate) SetNillableBalanceUpdateTime

func (uu *UserUpdate) SetNillableBalanceUpdateTime(i *int) *UserUpdate

SetNillableBalanceUpdateTime sets the "balance_update_time" field if the given value is not nil.

func (*UserUpdate) SetNillableCanClaimAirdrop added in v0.14.3

func (uu *UserUpdate) SetNillableCanClaimAirdrop(i *int8) *UserUpdate

SetNillableCanClaimAirdrop sets the "can_claim_airdrop" field if the given value is not nil.

func (*UserUpdate) SetNillableCreateDate

func (uu *UserUpdate) SetNillableCreateDate(t *time.Time) *UserUpdate

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserUpdate) SetNillableCreateTime

func (uu *UserUpdate) SetNillableCreateTime(i *int) *UserUpdate

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserUpdate) SetNillableIsTransfer

func (uu *UserUpdate) SetNillableIsTransfer(i *int8) *UserUpdate

SetNillableIsTransfer sets the "is_transfer" field if the given value is not nil.

func (*UserUpdate) SetNillableNetwork

func (uu *UserUpdate) SetNillableNetwork(s *string) *UserUpdate

SetNillableNetwork sets the "network" field if the given value is not nil.

func (*UserUpdate) SetNillableNextAirdropClaimTime added in v0.14.3

func (uu *UserUpdate) SetNillableNextAirdropClaimTime(i *int) *UserUpdate

SetNillableNextAirdropClaimTime sets the "next_airdrop_claim_time" field if the given value is not nil.

func (*UserUpdate) SetNillablePrivateKey

func (uu *UserUpdate) SetNillablePrivateKey(s *string) *UserUpdate

SetNillablePrivateKey sets the "private_key" field if the given value is not nil.

func (*UserUpdate) SetNillableTotalTokenValue

func (uu *UserUpdate) SetNillableTotalTokenValue(d *decimal.Decimal) *UserUpdate

SetNillableTotalTokenValue sets the "total_token_value" field if the given value is not nil.

func (*UserUpdate) SetNillableTrxAddrType

func (uu *UserUpdate) SetNillableTrxAddrType(uat *user.TrxAddrType) *UserUpdate

SetNillableTrxAddrType sets the "trx_addr_type" field if the given value is not nil.

func (*UserUpdate) SetNillableTrxMode

func (uu *UserUpdate) SetNillableTrxMode(um *user.TrxMode) *UserUpdate

SetNillableTrxMode sets the "trx_mode" field if the given value is not nil.

func (*UserUpdate) SetNillableTrxPrivAddr

func (uu *UserUpdate) SetNillableTrxPrivAddr(s *string) *UserUpdate

SetNillableTrxPrivAddr sets the "trx_priv_addr" field if the given value is not nil.

func (*UserUpdate) SetNillableTrxPrivPkey

func (uu *UserUpdate) SetNillableTrxPrivPkey(s *string) *UserUpdate

SetNillableTrxPrivPkey sets the "trx_priv_pkey" field if the given value is not nil.

func (*UserUpdate) SetNillableWords

func (uu *UserUpdate) SetNillableWords(s *string) *UserUpdate

SetNillableWords sets the "words" field if the given value is not nil.

func (*UserUpdate) SetPrivateKey

func (uu *UserUpdate) SetPrivateKey(s string) *UserUpdate

SetPrivateKey sets the "private_key" field.

func (*UserUpdate) SetTokenInfo

func (uu *UserUpdate) SetTokenInfo(m map[string]interface{}) *UserUpdate

SetTokenInfo sets the "token_info" field.

func (*UserUpdate) SetTotalTokenValue

func (uu *UserUpdate) SetTotalTokenValue(d decimal.Decimal) *UserUpdate

SetTotalTokenValue sets the "total_token_value" field.

func (*UserUpdate) SetTrxAddrType

func (uu *UserUpdate) SetTrxAddrType(uat user.TrxAddrType) *UserUpdate

SetTrxAddrType sets the "trx_addr_type" field.

func (*UserUpdate) SetTrxMode

func (uu *UserUpdate) SetTrxMode(um user.TrxMode) *UserUpdate

SetTrxMode sets the "trx_mode" field.

func (*UserUpdate) SetTrxPrivAddr

func (uu *UserUpdate) SetTrxPrivAddr(s string) *UserUpdate

SetTrxPrivAddr sets the "trx_priv_addr" field.

func (*UserUpdate) SetTrxPrivPkey

func (uu *UserUpdate) SetTrxPrivPkey(s string) *UserUpdate

SetTrxPrivPkey sets the "trx_priv_pkey" field.

func (*UserUpdate) SetWords

func (uu *UserUpdate) SetWords(s string) *UserUpdate

SetWords sets the "words" 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) AddAesType

func (uuo *UserUpdateOne) AddAesType(i int8) *UserUpdateOne

AddAesType adds i to the "aes_type" field.

func (*UserUpdateOne) AddBalanceUpdateTime

func (uuo *UserUpdateOne) AddBalanceUpdateTime(i int) *UserUpdateOne

AddBalanceUpdateTime adds i to the "balance_update_time" field.

func (*UserUpdateOne) AddCanClaimAirdrop added in v0.14.3

func (uuo *UserUpdateOne) AddCanClaimAirdrop(i int8) *UserUpdateOne

AddCanClaimAirdrop adds i to the "can_claim_airdrop" field.

func (*UserUpdateOne) AddCreateTime

func (uuo *UserUpdateOne) AddCreateTime(i int) *UserUpdateOne

AddCreateTime adds i to the "create_time" field.

func (*UserUpdateOne) AddIsTransfer

func (uuo *UserUpdateOne) AddIsTransfer(i int8) *UserUpdateOne

AddIsTransfer adds i to the "is_transfer" field.

func (*UserUpdateOne) AddNextAirdropClaimTime added in v0.14.3

func (uuo *UserUpdateOne) AddNextAirdropClaimTime(i int) *UserUpdateOne

AddNextAirdropClaimTime adds i to the "next_airdrop_claim_time" field.

func (*UserUpdateOne) ClearAddress

func (uuo *UserUpdateOne) ClearAddress() *UserUpdateOne

ClearAddress clears the value of the "address" field.

func (*UserUpdateOne) ClearAesType

func (uuo *UserUpdateOne) ClearAesType() *UserUpdateOne

ClearAesType clears the value of the "aes_type" field.

func (*UserUpdateOne) ClearBalanceUpdateTime

func (uuo *UserUpdateOne) ClearBalanceUpdateTime() *UserUpdateOne

ClearBalanceUpdateTime clears the value of the "balance_update_time" field.

func (*UserUpdateOne) ClearCanClaimAirdrop added in v0.14.3

func (uuo *UserUpdateOne) ClearCanClaimAirdrop() *UserUpdateOne

ClearCanClaimAirdrop clears the value of the "can_claim_airdrop" field.

func (*UserUpdateOne) ClearCreateDate

func (uuo *UserUpdateOne) ClearCreateDate() *UserUpdateOne

ClearCreateDate clears the value of the "create_date" field.

func (*UserUpdateOne) ClearCreateTime

func (uuo *UserUpdateOne) ClearCreateTime() *UserUpdateOne

ClearCreateTime clears the value of the "create_time" field.

func (*UserUpdateOne) ClearIsTransfer

func (uuo *UserUpdateOne) ClearIsTransfer() *UserUpdateOne

ClearIsTransfer clears the value of the "is_transfer" field.

func (*UserUpdateOne) ClearNetwork

func (uuo *UserUpdateOne) ClearNetwork() *UserUpdateOne

ClearNetwork clears the value of the "network" field.

func (*UserUpdateOne) ClearNextAirdropClaimTime added in v0.14.3

func (uuo *UserUpdateOne) ClearNextAirdropClaimTime() *UserUpdateOne

ClearNextAirdropClaimTime clears the value of the "next_airdrop_claim_time" field.

func (*UserUpdateOne) ClearPrivateKey

func (uuo *UserUpdateOne) ClearPrivateKey() *UserUpdateOne

ClearPrivateKey clears the value of the "private_key" field.

func (*UserUpdateOne) ClearTokenInfo

func (uuo *UserUpdateOne) ClearTokenInfo() *UserUpdateOne

ClearTokenInfo clears the value of the "token_info" field.

func (*UserUpdateOne) ClearTrxAddrType

func (uuo *UserUpdateOne) ClearTrxAddrType() *UserUpdateOne

ClearTrxAddrType clears the value of the "trx_addr_type" field.

func (*UserUpdateOne) ClearTrxMode

func (uuo *UserUpdateOne) ClearTrxMode() *UserUpdateOne

ClearTrxMode clears the value of the "trx_mode" field.

func (*UserUpdateOne) ClearTrxPrivAddr

func (uuo *UserUpdateOne) ClearTrxPrivAddr() *UserUpdateOne

ClearTrxPrivAddr clears the value of the "trx_priv_addr" field.

func (*UserUpdateOne) ClearTrxPrivPkey

func (uuo *UserUpdateOne) ClearTrxPrivPkey() *UserUpdateOne

ClearTrxPrivPkey clears the value of the "trx_priv_pkey" field.

func (*UserUpdateOne) ClearWords

func (uuo *UserUpdateOne) ClearWords() *UserUpdateOne

ClearWords clears the value of the "words" 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) SetAddress

func (uuo *UserUpdateOne) SetAddress(s string) *UserUpdateOne

SetAddress sets the "address" field.

func (*UserUpdateOne) SetAesType

func (uuo *UserUpdateOne) SetAesType(i int8) *UserUpdateOne

SetAesType sets the "aes_type" field.

func (*UserUpdateOne) SetBalance

func (uuo *UserUpdateOne) SetBalance(d decimal.Decimal) *UserUpdateOne

SetBalance sets the "balance" field.

func (*UserUpdateOne) SetBalanceUpdateTime

func (uuo *UserUpdateOne) SetBalanceUpdateTime(i int) *UserUpdateOne

SetBalanceUpdateTime sets the "balance_update_time" field.

func (*UserUpdateOne) SetCanClaimAirdrop added in v0.14.3

func (uuo *UserUpdateOne) SetCanClaimAirdrop(i int8) *UserUpdateOne

SetCanClaimAirdrop sets the "can_claim_airdrop" field.

func (*UserUpdateOne) SetCreateDate

func (uuo *UserUpdateOne) SetCreateDate(t time.Time) *UserUpdateOne

SetCreateDate sets the "create_date" field.

func (*UserUpdateOne) SetCreateTime

func (uuo *UserUpdateOne) SetCreateTime(i int) *UserUpdateOne

SetCreateTime sets the "create_time" field.

func (*UserUpdateOne) SetIsTransfer

func (uuo *UserUpdateOne) SetIsTransfer(i int8) *UserUpdateOne

SetIsTransfer sets the "is_transfer" field.

func (*UserUpdateOne) SetNetwork

func (uuo *UserUpdateOne) SetNetwork(s string) *UserUpdateOne

SetNetwork sets the "network" field.

func (*UserUpdateOne) SetNextAirdropClaimTime added in v0.14.3

func (uuo *UserUpdateOne) SetNextAirdropClaimTime(i int) *UserUpdateOne

SetNextAirdropClaimTime sets the "next_airdrop_claim_time" field.

func (*UserUpdateOne) SetNillableAddress

func (uuo *UserUpdateOne) SetNillableAddress(s *string) *UserUpdateOne

SetNillableAddress sets the "address" field if the given value is not nil.

func (*UserUpdateOne) SetNillableAesType

func (uuo *UserUpdateOne) SetNillableAesType(i *int8) *UserUpdateOne

SetNillableAesType sets the "aes_type" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBalance

func (uuo *UserUpdateOne) SetNillableBalance(d *decimal.Decimal) *UserUpdateOne

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*UserUpdateOne) SetNillableBalanceUpdateTime

func (uuo *UserUpdateOne) SetNillableBalanceUpdateTime(i *int) *UserUpdateOne

SetNillableBalanceUpdateTime sets the "balance_update_time" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCanClaimAirdrop added in v0.14.3

func (uuo *UserUpdateOne) SetNillableCanClaimAirdrop(i *int8) *UserUpdateOne

SetNillableCanClaimAirdrop sets the "can_claim_airdrop" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCreateDate

func (uuo *UserUpdateOne) SetNillableCreateDate(t *time.Time) *UserUpdateOne

SetNillableCreateDate sets the "create_date" field if the given value is not nil.

func (*UserUpdateOne) SetNillableCreateTime

func (uuo *UserUpdateOne) SetNillableCreateTime(i *int) *UserUpdateOne

SetNillableCreateTime sets the "create_time" field if the given value is not nil.

func (*UserUpdateOne) SetNillableIsTransfer

func (uuo *UserUpdateOne) SetNillableIsTransfer(i *int8) *UserUpdateOne

SetNillableIsTransfer sets the "is_transfer" field if the given value is not nil.

func (*UserUpdateOne) SetNillableNetwork

func (uuo *UserUpdateOne) SetNillableNetwork(s *string) *UserUpdateOne

SetNillableNetwork sets the "network" field if the given value is not nil.

func (*UserUpdateOne) SetNillableNextAirdropClaimTime added in v0.14.3

func (uuo *UserUpdateOne) SetNillableNextAirdropClaimTime(i *int) *UserUpdateOne

SetNillableNextAirdropClaimTime sets the "next_airdrop_claim_time" field if the given value is not nil.

func (*UserUpdateOne) SetNillablePrivateKey

func (uuo *UserUpdateOne) SetNillablePrivateKey(s *string) *UserUpdateOne

SetNillablePrivateKey sets the "private_key" field if the given value is not nil.

func (*UserUpdateOne) SetNillableTotalTokenValue

func (uuo *UserUpdateOne) SetNillableTotalTokenValue(d *decimal.Decimal) *UserUpdateOne

SetNillableTotalTokenValue sets the "total_token_value" field if the given value is not nil.

func (*UserUpdateOne) SetNillableTrxAddrType

func (uuo *UserUpdateOne) SetNillableTrxAddrType(uat *user.TrxAddrType) *UserUpdateOne

SetNillableTrxAddrType sets the "trx_addr_type" field if the given value is not nil.

func (*UserUpdateOne) SetNillableTrxMode

func (uuo *UserUpdateOne) SetNillableTrxMode(um *user.TrxMode) *UserUpdateOne

SetNillableTrxMode sets the "trx_mode" field if the given value is not nil.

func (*UserUpdateOne) SetNillableTrxPrivAddr

func (uuo *UserUpdateOne) SetNillableTrxPrivAddr(s *string) *UserUpdateOne

SetNillableTrxPrivAddr sets the "trx_priv_addr" field if the given value is not nil.

func (*UserUpdateOne) SetNillableTrxPrivPkey

func (uuo *UserUpdateOne) SetNillableTrxPrivPkey(s *string) *UserUpdateOne

SetNillableTrxPrivPkey sets the "trx_priv_pkey" field if the given value is not nil.

func (*UserUpdateOne) SetNillableWords

func (uuo *UserUpdateOne) SetNillableWords(s *string) *UserUpdateOne

SetNillableWords sets the "words" field if the given value is not nil.

func (*UserUpdateOne) SetPrivateKey

func (uuo *UserUpdateOne) SetPrivateKey(s string) *UserUpdateOne

SetPrivateKey sets the "private_key" field.

func (*UserUpdateOne) SetTokenInfo

func (uuo *UserUpdateOne) SetTokenInfo(m map[string]interface{}) *UserUpdateOne

SetTokenInfo sets the "token_info" field.

func (*UserUpdateOne) SetTotalTokenValue

func (uuo *UserUpdateOne) SetTotalTokenValue(d decimal.Decimal) *UserUpdateOne

SetTotalTokenValue sets the "total_token_value" field.

func (*UserUpdateOne) SetTrxAddrType

func (uuo *UserUpdateOne) SetTrxAddrType(uat user.TrxAddrType) *UserUpdateOne

SetTrxAddrType sets the "trx_addr_type" field.

func (*UserUpdateOne) SetTrxMode

func (uuo *UserUpdateOne) SetTrxMode(um user.TrxMode) *UserUpdateOne

SetTrxMode sets the "trx_mode" field.

func (*UserUpdateOne) SetTrxPrivAddr

func (uuo *UserUpdateOne) SetTrxPrivAddr(s string) *UserUpdateOne

SetTrxPrivAddr sets the "trx_priv_addr" field.

func (*UserUpdateOne) SetTrxPrivPkey

func (uuo *UserUpdateOne) SetTrxPrivPkey(s string) *UserUpdateOne

SetTrxPrivPkey sets the "trx_priv_pkey" field.

func (*UserUpdateOne) SetWords

func (uuo *UserUpdateOne) SetWords(s string) *UserUpdateOne

SetWords sets the "words" field.

func (*UserUpdateOne) Where

func (uuo *UserUpdateOne) Where(ps ...predicate.User) *UserUpdateOne

Where appends a list predicates to the UserUpdate builder.

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