ent

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 24 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.
	TypeGrid     = "Grid"
	TypeNonce    = "Nonce"
	TypeOrder    = "Order"
	TypeSettings = "Settings"
	TypeStrategy = "Strategy"
	TypeWallet   = "Wallet"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Grid is the client for interacting with the Grid builders.
	Grid *GridClient
	// Nonce is the client for interacting with the Nonce builders.
	Nonce *NonceClient
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// Settings is the client for interacting with the Settings builders.
	Settings *SettingsClient
	// Strategy is the client for interacting with the Strategy builders.
	Strategy *StrategyClient
	// Wallet is the client for interacting with the Wallet builders.
	Wallet *WalletClient
	// 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().
	Grid.
	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 Grid

type Grid struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// GUID holds the value of the "guid" field.
	GUID string `json:"guid,omitempty"`
	// Account holds the value of the "account" field.
	Account string `json:"account,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,omitempty"`
	// Symbol holds the value of the "symbol" field.
	Symbol string `json:"symbol,omitempty"`
	// StrategyId holds the value of the "strategyId" field.
	StrategyId string `json:"strategyId,omitempty"`
	// GridNumber holds the value of the "gridNumber" field.
	GridNumber int `json:"gridNumber,omitempty"`
	// OrderPrice holds the value of the "orderPrice" field.
	OrderPrice decimal.Decimal `json:"orderPrice,omitempty"`
	// FinalPrice holds the value of the "finalPrice" field.
	FinalPrice decimal.Decimal `json:"finalPrice,omitempty"`
	// Amount holds the value of the "amount" field.
	Amount decimal.Decimal `json:"amount,omitempty"`
	// Quantity holds the value of the "quantity" field.
	Quantity decimal.Decimal `json:"quantity,omitempty"`
	// Status holds the value of the "status" field.
	Status grid.Status `json:"status,omitempty"`
	// contains filtered or unexported fields
}

Grid is the model entity for the Grid schema.

func (*Grid) String

func (_m *Grid) String() string

String implements the fmt.Stringer.

func (*Grid) Unwrap

func (_m *Grid) Unwrap() *Grid

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

func (_m *Grid) Update() *GridUpdateOne

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

func (*Grid) Value

func (_m *Grid) Value(name string) (ent.Value, error)

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

type GridClient

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

GridClient is a client for the Grid schema.

func NewGridClient

func NewGridClient(c config) *GridClient

NewGridClient returns a client for the Grid from the given config.

func (*GridClient) Create

func (c *GridClient) Create() *GridCreate

Create returns a builder for creating a Grid entity.

func (*GridClient) CreateBulk

func (c *GridClient) CreateBulk(builders ...*GridCreate) *GridCreateBulk

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

func (*GridClient) Delete

func (c *GridClient) Delete() *GridDelete

Delete returns a delete builder for Grid.

func (*GridClient) DeleteOne

func (c *GridClient) DeleteOne(_m *Grid) *GridDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*GridClient) DeleteOneID

func (c *GridClient) DeleteOneID(id int) *GridDeleteOne

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

func (*GridClient) Get

func (c *GridClient) Get(ctx context.Context, id int) (*Grid, error)

Get returns a Grid entity by its id.

func (*GridClient) GetX

func (c *GridClient) GetX(ctx context.Context, id int) *Grid

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

func (*GridClient) Hooks

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

Hooks returns the client hooks.

func (*GridClient) Intercept

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

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

func (*GridClient) Interceptors

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

Interceptors returns the client interceptors.

func (*GridClient) MapCreateBulk

func (c *GridClient) MapCreateBulk(slice any, setFunc func(*GridCreate, int)) *GridCreateBulk

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 (*GridClient) Query

func (c *GridClient) Query() *GridQuery

Query returns a query builder for Grid.

func (*GridClient) Update

func (c *GridClient) Update() *GridUpdate

Update returns an update builder for Grid.

func (*GridClient) UpdateOne

func (c *GridClient) UpdateOne(_m *Grid) *GridUpdateOne

UpdateOne returns an update builder for the given entity.

func (*GridClient) UpdateOneID

func (c *GridClient) UpdateOneID(id int) *GridUpdateOne

UpdateOneID returns an update builder for the given id.

func (*GridClient) Use

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

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

type GridCreate

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

GridCreate is the builder for creating a Grid entity.

func (*GridCreate) Exec

func (_c *GridCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*GridCreate) ExecX

func (_c *GridCreate) ExecX(ctx context.Context)

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

func (*GridCreate) Mutation

func (_c *GridCreate) Mutation() *GridMutation

Mutation returns the GridMutation object of the builder.

func (*GridCreate) Save

func (_c *GridCreate) Save(ctx context.Context) (*Grid, error)

Save creates the Grid in the database.

func (*GridCreate) SaveX

func (_c *GridCreate) SaveX(ctx context.Context) *Grid

SaveX calls Save and panics if Save returns an error.

func (*GridCreate) SetAccount

func (_c *GridCreate) SetAccount(v string) *GridCreate

SetAccount sets the "account" field.

func (*GridCreate) SetAmount

func (_c *GridCreate) SetAmount(v decimal.Decimal) *GridCreate

SetAmount sets the "amount" field.

func (*GridCreate) SetCreateTime

func (_c *GridCreate) SetCreateTime(v time.Time) *GridCreate

SetCreateTime sets the "create_time" field.

func (*GridCreate) SetFinalPrice

func (_c *GridCreate) SetFinalPrice(v decimal.Decimal) *GridCreate

SetFinalPrice sets the "finalPrice" field.

func (*GridCreate) SetGUID

func (_c *GridCreate) SetGUID(v string) *GridCreate

SetGUID sets the "guid" field.

func (*GridCreate) SetGridNumber

func (_c *GridCreate) SetGridNumber(v int) *GridCreate

SetGridNumber sets the "gridNumber" field.

func (*GridCreate) SetNillableCreateTime

func (_c *GridCreate) SetNillableCreateTime(v *time.Time) *GridCreate

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

func (*GridCreate) SetNillableUpdateTime

func (_c *GridCreate) SetNillableUpdateTime(v *time.Time) *GridCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*GridCreate) SetOrderPrice

func (_c *GridCreate) SetOrderPrice(v decimal.Decimal) *GridCreate

SetOrderPrice sets the "orderPrice" field.

func (*GridCreate) SetQuantity

func (_c *GridCreate) SetQuantity(v decimal.Decimal) *GridCreate

SetQuantity sets the "quantity" field.

func (*GridCreate) SetStatus

func (_c *GridCreate) SetStatus(v grid.Status) *GridCreate

SetStatus sets the "status" field.

func (*GridCreate) SetStrategyId

func (_c *GridCreate) SetStrategyId(v string) *GridCreate

SetStrategyId sets the "strategyId" field.

func (*GridCreate) SetSymbol

func (_c *GridCreate) SetSymbol(v string) *GridCreate

SetSymbol sets the "symbol" field.

func (*GridCreate) SetToken

func (_c *GridCreate) SetToken(v string) *GridCreate

SetToken sets the "token" field.

func (*GridCreate) SetUpdateTime

func (_c *GridCreate) SetUpdateTime(v time.Time) *GridCreate

SetUpdateTime sets the "update_time" field.

type GridCreateBulk

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

GridCreateBulk is the builder for creating many Grid entities in bulk.

func (*GridCreateBulk) Exec

func (_c *GridCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*GridCreateBulk) ExecX

func (_c *GridCreateBulk) ExecX(ctx context.Context)

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

func (*GridCreateBulk) Save

func (_c *GridCreateBulk) Save(ctx context.Context) ([]*Grid, error)

Save creates the Grid entities in the database.

func (*GridCreateBulk) SaveX

func (_c *GridCreateBulk) SaveX(ctx context.Context) []*Grid

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

type GridDelete

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

GridDelete is the builder for deleting a Grid entity.

func (*GridDelete) Exec

func (_d *GridDelete) Exec(ctx context.Context) (int, error)

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

func (*GridDelete) ExecX

func (_d *GridDelete) ExecX(ctx context.Context) int

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

func (*GridDelete) Where

func (_d *GridDelete) Where(ps ...predicate.Grid) *GridDelete

Where appends a list predicates to the GridDelete builder.

type GridDeleteOne

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

GridDeleteOne is the builder for deleting a single Grid entity.

func (*GridDeleteOne) Exec

func (_d *GridDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*GridDeleteOne) ExecX

func (_d *GridDeleteOne) ExecX(ctx context.Context)

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

func (*GridDeleteOne) Where

func (_d *GridDeleteOne) Where(ps ...predicate.Grid) *GridDeleteOne

Where appends a list predicates to the GridDelete builder.

type GridGroupBy

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

GridGroupBy is the group-by builder for Grid entities.

func (*GridGroupBy) Aggregate

func (_g *GridGroupBy) Aggregate(fns ...AggregateFunc) *GridGroupBy

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

func (*GridGroupBy) Bool

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

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

func (*GridGroupBy) BoolX

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

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

func (*GridGroupBy) Bools

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

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

func (*GridGroupBy) BoolsX

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

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

func (*GridGroupBy) Float64

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

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

func (*GridGroupBy) Float64X

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

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

func (*GridGroupBy) Float64s

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

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

func (*GridGroupBy) Float64sX

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

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

func (*GridGroupBy) Int

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

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

func (*GridGroupBy) IntX

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

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

func (*GridGroupBy) Ints

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

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

func (*GridGroupBy) IntsX

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

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

func (*GridGroupBy) Scan

func (_g *GridGroupBy) Scan(ctx context.Context, v any) error

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

func (*GridGroupBy) ScanX

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

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

func (*GridGroupBy) String

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

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

func (*GridGroupBy) StringX

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

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

func (*GridGroupBy) Strings

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

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

func (*GridGroupBy) StringsX

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

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

type GridMutation

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

GridMutation represents an operation that mutates the Grid nodes in the graph.

func (*GridMutation) Account

func (m *GridMutation) Account() (r string, exists bool)

Account returns the value of the "account" field in the mutation.

func (*GridMutation) AddField

func (m *GridMutation) 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 (*GridMutation) AddGridNumber

func (m *GridMutation) AddGridNumber(i int)

AddGridNumber adds i to the "gridNumber" field.

func (*GridMutation) AddedEdges

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

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

func (*GridMutation) AddedField

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

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

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

func (*GridMutation) AddedGridNumber

func (m *GridMutation) AddedGridNumber() (r int, exists bool)

AddedGridNumber returns the value that was added to the "gridNumber" field in this mutation.

func (*GridMutation) AddedIDs

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

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

func (*GridMutation) Amount

func (m *GridMutation) Amount() (r decimal.Decimal, exists bool)

Amount returns the value of the "amount" field in the mutation.

func (*GridMutation) ClearEdge

func (m *GridMutation) 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 (*GridMutation) ClearField

func (m *GridMutation) 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 (*GridMutation) ClearedEdges

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

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

func (*GridMutation) ClearedFields

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

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

func (GridMutation) Client

func (m GridMutation) 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 (*GridMutation) CreateTime

func (m *GridMutation) CreateTime() (r time.Time, exists bool)

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

func (*GridMutation) EdgeCleared

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

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

func (*GridMutation) Field

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

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

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

func (*GridMutation) Fields

func (m *GridMutation) 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 (*GridMutation) FinalPrice

func (m *GridMutation) FinalPrice() (r decimal.Decimal, exists bool)

FinalPrice returns the value of the "finalPrice" field in the mutation.

func (*GridMutation) GUID

func (m *GridMutation) GUID() (r string, exists bool)

GUID returns the value of the "guid" field in the mutation.

func (*GridMutation) GridNumber

func (m *GridMutation) GridNumber() (r int, exists bool)

GridNumber returns the value of the "gridNumber" field in the mutation.

func (*GridMutation) ID

func (m *GridMutation) 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 (*GridMutation) IDs

func (m *GridMutation) 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 (*GridMutation) OldAccount

func (m *GridMutation) OldAccount(ctx context.Context) (v string, err error)

OldAccount returns the old "account" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldAmount

func (m *GridMutation) OldAmount(ctx context.Context) (v decimal.Decimal, err error)

OldAmount returns the old "amount" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldCreateTime

func (m *GridMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldField

func (m *GridMutation) 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 (*GridMutation) OldFinalPrice

func (m *GridMutation) OldFinalPrice(ctx context.Context) (v decimal.Decimal, err error)

OldFinalPrice returns the old "finalPrice" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldGUID

func (m *GridMutation) OldGUID(ctx context.Context) (v string, err error)

OldGUID returns the old "guid" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldGridNumber

func (m *GridMutation) OldGridNumber(ctx context.Context) (v int, err error)

OldGridNumber returns the old "gridNumber" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldOrderPrice

func (m *GridMutation) OldOrderPrice(ctx context.Context) (v decimal.Decimal, err error)

OldOrderPrice returns the old "orderPrice" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldQuantity

func (m *GridMutation) OldQuantity(ctx context.Context) (v decimal.Decimal, err error)

OldQuantity returns the old "quantity" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldStatus

func (m *GridMutation) OldStatus(ctx context.Context) (v grid.Status, err error)

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

func (m *GridMutation) OldStrategyId(ctx context.Context) (v string, err error)

OldStrategyId returns the old "strategyId" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldSymbol

func (m *GridMutation) OldSymbol(ctx context.Context) (v string, err error)

OldSymbol returns the old "symbol" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldToken

func (m *GridMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Grid entity. If the Grid 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 (*GridMutation) OldUpdateTime

func (m *GridMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Grid entity. If the Grid 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 (*GridMutation) Op

func (m *GridMutation) Op() Op

Op returns the operation name.

func (*GridMutation) OrderPrice

func (m *GridMutation) OrderPrice() (r decimal.Decimal, exists bool)

OrderPrice returns the value of the "orderPrice" field in the mutation.

func (*GridMutation) Quantity

func (m *GridMutation) Quantity() (r decimal.Decimal, exists bool)

Quantity returns the value of the "quantity" field in the mutation.

func (*GridMutation) RemovedEdges

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

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

func (*GridMutation) RemovedIDs

func (m *GridMutation) 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 (*GridMutation) ResetAccount

func (m *GridMutation) ResetAccount()

ResetAccount resets all changes to the "account" field.

func (*GridMutation) ResetAmount

func (m *GridMutation) ResetAmount()

ResetAmount resets all changes to the "amount" field.

func (*GridMutation) ResetCreateTime

func (m *GridMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*GridMutation) ResetEdge

func (m *GridMutation) 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 (*GridMutation) ResetField

func (m *GridMutation) 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 (*GridMutation) ResetFinalPrice

func (m *GridMutation) ResetFinalPrice()

ResetFinalPrice resets all changes to the "finalPrice" field.

func (*GridMutation) ResetGUID

func (m *GridMutation) ResetGUID()

ResetGUID resets all changes to the "guid" field.

func (*GridMutation) ResetGridNumber

func (m *GridMutation) ResetGridNumber()

ResetGridNumber resets all changes to the "gridNumber" field.

func (*GridMutation) ResetOrderPrice

func (m *GridMutation) ResetOrderPrice()

ResetOrderPrice resets all changes to the "orderPrice" field.

func (*GridMutation) ResetQuantity

func (m *GridMutation) ResetQuantity()

ResetQuantity resets all changes to the "quantity" field.

func (*GridMutation) ResetStatus

func (m *GridMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*GridMutation) ResetStrategyId

func (m *GridMutation) ResetStrategyId()

ResetStrategyId resets all changes to the "strategyId" field.

func (*GridMutation) ResetSymbol

func (m *GridMutation) ResetSymbol()

ResetSymbol resets all changes to the "symbol" field.

func (*GridMutation) ResetToken

func (m *GridMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*GridMutation) ResetUpdateTime

func (m *GridMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*GridMutation) SetAccount

func (m *GridMutation) SetAccount(s string)

SetAccount sets the "account" field.

func (*GridMutation) SetAmount

func (m *GridMutation) SetAmount(d decimal.Decimal)

SetAmount sets the "amount" field.

func (*GridMutation) SetCreateTime

func (m *GridMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*GridMutation) SetField

func (m *GridMutation) 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 (*GridMutation) SetFinalPrice

func (m *GridMutation) SetFinalPrice(d decimal.Decimal)

SetFinalPrice sets the "finalPrice" field.

func (*GridMutation) SetGUID

func (m *GridMutation) SetGUID(s string)

SetGUID sets the "guid" field.

func (*GridMutation) SetGridNumber

func (m *GridMutation) SetGridNumber(i int)

SetGridNumber sets the "gridNumber" field.

func (*GridMutation) SetOp

func (m *GridMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*GridMutation) SetOrderPrice

func (m *GridMutation) SetOrderPrice(d decimal.Decimal)

SetOrderPrice sets the "orderPrice" field.

func (*GridMutation) SetQuantity

func (m *GridMutation) SetQuantity(d decimal.Decimal)

SetQuantity sets the "quantity" field.

func (*GridMutation) SetStatus

func (m *GridMutation) SetStatus(gr grid.Status)

SetStatus sets the "status" field.

func (*GridMutation) SetStrategyId

func (m *GridMutation) SetStrategyId(s string)

SetStrategyId sets the "strategyId" field.

func (*GridMutation) SetSymbol

func (m *GridMutation) SetSymbol(s string)

SetSymbol sets the "symbol" field.

func (*GridMutation) SetToken

func (m *GridMutation) SetToken(s string)

SetToken sets the "token" field.

func (*GridMutation) SetUpdateTime

func (m *GridMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*GridMutation) Status

func (m *GridMutation) Status() (r grid.Status, exists bool)

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

func (*GridMutation) StrategyId

func (m *GridMutation) StrategyId() (r string, exists bool)

StrategyId returns the value of the "strategyId" field in the mutation.

func (*GridMutation) Symbol

func (m *GridMutation) Symbol() (r string, exists bool)

Symbol returns the value of the "symbol" field in the mutation.

func (*GridMutation) Token

func (m *GridMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (GridMutation) Tx

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

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

func (*GridMutation) Type

func (m *GridMutation) Type() string

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

func (*GridMutation) UpdateTime

func (m *GridMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*GridMutation) Where

func (m *GridMutation) Where(ps ...predicate.Grid)

Where appends a list predicates to the GridMutation builder.

func (*GridMutation) WhereP

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

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

type GridQuery

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

GridQuery is the builder for querying Grid entities.

func (*GridQuery) Aggregate

func (_q *GridQuery) Aggregate(fns ...AggregateFunc) *GridSelect

Aggregate returns a GridSelect configured with the given aggregations.

func (*GridQuery) All

func (_q *GridQuery) All(ctx context.Context) ([]*Grid, error)

All executes the query and returns a list of Grids.

func (*GridQuery) AllX

func (_q *GridQuery) AllX(ctx context.Context) []*Grid

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

func (*GridQuery) Clone

func (_q *GridQuery) Clone() *GridQuery

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

func (*GridQuery) Count

func (_q *GridQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*GridQuery) CountX

func (_q *GridQuery) CountX(ctx context.Context) int

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

func (*GridQuery) Exist

func (_q *GridQuery) Exist(ctx context.Context) (bool, error)

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

func (*GridQuery) ExistX

func (_q *GridQuery) ExistX(ctx context.Context) bool

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

func (*GridQuery) First

func (_q *GridQuery) First(ctx context.Context) (*Grid, error)

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

func (*GridQuery) FirstID

func (_q *GridQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*GridQuery) FirstIDX

func (_q *GridQuery) FirstIDX(ctx context.Context) int

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

func (*GridQuery) FirstX

func (_q *GridQuery) FirstX(ctx context.Context) *Grid

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

func (*GridQuery) GroupBy

func (_q *GridQuery) GroupBy(field string, fields ...string) *GridGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Grid.Query().
	GroupBy(grid.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*GridQuery) IDs

func (_q *GridQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*GridQuery) IDsX

func (_q *GridQuery) IDsX(ctx context.Context) []int

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

func (*GridQuery) Limit

func (_q *GridQuery) Limit(limit int) *GridQuery

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

func (*GridQuery) Offset

func (_q *GridQuery) Offset(offset int) *GridQuery

Offset to start from.

func (*GridQuery) Only

func (_q *GridQuery) Only(ctx context.Context) (*Grid, error)

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

func (*GridQuery) OnlyID

func (_q *GridQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*GridQuery) OnlyIDX

func (_q *GridQuery) OnlyIDX(ctx context.Context) int

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

func (*GridQuery) OnlyX

func (_q *GridQuery) OnlyX(ctx context.Context) *Grid

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

func (*GridQuery) Order

func (_q *GridQuery) Order(o ...grid.OrderOption) *GridQuery

Order specifies how the records should be ordered.

func (*GridQuery) Select

func (_q *GridQuery) Select(fields ...string) *GridSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Grid.Query().
	Select(grid.FieldCreateTime).
	Scan(ctx, &v)

func (*GridQuery) Unique

func (_q *GridQuery) Unique(unique bool) *GridQuery

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

func (_q *GridQuery) Where(ps ...predicate.Grid) *GridQuery

Where adds a new predicate for the GridQuery builder.

type GridSelect

type GridSelect struct {
	*GridQuery
	// contains filtered or unexported fields
}

GridSelect is the builder for selecting fields of Grid entities.

func (*GridSelect) Aggregate

func (_s *GridSelect) Aggregate(fns ...AggregateFunc) *GridSelect

Aggregate adds the given aggregation functions to the selector query.

func (*GridSelect) Bool

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

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

func (*GridSelect) BoolX

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

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

func (*GridSelect) Bools

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

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

func (*GridSelect) BoolsX

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

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

func (*GridSelect) Float64

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

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

func (*GridSelect) Float64X

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

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

func (*GridSelect) Float64s

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

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

func (*GridSelect) Float64sX

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

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

func (*GridSelect) Int

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

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

func (*GridSelect) IntX

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

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

func (*GridSelect) Ints

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

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

func (*GridSelect) IntsX

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

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

func (*GridSelect) Scan

func (_s *GridSelect) Scan(ctx context.Context, v any) error

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

func (*GridSelect) ScanX

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

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

func (*GridSelect) String

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

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

func (*GridSelect) StringX

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

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

func (*GridSelect) Strings

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

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

func (*GridSelect) StringsX

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

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

type GridUpdate

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

GridUpdate is the builder for updating Grid entities.

func (*GridUpdate) AddGridNumber

func (_u *GridUpdate) AddGridNumber(v int) *GridUpdate

AddGridNumber adds value to the "gridNumber" field.

func (*GridUpdate) Exec

func (_u *GridUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*GridUpdate) ExecX

func (_u *GridUpdate) ExecX(ctx context.Context)

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

func (*GridUpdate) Mutation

func (_u *GridUpdate) Mutation() *GridMutation

Mutation returns the GridMutation object of the builder.

func (*GridUpdate) Save

func (_u *GridUpdate) Save(ctx context.Context) (int, error)

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

func (*GridUpdate) SaveX

func (_u *GridUpdate) SaveX(ctx context.Context) int

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

func (*GridUpdate) SetAccount

func (_u *GridUpdate) SetAccount(v string) *GridUpdate

SetAccount sets the "account" field.

func (*GridUpdate) SetAmount

func (_u *GridUpdate) SetAmount(v decimal.Decimal) *GridUpdate

SetAmount sets the "amount" field.

func (*GridUpdate) SetFinalPrice

func (_u *GridUpdate) SetFinalPrice(v decimal.Decimal) *GridUpdate

SetFinalPrice sets the "finalPrice" field.

func (*GridUpdate) SetGUID

func (_u *GridUpdate) SetGUID(v string) *GridUpdate

SetGUID sets the "guid" field.

func (*GridUpdate) SetGridNumber

func (_u *GridUpdate) SetGridNumber(v int) *GridUpdate

SetGridNumber sets the "gridNumber" field.

func (*GridUpdate) SetNillableAccount

func (_u *GridUpdate) SetNillableAccount(v *string) *GridUpdate

SetNillableAccount sets the "account" field if the given value is not nil.

func (*GridUpdate) SetNillableAmount

func (_u *GridUpdate) SetNillableAmount(v *decimal.Decimal) *GridUpdate

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*GridUpdate) SetNillableFinalPrice

func (_u *GridUpdate) SetNillableFinalPrice(v *decimal.Decimal) *GridUpdate

SetNillableFinalPrice sets the "finalPrice" field if the given value is not nil.

func (*GridUpdate) SetNillableGUID

func (_u *GridUpdate) SetNillableGUID(v *string) *GridUpdate

SetNillableGUID sets the "guid" field if the given value is not nil.

func (*GridUpdate) SetNillableGridNumber

func (_u *GridUpdate) SetNillableGridNumber(v *int) *GridUpdate

SetNillableGridNumber sets the "gridNumber" field if the given value is not nil.

func (*GridUpdate) SetNillableOrderPrice

func (_u *GridUpdate) SetNillableOrderPrice(v *decimal.Decimal) *GridUpdate

SetNillableOrderPrice sets the "orderPrice" field if the given value is not nil.

func (*GridUpdate) SetNillableQuantity

func (_u *GridUpdate) SetNillableQuantity(v *decimal.Decimal) *GridUpdate

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*GridUpdate) SetNillableStatus

func (_u *GridUpdate) SetNillableStatus(v *grid.Status) *GridUpdate

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

func (*GridUpdate) SetNillableStrategyId

func (_u *GridUpdate) SetNillableStrategyId(v *string) *GridUpdate

SetNillableStrategyId sets the "strategyId" field if the given value is not nil.

func (*GridUpdate) SetNillableSymbol

func (_u *GridUpdate) SetNillableSymbol(v *string) *GridUpdate

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*GridUpdate) SetNillableToken

func (_u *GridUpdate) SetNillableToken(v *string) *GridUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*GridUpdate) SetOrderPrice

func (_u *GridUpdate) SetOrderPrice(v decimal.Decimal) *GridUpdate

SetOrderPrice sets the "orderPrice" field.

func (*GridUpdate) SetQuantity

func (_u *GridUpdate) SetQuantity(v decimal.Decimal) *GridUpdate

SetQuantity sets the "quantity" field.

func (*GridUpdate) SetStatus

func (_u *GridUpdate) SetStatus(v grid.Status) *GridUpdate

SetStatus sets the "status" field.

func (*GridUpdate) SetStrategyId

func (_u *GridUpdate) SetStrategyId(v string) *GridUpdate

SetStrategyId sets the "strategyId" field.

func (*GridUpdate) SetSymbol

func (_u *GridUpdate) SetSymbol(v string) *GridUpdate

SetSymbol sets the "symbol" field.

func (*GridUpdate) SetToken

func (_u *GridUpdate) SetToken(v string) *GridUpdate

SetToken sets the "token" field.

func (*GridUpdate) SetUpdateTime

func (_u *GridUpdate) SetUpdateTime(v time.Time) *GridUpdate

SetUpdateTime sets the "update_time" field.

func (*GridUpdate) Where

func (_u *GridUpdate) Where(ps ...predicate.Grid) *GridUpdate

Where appends a list predicates to the GridUpdate builder.

type GridUpdateOne

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

GridUpdateOne is the builder for updating a single Grid entity.

func (*GridUpdateOne) AddGridNumber

func (_u *GridUpdateOne) AddGridNumber(v int) *GridUpdateOne

AddGridNumber adds value to the "gridNumber" field.

func (*GridUpdateOne) Exec

func (_u *GridUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*GridUpdateOne) ExecX

func (_u *GridUpdateOne) ExecX(ctx context.Context)

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

func (*GridUpdateOne) Mutation

func (_u *GridUpdateOne) Mutation() *GridMutation

Mutation returns the GridMutation object of the builder.

func (*GridUpdateOne) Save

func (_u *GridUpdateOne) Save(ctx context.Context) (*Grid, error)

Save executes the query and returns the updated Grid entity.

func (*GridUpdateOne) SaveX

func (_u *GridUpdateOne) SaveX(ctx context.Context) *Grid

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

func (*GridUpdateOne) Select

func (_u *GridUpdateOne) Select(field string, fields ...string) *GridUpdateOne

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

func (*GridUpdateOne) SetAccount

func (_u *GridUpdateOne) SetAccount(v string) *GridUpdateOne

SetAccount sets the "account" field.

func (*GridUpdateOne) SetAmount

func (_u *GridUpdateOne) SetAmount(v decimal.Decimal) *GridUpdateOne

SetAmount sets the "amount" field.

func (*GridUpdateOne) SetFinalPrice

func (_u *GridUpdateOne) SetFinalPrice(v decimal.Decimal) *GridUpdateOne

SetFinalPrice sets the "finalPrice" field.

func (*GridUpdateOne) SetGUID

func (_u *GridUpdateOne) SetGUID(v string) *GridUpdateOne

SetGUID sets the "guid" field.

func (*GridUpdateOne) SetGridNumber

func (_u *GridUpdateOne) SetGridNumber(v int) *GridUpdateOne

SetGridNumber sets the "gridNumber" field.

func (*GridUpdateOne) SetNillableAccount

func (_u *GridUpdateOne) SetNillableAccount(v *string) *GridUpdateOne

SetNillableAccount sets the "account" field if the given value is not nil.

func (*GridUpdateOne) SetNillableAmount

func (_u *GridUpdateOne) SetNillableAmount(v *decimal.Decimal) *GridUpdateOne

SetNillableAmount sets the "amount" field if the given value is not nil.

func (*GridUpdateOne) SetNillableFinalPrice

func (_u *GridUpdateOne) SetNillableFinalPrice(v *decimal.Decimal) *GridUpdateOne

SetNillableFinalPrice sets the "finalPrice" field if the given value is not nil.

func (*GridUpdateOne) SetNillableGUID

func (_u *GridUpdateOne) SetNillableGUID(v *string) *GridUpdateOne

SetNillableGUID sets the "guid" field if the given value is not nil.

func (*GridUpdateOne) SetNillableGridNumber

func (_u *GridUpdateOne) SetNillableGridNumber(v *int) *GridUpdateOne

SetNillableGridNumber sets the "gridNumber" field if the given value is not nil.

func (*GridUpdateOne) SetNillableOrderPrice

func (_u *GridUpdateOne) SetNillableOrderPrice(v *decimal.Decimal) *GridUpdateOne

SetNillableOrderPrice sets the "orderPrice" field if the given value is not nil.

func (*GridUpdateOne) SetNillableQuantity

func (_u *GridUpdateOne) SetNillableQuantity(v *decimal.Decimal) *GridUpdateOne

SetNillableQuantity sets the "quantity" field if the given value is not nil.

func (*GridUpdateOne) SetNillableStatus

func (_u *GridUpdateOne) SetNillableStatus(v *grid.Status) *GridUpdateOne

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

func (*GridUpdateOne) SetNillableStrategyId

func (_u *GridUpdateOne) SetNillableStrategyId(v *string) *GridUpdateOne

SetNillableStrategyId sets the "strategyId" field if the given value is not nil.

func (*GridUpdateOne) SetNillableSymbol

func (_u *GridUpdateOne) SetNillableSymbol(v *string) *GridUpdateOne

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*GridUpdateOne) SetNillableToken

func (_u *GridUpdateOne) SetNillableToken(v *string) *GridUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*GridUpdateOne) SetOrderPrice

func (_u *GridUpdateOne) SetOrderPrice(v decimal.Decimal) *GridUpdateOne

SetOrderPrice sets the "orderPrice" field.

func (*GridUpdateOne) SetQuantity

func (_u *GridUpdateOne) SetQuantity(v decimal.Decimal) *GridUpdateOne

SetQuantity sets the "quantity" field.

func (*GridUpdateOne) SetStatus

func (_u *GridUpdateOne) SetStatus(v grid.Status) *GridUpdateOne

SetStatus sets the "status" field.

func (*GridUpdateOne) SetStrategyId

func (_u *GridUpdateOne) SetStrategyId(v string) *GridUpdateOne

SetStrategyId sets the "strategyId" field.

func (*GridUpdateOne) SetSymbol

func (_u *GridUpdateOne) SetSymbol(v string) *GridUpdateOne

SetSymbol sets the "symbol" field.

func (*GridUpdateOne) SetToken

func (_u *GridUpdateOne) SetToken(v string) *GridUpdateOne

SetToken sets the "token" field.

func (*GridUpdateOne) SetUpdateTime

func (_u *GridUpdateOne) SetUpdateTime(v time.Time) *GridUpdateOne

SetUpdateTime sets the "update_time" field.

func (*GridUpdateOne) Where

func (_u *GridUpdateOne) Where(ps ...predicate.Grid) *GridUpdateOne

Where appends a list predicates to the GridUpdate builder.

type Grids

type Grids []*Grid

Grids is a parsable slice of Grid.

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 Nonce

type Nonce struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Account holds the value of the "account" field.
	Account string `json:"account,omitempty"`
	// Nonce holds the value of the "nonce" field.
	Nonce uint64 `json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

Nonce is the model entity for the Nonce schema.

func (*Nonce) String

func (_m *Nonce) String() string

String implements the fmt.Stringer.

func (*Nonce) Unwrap

func (_m *Nonce) Unwrap() *Nonce

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

func (_m *Nonce) Update() *NonceUpdateOne

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

func (*Nonce) Value

func (_m *Nonce) Value(name string) (ent.Value, error)

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

type NonceClient

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

NonceClient is a client for the Nonce schema.

func NewNonceClient

func NewNonceClient(c config) *NonceClient

NewNonceClient returns a client for the Nonce from the given config.

func (*NonceClient) Create

func (c *NonceClient) Create() *NonceCreate

Create returns a builder for creating a Nonce entity.

func (*NonceClient) CreateBulk

func (c *NonceClient) CreateBulk(builders ...*NonceCreate) *NonceCreateBulk

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

func (*NonceClient) Delete

func (c *NonceClient) Delete() *NonceDelete

Delete returns a delete builder for Nonce.

func (*NonceClient) DeleteOne

func (c *NonceClient) DeleteOne(_m *Nonce) *NonceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*NonceClient) DeleteOneID

func (c *NonceClient) DeleteOneID(id int) *NonceDeleteOne

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

func (*NonceClient) Get

func (c *NonceClient) Get(ctx context.Context, id int) (*Nonce, error)

Get returns a Nonce entity by its id.

func (*NonceClient) GetX

func (c *NonceClient) GetX(ctx context.Context, id int) *Nonce

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

func (*NonceClient) Hooks

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

Hooks returns the client hooks.

func (*NonceClient) Intercept

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

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

func (*NonceClient) Interceptors

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

Interceptors returns the client interceptors.

func (*NonceClient) MapCreateBulk

func (c *NonceClient) MapCreateBulk(slice any, setFunc func(*NonceCreate, int)) *NonceCreateBulk

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 (*NonceClient) Query

func (c *NonceClient) Query() *NonceQuery

Query returns a query builder for Nonce.

func (*NonceClient) Update

func (c *NonceClient) Update() *NonceUpdate

Update returns an update builder for Nonce.

func (*NonceClient) UpdateOne

func (c *NonceClient) UpdateOne(_m *Nonce) *NonceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*NonceClient) UpdateOneID

func (c *NonceClient) UpdateOneID(id int) *NonceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*NonceClient) Use

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

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

type NonceCreate

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

NonceCreate is the builder for creating a Nonce entity.

func (*NonceCreate) Exec

func (_c *NonceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*NonceCreate) ExecX

func (_c *NonceCreate) ExecX(ctx context.Context)

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

func (*NonceCreate) Mutation

func (_c *NonceCreate) Mutation() *NonceMutation

Mutation returns the NonceMutation object of the builder.

func (*NonceCreate) Save

func (_c *NonceCreate) Save(ctx context.Context) (*Nonce, error)

Save creates the Nonce in the database.

func (*NonceCreate) SaveX

func (_c *NonceCreate) SaveX(ctx context.Context) *Nonce

SaveX calls Save and panics if Save returns an error.

func (*NonceCreate) SetAccount

func (_c *NonceCreate) SetAccount(v string) *NonceCreate

SetAccount sets the "account" field.

func (*NonceCreate) SetCreateTime

func (_c *NonceCreate) SetCreateTime(v time.Time) *NonceCreate

SetCreateTime sets the "create_time" field.

func (*NonceCreate) SetNillableCreateTime

func (_c *NonceCreate) SetNillableCreateTime(v *time.Time) *NonceCreate

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

func (*NonceCreate) SetNillableUpdateTime

func (_c *NonceCreate) SetNillableUpdateTime(v *time.Time) *NonceCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*NonceCreate) SetNonce

func (_c *NonceCreate) SetNonce(v uint64) *NonceCreate

SetNonce sets the "nonce" field.

func (*NonceCreate) SetUpdateTime

func (_c *NonceCreate) SetUpdateTime(v time.Time) *NonceCreate

SetUpdateTime sets the "update_time" field.

type NonceCreateBulk

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

NonceCreateBulk is the builder for creating many Nonce entities in bulk.

func (*NonceCreateBulk) Exec

func (_c *NonceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*NonceCreateBulk) ExecX

func (_c *NonceCreateBulk) ExecX(ctx context.Context)

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

func (*NonceCreateBulk) Save

func (_c *NonceCreateBulk) Save(ctx context.Context) ([]*Nonce, error)

Save creates the Nonce entities in the database.

func (*NonceCreateBulk) SaveX

func (_c *NonceCreateBulk) SaveX(ctx context.Context) []*Nonce

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

type NonceDelete

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

NonceDelete is the builder for deleting a Nonce entity.

func (*NonceDelete) Exec

func (_d *NonceDelete) Exec(ctx context.Context) (int, error)

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

func (*NonceDelete) ExecX

func (_d *NonceDelete) ExecX(ctx context.Context) int

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

func (*NonceDelete) Where

func (_d *NonceDelete) Where(ps ...predicate.Nonce) *NonceDelete

Where appends a list predicates to the NonceDelete builder.

type NonceDeleteOne

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

NonceDeleteOne is the builder for deleting a single Nonce entity.

func (*NonceDeleteOne) Exec

func (_d *NonceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*NonceDeleteOne) ExecX

func (_d *NonceDeleteOne) ExecX(ctx context.Context)

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

func (*NonceDeleteOne) Where

func (_d *NonceDeleteOne) Where(ps ...predicate.Nonce) *NonceDeleteOne

Where appends a list predicates to the NonceDelete builder.

type NonceGroupBy

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

NonceGroupBy is the group-by builder for Nonce entities.

func (*NonceGroupBy) Aggregate

func (_g *NonceGroupBy) Aggregate(fns ...AggregateFunc) *NonceGroupBy

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

func (*NonceGroupBy) Bool

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

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

func (*NonceGroupBy) BoolX

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

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

func (*NonceGroupBy) Bools

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

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

func (*NonceGroupBy) BoolsX

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

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

func (*NonceGroupBy) Float64

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

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

func (*NonceGroupBy) Float64X

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

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

func (*NonceGroupBy) Float64s

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

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

func (*NonceGroupBy) Float64sX

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

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

func (*NonceGroupBy) Int

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

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

func (*NonceGroupBy) IntX

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

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

func (*NonceGroupBy) Ints

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

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

func (*NonceGroupBy) IntsX

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

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

func (*NonceGroupBy) Scan

func (_g *NonceGroupBy) Scan(ctx context.Context, v any) error

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

func (*NonceGroupBy) ScanX

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

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

func (*NonceGroupBy) String

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

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

func (*NonceGroupBy) StringX

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

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

func (*NonceGroupBy) Strings

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

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

func (*NonceGroupBy) StringsX

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

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

type NonceMutation

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

NonceMutation represents an operation that mutates the Nonce nodes in the graph.

func (*NonceMutation) Account

func (m *NonceMutation) Account() (r string, exists bool)

Account returns the value of the "account" field in the mutation.

func (*NonceMutation) AddField

func (m *NonceMutation) 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 (*NonceMutation) AddNonce

func (m *NonceMutation) AddNonce(u int64)

AddNonce adds u to the "nonce" field.

func (*NonceMutation) AddedEdges

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

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

func (*NonceMutation) AddedField

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

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

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

func (*NonceMutation) AddedIDs

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

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

func (*NonceMutation) AddedNonce

func (m *NonceMutation) AddedNonce() (r int64, exists bool)

AddedNonce returns the value that was added to the "nonce" field in this mutation.

func (*NonceMutation) ClearEdge

func (m *NonceMutation) 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 (*NonceMutation) ClearField

func (m *NonceMutation) 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 (*NonceMutation) ClearedEdges

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

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

func (*NonceMutation) ClearedFields

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

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

func (NonceMutation) Client

func (m NonceMutation) 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 (*NonceMutation) CreateTime

func (m *NonceMutation) CreateTime() (r time.Time, exists bool)

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

func (*NonceMutation) EdgeCleared

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

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

func (*NonceMutation) Field

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

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

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

func (*NonceMutation) Fields

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

func (m *NonceMutation) 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 (*NonceMutation) IDs

func (m *NonceMutation) 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 (*NonceMutation) Nonce

func (m *NonceMutation) Nonce() (r uint64, exists bool)

Nonce returns the value of the "nonce" field in the mutation.

func (*NonceMutation) OldAccount

func (m *NonceMutation) OldAccount(ctx context.Context) (v string, err error)

OldAccount returns the old "account" field's value of the Nonce entity. If the Nonce 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 (*NonceMutation) OldCreateTime

func (m *NonceMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Nonce entity. If the Nonce 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 (*NonceMutation) OldField

func (m *NonceMutation) 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 (*NonceMutation) OldNonce

func (m *NonceMutation) OldNonce(ctx context.Context) (v uint64, err error)

OldNonce returns the old "nonce" field's value of the Nonce entity. If the Nonce 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 (*NonceMutation) OldUpdateTime

func (m *NonceMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Nonce entity. If the Nonce 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 (*NonceMutation) Op

func (m *NonceMutation) Op() Op

Op returns the operation name.

func (*NonceMutation) RemovedEdges

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

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

func (*NonceMutation) RemovedIDs

func (m *NonceMutation) 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 (*NonceMutation) ResetAccount

func (m *NonceMutation) ResetAccount()

ResetAccount resets all changes to the "account" field.

func (*NonceMutation) ResetCreateTime

func (m *NonceMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*NonceMutation) ResetEdge

func (m *NonceMutation) 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 (*NonceMutation) ResetField

func (m *NonceMutation) 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 (*NonceMutation) ResetNonce

func (m *NonceMutation) ResetNonce()

ResetNonce resets all changes to the "nonce" field.

func (*NonceMutation) ResetUpdateTime

func (m *NonceMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*NonceMutation) SetAccount

func (m *NonceMutation) SetAccount(s string)

SetAccount sets the "account" field.

func (*NonceMutation) SetCreateTime

func (m *NonceMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*NonceMutation) SetField

func (m *NonceMutation) 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 (*NonceMutation) SetNonce

func (m *NonceMutation) SetNonce(u uint64)

SetNonce sets the "nonce" field.

func (*NonceMutation) SetOp

func (m *NonceMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*NonceMutation) SetUpdateTime

func (m *NonceMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (NonceMutation) Tx

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

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

func (*NonceMutation) Type

func (m *NonceMutation) Type() string

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

func (*NonceMutation) UpdateTime

func (m *NonceMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*NonceMutation) Where

func (m *NonceMutation) Where(ps ...predicate.Nonce)

Where appends a list predicates to the NonceMutation builder.

func (*NonceMutation) WhereP

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

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

type NonceQuery

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

NonceQuery is the builder for querying Nonce entities.

func (*NonceQuery) Aggregate

func (_q *NonceQuery) Aggregate(fns ...AggregateFunc) *NonceSelect

Aggregate returns a NonceSelect configured with the given aggregations.

func (*NonceQuery) All

func (_q *NonceQuery) All(ctx context.Context) ([]*Nonce, error)

All executes the query and returns a list of Nonces.

func (*NonceQuery) AllX

func (_q *NonceQuery) AllX(ctx context.Context) []*Nonce

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

func (*NonceQuery) Clone

func (_q *NonceQuery) Clone() *NonceQuery

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

func (*NonceQuery) Count

func (_q *NonceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*NonceQuery) CountX

func (_q *NonceQuery) CountX(ctx context.Context) int

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

func (*NonceQuery) Exist

func (_q *NonceQuery) Exist(ctx context.Context) (bool, error)

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

func (*NonceQuery) ExistX

func (_q *NonceQuery) ExistX(ctx context.Context) bool

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

func (*NonceQuery) First

func (_q *NonceQuery) First(ctx context.Context) (*Nonce, error)

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

func (*NonceQuery) FirstID

func (_q *NonceQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*NonceQuery) FirstIDX

func (_q *NonceQuery) FirstIDX(ctx context.Context) int

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

func (*NonceQuery) FirstX

func (_q *NonceQuery) FirstX(ctx context.Context) *Nonce

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

func (*NonceQuery) GroupBy

func (_q *NonceQuery) GroupBy(field string, fields ...string) *NonceGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Nonce.Query().
	GroupBy(nonce.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*NonceQuery) IDs

func (_q *NonceQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*NonceQuery) IDsX

func (_q *NonceQuery) IDsX(ctx context.Context) []int

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

func (*NonceQuery) Limit

func (_q *NonceQuery) Limit(limit int) *NonceQuery

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

func (*NonceQuery) Offset

func (_q *NonceQuery) Offset(offset int) *NonceQuery

Offset to start from.

func (*NonceQuery) Only

func (_q *NonceQuery) Only(ctx context.Context) (*Nonce, error)

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

func (*NonceQuery) OnlyID

func (_q *NonceQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*NonceQuery) OnlyIDX

func (_q *NonceQuery) OnlyIDX(ctx context.Context) int

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

func (*NonceQuery) OnlyX

func (_q *NonceQuery) OnlyX(ctx context.Context) *Nonce

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

func (*NonceQuery) Order

func (_q *NonceQuery) Order(o ...nonce.OrderOption) *NonceQuery

Order specifies how the records should be ordered.

func (*NonceQuery) Select

func (_q *NonceQuery) Select(fields ...string) *NonceSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Nonce.Query().
	Select(nonce.FieldCreateTime).
	Scan(ctx, &v)

func (*NonceQuery) Unique

func (_q *NonceQuery) Unique(unique bool) *NonceQuery

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

func (_q *NonceQuery) Where(ps ...predicate.Nonce) *NonceQuery

Where adds a new predicate for the NonceQuery builder.

type NonceSelect

type NonceSelect struct {
	*NonceQuery
	// contains filtered or unexported fields
}

NonceSelect is the builder for selecting fields of Nonce entities.

func (*NonceSelect) Aggregate

func (_s *NonceSelect) Aggregate(fns ...AggregateFunc) *NonceSelect

Aggregate adds the given aggregation functions to the selector query.

func (*NonceSelect) Bool

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

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

func (*NonceSelect) BoolX

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

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

func (*NonceSelect) Bools

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

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

func (*NonceSelect) BoolsX

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

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

func (*NonceSelect) Float64

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

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

func (*NonceSelect) Float64X

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

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

func (*NonceSelect) Float64s

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

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

func (*NonceSelect) Float64sX

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

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

func (*NonceSelect) Int

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

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

func (*NonceSelect) IntX

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

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

func (*NonceSelect) Ints

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

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

func (*NonceSelect) IntsX

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

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

func (*NonceSelect) Scan

func (_s *NonceSelect) Scan(ctx context.Context, v any) error

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

func (*NonceSelect) ScanX

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

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

func (*NonceSelect) String

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

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

func (*NonceSelect) StringX

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

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

func (*NonceSelect) Strings

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

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

func (*NonceSelect) StringsX

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

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

type NonceUpdate

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

NonceUpdate is the builder for updating Nonce entities.

func (*NonceUpdate) AddNonce

func (_u *NonceUpdate) AddNonce(v int64) *NonceUpdate

AddNonce adds value to the "nonce" field.

func (*NonceUpdate) Exec

func (_u *NonceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*NonceUpdate) ExecX

func (_u *NonceUpdate) ExecX(ctx context.Context)

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

func (*NonceUpdate) Mutation

func (_u *NonceUpdate) Mutation() *NonceMutation

Mutation returns the NonceMutation object of the builder.

func (*NonceUpdate) Save

func (_u *NonceUpdate) Save(ctx context.Context) (int, error)

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

func (*NonceUpdate) SaveX

func (_u *NonceUpdate) SaveX(ctx context.Context) int

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

func (*NonceUpdate) SetAccount

func (_u *NonceUpdate) SetAccount(v string) *NonceUpdate

SetAccount sets the "account" field.

func (*NonceUpdate) SetNillableAccount

func (_u *NonceUpdate) SetNillableAccount(v *string) *NonceUpdate

SetNillableAccount sets the "account" field if the given value is not nil.

func (*NonceUpdate) SetNillableNonce

func (_u *NonceUpdate) SetNillableNonce(v *uint64) *NonceUpdate

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*NonceUpdate) SetNonce

func (_u *NonceUpdate) SetNonce(v uint64) *NonceUpdate

SetNonce sets the "nonce" field.

func (*NonceUpdate) SetUpdateTime

func (_u *NonceUpdate) SetUpdateTime(v time.Time) *NonceUpdate

SetUpdateTime sets the "update_time" field.

func (*NonceUpdate) Where

func (_u *NonceUpdate) Where(ps ...predicate.Nonce) *NonceUpdate

Where appends a list predicates to the NonceUpdate builder.

type NonceUpdateOne

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

NonceUpdateOne is the builder for updating a single Nonce entity.

func (*NonceUpdateOne) AddNonce

func (_u *NonceUpdateOne) AddNonce(v int64) *NonceUpdateOne

AddNonce adds value to the "nonce" field.

func (*NonceUpdateOne) Exec

func (_u *NonceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*NonceUpdateOne) ExecX

func (_u *NonceUpdateOne) ExecX(ctx context.Context)

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

func (*NonceUpdateOne) Mutation

func (_u *NonceUpdateOne) Mutation() *NonceMutation

Mutation returns the NonceMutation object of the builder.

func (*NonceUpdateOne) Save

func (_u *NonceUpdateOne) Save(ctx context.Context) (*Nonce, error)

Save executes the query and returns the updated Nonce entity.

func (*NonceUpdateOne) SaveX

func (_u *NonceUpdateOne) SaveX(ctx context.Context) *Nonce

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

func (*NonceUpdateOne) Select

func (_u *NonceUpdateOne) Select(field string, fields ...string) *NonceUpdateOne

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

func (*NonceUpdateOne) SetAccount

func (_u *NonceUpdateOne) SetAccount(v string) *NonceUpdateOne

SetAccount sets the "account" field.

func (*NonceUpdateOne) SetNillableAccount

func (_u *NonceUpdateOne) SetNillableAccount(v *string) *NonceUpdateOne

SetNillableAccount sets the "account" field if the given value is not nil.

func (*NonceUpdateOne) SetNillableNonce

func (_u *NonceUpdateOne) SetNillableNonce(v *uint64) *NonceUpdateOne

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*NonceUpdateOne) SetNonce

func (_u *NonceUpdateOne) SetNonce(v uint64) *NonceUpdateOne

SetNonce sets the "nonce" field.

func (*NonceUpdateOne) SetUpdateTime

func (_u *NonceUpdateOne) SetUpdateTime(v time.Time) *NonceUpdateOne

SetUpdateTime sets the "update_time" field.

func (*NonceUpdateOne) Where

func (_u *NonceUpdateOne) Where(ps ...predicate.Nonce) *NonceUpdateOne

Where appends a list predicates to the NonceUpdate builder.

type Nonces

type Nonces []*Nonce

Nonces is a parsable slice of Nonce.

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 Order

type Order struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// Account holds the value of the "account" field.
	Account string `json:"account,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,omitempty"`
	// Symbol holds the value of the "symbol" field.
	Symbol string `json:"symbol,omitempty"`
	// GridId holds the value of the "gridId" field.
	GridId *string `json:"gridId,omitempty"`
	// GridNumber holds the value of the "gridNumber" field.
	GridNumber *int `json:"gridNumber,omitempty"`
	// GridBuyCost holds the value of the "gridBuyCost" field.
	GridBuyCost *decimal.Decimal `json:"gridBuyCost,omitempty"`
	// StrategyId holds the value of the "strategyId" field.
	StrategyId string `json:"strategyId,omitempty"`
	// Type holds the value of the "type" field.
	Type order.Type `json:"type,omitempty"`
	// Price holds the value of the "price" field.
	Price decimal.Decimal `json:"price,omitempty"`
	// FinalPrice holds the value of the "finalPrice" field.
	FinalPrice decimal.Decimal `json:"finalPrice,omitempty"`
	// InAmount holds the value of the "inAmount" field.
	InAmount decimal.Decimal `json:"inAmount,omitempty"`
	// OutAmount holds the value of the "outAmount" field.
	OutAmount decimal.Decimal `json:"outAmount,omitempty"`
	// Status holds the value of the "status" field.
	Status order.Status `json:"status,omitempty"`
	// Nonce holds the value of the "nonce" field.
	Nonce uint64 `json:"nonce,omitempty"`
	// TxHash holds the value of the "txHash" field.
	TxHash string `json:"txHash,omitempty"`
	// Reason holds the value of the "reason" field.
	Reason string `json:"reason,omitempty"`
	// Profit holds the value of the "profit" field.
	Profit *decimal.Decimal `json:"profit,omitempty"`
	// contains filtered or unexported fields
}

Order is the model entity for the Order schema.

func (*Order) String

func (_m *Order) String() string

String implements the fmt.Stringer.

func (*Order) Unwrap

func (_m *Order) Unwrap() *Order

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

func (_m *Order) Update() *OrderUpdateOne

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

func (*Order) Value

func (_m *Order) Value(name string) (ent.Value, error)

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

type OrderClient

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

OrderClient is a client for the Order schema.

func NewOrderClient

func NewOrderClient(c config) *OrderClient

NewOrderClient returns a client for the Order from the given config.

func (*OrderClient) Create

func (c *OrderClient) Create() *OrderCreate

Create returns a builder for creating a Order entity.

func (*OrderClient) CreateBulk

func (c *OrderClient) CreateBulk(builders ...*OrderCreate) *OrderCreateBulk

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

func (*OrderClient) Delete

func (c *OrderClient) Delete() *OrderDelete

Delete returns a delete builder for Order.

func (*OrderClient) DeleteOne

func (c *OrderClient) DeleteOne(_m *Order) *OrderDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*OrderClient) DeleteOneID

func (c *OrderClient) DeleteOneID(id int) *OrderDeleteOne

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

func (*OrderClient) Get

func (c *OrderClient) Get(ctx context.Context, id int) (*Order, error)

Get returns a Order entity by its id.

func (*OrderClient) GetX

func (c *OrderClient) GetX(ctx context.Context, id int) *Order

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

func (*OrderClient) Hooks

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

Hooks returns the client hooks.

func (*OrderClient) Intercept

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

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

func (*OrderClient) Interceptors

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

Interceptors returns the client interceptors.

func (*OrderClient) MapCreateBulk

func (c *OrderClient) MapCreateBulk(slice any, setFunc func(*OrderCreate, int)) *OrderCreateBulk

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 (*OrderClient) Query

func (c *OrderClient) Query() *OrderQuery

Query returns a query builder for Order.

func (*OrderClient) Update

func (c *OrderClient) Update() *OrderUpdate

Update returns an update builder for Order.

func (*OrderClient) UpdateOne

func (c *OrderClient) UpdateOne(_m *Order) *OrderUpdateOne

UpdateOne returns an update builder for the given entity.

func (*OrderClient) UpdateOneID

func (c *OrderClient) UpdateOneID(id int) *OrderUpdateOne

UpdateOneID returns an update builder for the given id.

func (*OrderClient) Use

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

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

type OrderCreate

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

OrderCreate is the builder for creating a Order entity.

func (*OrderCreate) Exec

func (_c *OrderCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderCreate) ExecX

func (_c *OrderCreate) ExecX(ctx context.Context)

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

func (*OrderCreate) Mutation

func (_c *OrderCreate) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderCreate) Save

func (_c *OrderCreate) Save(ctx context.Context) (*Order, error)

Save creates the Order in the database.

func (*OrderCreate) SaveX

func (_c *OrderCreate) SaveX(ctx context.Context) *Order

SaveX calls Save and panics if Save returns an error.

func (*OrderCreate) SetAccount

func (_c *OrderCreate) SetAccount(v string) *OrderCreate

SetAccount sets the "account" field.

func (*OrderCreate) SetCreateTime

func (_c *OrderCreate) SetCreateTime(v time.Time) *OrderCreate

SetCreateTime sets the "create_time" field.

func (*OrderCreate) SetFinalPrice

func (_c *OrderCreate) SetFinalPrice(v decimal.Decimal) *OrderCreate

SetFinalPrice sets the "finalPrice" field.

func (*OrderCreate) SetGridBuyCost

func (_c *OrderCreate) SetGridBuyCost(v decimal.Decimal) *OrderCreate

SetGridBuyCost sets the "gridBuyCost" field.

func (*OrderCreate) SetGridId

func (_c *OrderCreate) SetGridId(v string) *OrderCreate

SetGridId sets the "gridId" field.

func (*OrderCreate) SetGridNumber

func (_c *OrderCreate) SetGridNumber(v int) *OrderCreate

SetGridNumber sets the "gridNumber" field.

func (*OrderCreate) SetInAmount

func (_c *OrderCreate) SetInAmount(v decimal.Decimal) *OrderCreate

SetInAmount sets the "inAmount" field.

func (*OrderCreate) SetNillableCreateTime

func (_c *OrderCreate) SetNillableCreateTime(v *time.Time) *OrderCreate

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

func (*OrderCreate) SetNillableGridBuyCost

func (_c *OrderCreate) SetNillableGridBuyCost(v *decimal.Decimal) *OrderCreate

SetNillableGridBuyCost sets the "gridBuyCost" field if the given value is not nil.

func (*OrderCreate) SetNillableGridId

func (_c *OrderCreate) SetNillableGridId(v *string) *OrderCreate

SetNillableGridId sets the "gridId" field if the given value is not nil.

func (*OrderCreate) SetNillableGridNumber

func (_c *OrderCreate) SetNillableGridNumber(v *int) *OrderCreate

SetNillableGridNumber sets the "gridNumber" field if the given value is not nil.

func (*OrderCreate) SetNillableProfit

func (_c *OrderCreate) SetNillableProfit(v *decimal.Decimal) *OrderCreate

SetNillableProfit sets the "profit" field if the given value is not nil.

func (*OrderCreate) SetNillableUpdateTime

func (_c *OrderCreate) SetNillableUpdateTime(v *time.Time) *OrderCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*OrderCreate) SetNonce

func (_c *OrderCreate) SetNonce(v uint64) *OrderCreate

SetNonce sets the "nonce" field.

func (*OrderCreate) SetOutAmount

func (_c *OrderCreate) SetOutAmount(v decimal.Decimal) *OrderCreate

SetOutAmount sets the "outAmount" field.

func (*OrderCreate) SetPrice

func (_c *OrderCreate) SetPrice(v decimal.Decimal) *OrderCreate

SetPrice sets the "price" field.

func (*OrderCreate) SetProfit

func (_c *OrderCreate) SetProfit(v decimal.Decimal) *OrderCreate

SetProfit sets the "profit" field.

func (*OrderCreate) SetReason

func (_c *OrderCreate) SetReason(v string) *OrderCreate

SetReason sets the "reason" field.

func (*OrderCreate) SetStatus

func (_c *OrderCreate) SetStatus(v order.Status) *OrderCreate

SetStatus sets the "status" field.

func (*OrderCreate) SetStrategyId

func (_c *OrderCreate) SetStrategyId(v string) *OrderCreate

SetStrategyId sets the "strategyId" field.

func (*OrderCreate) SetSymbol

func (_c *OrderCreate) SetSymbol(v string) *OrderCreate

SetSymbol sets the "symbol" field.

func (*OrderCreate) SetToken

func (_c *OrderCreate) SetToken(v string) *OrderCreate

SetToken sets the "token" field.

func (*OrderCreate) SetTxHash

func (_c *OrderCreate) SetTxHash(v string) *OrderCreate

SetTxHash sets the "txHash" field.

func (*OrderCreate) SetType

func (_c *OrderCreate) SetType(v order.Type) *OrderCreate

SetType sets the "type" field.

func (*OrderCreate) SetUpdateTime

func (_c *OrderCreate) SetUpdateTime(v time.Time) *OrderCreate

SetUpdateTime sets the "update_time" field.

type OrderCreateBulk

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

OrderCreateBulk is the builder for creating many Order entities in bulk.

func (*OrderCreateBulk) Exec

func (_c *OrderCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderCreateBulk) ExecX

func (_c *OrderCreateBulk) ExecX(ctx context.Context)

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

func (*OrderCreateBulk) Save

func (_c *OrderCreateBulk) Save(ctx context.Context) ([]*Order, error)

Save creates the Order entities in the database.

func (*OrderCreateBulk) SaveX

func (_c *OrderCreateBulk) SaveX(ctx context.Context) []*Order

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

type OrderDelete

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

OrderDelete is the builder for deleting a Order entity.

func (*OrderDelete) Exec

func (_d *OrderDelete) Exec(ctx context.Context) (int, error)

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

func (*OrderDelete) ExecX

func (_d *OrderDelete) ExecX(ctx context.Context) int

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

func (*OrderDelete) Where

func (_d *OrderDelete) Where(ps ...predicate.Order) *OrderDelete

Where appends a list predicates to the OrderDelete builder.

type OrderDeleteOne

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

OrderDeleteOne is the builder for deleting a single Order entity.

func (*OrderDeleteOne) Exec

func (_d *OrderDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*OrderDeleteOne) ExecX

func (_d *OrderDeleteOne) ExecX(ctx context.Context)

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

func (*OrderDeleteOne) Where

func (_d *OrderDeleteOne) Where(ps ...predicate.Order) *OrderDeleteOne

Where appends a list predicates to the OrderDelete builder.

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 OrderGroupBy

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

OrderGroupBy is the group-by builder for Order entities.

func (*OrderGroupBy) Aggregate

func (_g *OrderGroupBy) Aggregate(fns ...AggregateFunc) *OrderGroupBy

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

func (*OrderGroupBy) Bool

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

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

func (*OrderGroupBy) BoolX

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

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

func (*OrderGroupBy) Bools

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

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

func (*OrderGroupBy) BoolsX

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

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

func (*OrderGroupBy) Float64

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

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

func (*OrderGroupBy) Float64X

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

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

func (*OrderGroupBy) Float64s

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

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

func (*OrderGroupBy) Float64sX

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

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

func (*OrderGroupBy) Int

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

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

func (*OrderGroupBy) IntX

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

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

func (*OrderGroupBy) Ints

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

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

func (*OrderGroupBy) IntsX

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

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

func (*OrderGroupBy) Scan

func (_g *OrderGroupBy) Scan(ctx context.Context, v any) error

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

func (*OrderGroupBy) ScanX

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

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

func (*OrderGroupBy) String

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

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

func (*OrderGroupBy) StringX

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

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

func (*OrderGroupBy) Strings

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

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

func (*OrderGroupBy) StringsX

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

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

type OrderMutation

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

OrderMutation represents an operation that mutates the Order nodes in the graph.

func (*OrderMutation) Account

func (m *OrderMutation) Account() (r string, exists bool)

Account returns the value of the "account" field in the mutation.

func (*OrderMutation) AddField

func (m *OrderMutation) 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 (*OrderMutation) AddGridNumber

func (m *OrderMutation) AddGridNumber(i int)

AddGridNumber adds i to the "gridNumber" field.

func (*OrderMutation) AddNonce

func (m *OrderMutation) AddNonce(u int64)

AddNonce adds u to the "nonce" field.

func (*OrderMutation) AddedEdges

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

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

func (*OrderMutation) AddedField

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

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

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

func (*OrderMutation) AddedGridNumber

func (m *OrderMutation) AddedGridNumber() (r int, exists bool)

AddedGridNumber returns the value that was added to the "gridNumber" field in this mutation.

func (*OrderMutation) AddedIDs

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

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

func (*OrderMutation) AddedNonce

func (m *OrderMutation) AddedNonce() (r int64, exists bool)

AddedNonce returns the value that was added to the "nonce" field in this mutation.

func (*OrderMutation) ClearEdge

func (m *OrderMutation) 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 (*OrderMutation) ClearField

func (m *OrderMutation) 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 (*OrderMutation) ClearGridBuyCost

func (m *OrderMutation) ClearGridBuyCost()

ClearGridBuyCost clears the value of the "gridBuyCost" field.

func (*OrderMutation) ClearGridId

func (m *OrderMutation) ClearGridId()

ClearGridId clears the value of the "gridId" field.

func (*OrderMutation) ClearGridNumber

func (m *OrderMutation) ClearGridNumber()

ClearGridNumber clears the value of the "gridNumber" field.

func (*OrderMutation) ClearProfit

func (m *OrderMutation) ClearProfit()

ClearProfit clears the value of the "profit" field.

func (*OrderMutation) ClearedEdges

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

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

func (*OrderMutation) ClearedFields

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

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

func (OrderMutation) Client

func (m OrderMutation) 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 (*OrderMutation) CreateTime

func (m *OrderMutation) CreateTime() (r time.Time, exists bool)

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

func (*OrderMutation) EdgeCleared

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

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

func (*OrderMutation) Field

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

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

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

func (*OrderMutation) Fields

func (m *OrderMutation) 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 (*OrderMutation) FinalPrice

func (m *OrderMutation) FinalPrice() (r decimal.Decimal, exists bool)

FinalPrice returns the value of the "finalPrice" field in the mutation.

func (*OrderMutation) GetType

func (m *OrderMutation) GetType() (r order.Type, exists bool)

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

func (*OrderMutation) GridBuyCost

func (m *OrderMutation) GridBuyCost() (r decimal.Decimal, exists bool)

GridBuyCost returns the value of the "gridBuyCost" field in the mutation.

func (*OrderMutation) GridBuyCostCleared

func (m *OrderMutation) GridBuyCostCleared() bool

GridBuyCostCleared returns if the "gridBuyCost" field was cleared in this mutation.

func (*OrderMutation) GridId

func (m *OrderMutation) GridId() (r string, exists bool)

GridId returns the value of the "gridId" field in the mutation.

func (*OrderMutation) GridIdCleared

func (m *OrderMutation) GridIdCleared() bool

GridIdCleared returns if the "gridId" field was cleared in this mutation.

func (*OrderMutation) GridNumber

func (m *OrderMutation) GridNumber() (r int, exists bool)

GridNumber returns the value of the "gridNumber" field in the mutation.

func (*OrderMutation) GridNumberCleared

func (m *OrderMutation) GridNumberCleared() bool

GridNumberCleared returns if the "gridNumber" field was cleared in this mutation.

func (*OrderMutation) ID

func (m *OrderMutation) 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 (*OrderMutation) IDs

func (m *OrderMutation) 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 (*OrderMutation) InAmount

func (m *OrderMutation) InAmount() (r decimal.Decimal, exists bool)

InAmount returns the value of the "inAmount" field in the mutation.

func (*OrderMutation) Nonce

func (m *OrderMutation) Nonce() (r uint64, exists bool)

Nonce returns the value of the "nonce" field in the mutation.

func (*OrderMutation) OldAccount

func (m *OrderMutation) OldAccount(ctx context.Context) (v string, err error)

OldAccount returns the old "account" field's value of the Order entity. If the Order 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 (*OrderMutation) OldCreateTime

func (m *OrderMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Order entity. If the Order 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 (*OrderMutation) OldField

func (m *OrderMutation) 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 (*OrderMutation) OldFinalPrice

func (m *OrderMutation) OldFinalPrice(ctx context.Context) (v decimal.Decimal, err error)

OldFinalPrice returns the old "finalPrice" field's value of the Order entity. If the Order 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 (*OrderMutation) OldGridBuyCost

func (m *OrderMutation) OldGridBuyCost(ctx context.Context) (v *decimal.Decimal, err error)

OldGridBuyCost returns the old "gridBuyCost" field's value of the Order entity. If the Order 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 (*OrderMutation) OldGridId

func (m *OrderMutation) OldGridId(ctx context.Context) (v *string, err error)

OldGridId returns the old "gridId" field's value of the Order entity. If the Order 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 (*OrderMutation) OldGridNumber

func (m *OrderMutation) OldGridNumber(ctx context.Context) (v *int, err error)

OldGridNumber returns the old "gridNumber" field's value of the Order entity. If the Order 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 (*OrderMutation) OldInAmount

func (m *OrderMutation) OldInAmount(ctx context.Context) (v decimal.Decimal, err error)

OldInAmount returns the old "inAmount" field's value of the Order entity. If the Order 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 (*OrderMutation) OldNonce

func (m *OrderMutation) OldNonce(ctx context.Context) (v uint64, err error)

OldNonce returns the old "nonce" field's value of the Order entity. If the Order 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 (*OrderMutation) OldOutAmount

func (m *OrderMutation) OldOutAmount(ctx context.Context) (v decimal.Decimal, err error)

OldOutAmount returns the old "outAmount" field's value of the Order entity. If the Order 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 (*OrderMutation) OldPrice

func (m *OrderMutation) OldPrice(ctx context.Context) (v decimal.Decimal, err error)

OldPrice returns the old "price" field's value of the Order entity. If the Order 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 (*OrderMutation) OldProfit

func (m *OrderMutation) OldProfit(ctx context.Context) (v *decimal.Decimal, err error)

OldProfit returns the old "profit" field's value of the Order entity. If the Order 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 (*OrderMutation) OldReason

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

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

func (m *OrderMutation) OldStatus(ctx context.Context) (v order.Status, err error)

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

func (m *OrderMutation) OldStrategyId(ctx context.Context) (v string, err error)

OldStrategyId returns the old "strategyId" field's value of the Order entity. If the Order 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 (*OrderMutation) OldSymbol

func (m *OrderMutation) OldSymbol(ctx context.Context) (v string, err error)

OldSymbol returns the old "symbol" field's value of the Order entity. If the Order 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 (*OrderMutation) OldToken

func (m *OrderMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Order entity. If the Order 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 (*OrderMutation) OldTxHash

func (m *OrderMutation) OldTxHash(ctx context.Context) (v string, err error)

OldTxHash returns the old "txHash" field's value of the Order entity. If the Order 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 (*OrderMutation) OldType

func (m *OrderMutation) OldType(ctx context.Context) (v order.Type, err error)

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

func (m *OrderMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Order entity. If the Order 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 (*OrderMutation) Op

func (m *OrderMutation) Op() Op

Op returns the operation name.

func (*OrderMutation) OutAmount

func (m *OrderMutation) OutAmount() (r decimal.Decimal, exists bool)

OutAmount returns the value of the "outAmount" field in the mutation.

func (*OrderMutation) Price

func (m *OrderMutation) Price() (r decimal.Decimal, exists bool)

Price returns the value of the "price" field in the mutation.

func (*OrderMutation) Profit

func (m *OrderMutation) Profit() (r decimal.Decimal, exists bool)

Profit returns the value of the "profit" field in the mutation.

func (*OrderMutation) ProfitCleared

func (m *OrderMutation) ProfitCleared() bool

ProfitCleared returns if the "profit" field was cleared in this mutation.

func (*OrderMutation) Reason

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

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

func (*OrderMutation) RemovedEdges

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

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

func (*OrderMutation) RemovedIDs

func (m *OrderMutation) 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 (*OrderMutation) ResetAccount

func (m *OrderMutation) ResetAccount()

ResetAccount resets all changes to the "account" field.

func (*OrderMutation) ResetCreateTime

func (m *OrderMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*OrderMutation) ResetEdge

func (m *OrderMutation) 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 (*OrderMutation) ResetField

func (m *OrderMutation) 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 (*OrderMutation) ResetFinalPrice

func (m *OrderMutation) ResetFinalPrice()

ResetFinalPrice resets all changes to the "finalPrice" field.

func (*OrderMutation) ResetGridBuyCost

func (m *OrderMutation) ResetGridBuyCost()

ResetGridBuyCost resets all changes to the "gridBuyCost" field.

func (*OrderMutation) ResetGridId

func (m *OrderMutation) ResetGridId()

ResetGridId resets all changes to the "gridId" field.

func (*OrderMutation) ResetGridNumber

func (m *OrderMutation) ResetGridNumber()

ResetGridNumber resets all changes to the "gridNumber" field.

func (*OrderMutation) ResetInAmount

func (m *OrderMutation) ResetInAmount()

ResetInAmount resets all changes to the "inAmount" field.

func (*OrderMutation) ResetNonce

func (m *OrderMutation) ResetNonce()

ResetNonce resets all changes to the "nonce" field.

func (*OrderMutation) ResetOutAmount

func (m *OrderMutation) ResetOutAmount()

ResetOutAmount resets all changes to the "outAmount" field.

func (*OrderMutation) ResetPrice

func (m *OrderMutation) ResetPrice()

ResetPrice resets all changes to the "price" field.

func (*OrderMutation) ResetProfit

func (m *OrderMutation) ResetProfit()

ResetProfit resets all changes to the "profit" field.

func (*OrderMutation) ResetReason

func (m *OrderMutation) ResetReason()

ResetReason resets all changes to the "reason" field.

func (*OrderMutation) ResetStatus

func (m *OrderMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*OrderMutation) ResetStrategyId

func (m *OrderMutation) ResetStrategyId()

ResetStrategyId resets all changes to the "strategyId" field.

func (*OrderMutation) ResetSymbol

func (m *OrderMutation) ResetSymbol()

ResetSymbol resets all changes to the "symbol" field.

func (*OrderMutation) ResetToken

func (m *OrderMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*OrderMutation) ResetTxHash

func (m *OrderMutation) ResetTxHash()

ResetTxHash resets all changes to the "txHash" field.

func (*OrderMutation) ResetType

func (m *OrderMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*OrderMutation) ResetUpdateTime

func (m *OrderMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*OrderMutation) SetAccount

func (m *OrderMutation) SetAccount(s string)

SetAccount sets the "account" field.

func (*OrderMutation) SetCreateTime

func (m *OrderMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*OrderMutation) SetField

func (m *OrderMutation) 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 (*OrderMutation) SetFinalPrice

func (m *OrderMutation) SetFinalPrice(d decimal.Decimal)

SetFinalPrice sets the "finalPrice" field.

func (*OrderMutation) SetGridBuyCost

func (m *OrderMutation) SetGridBuyCost(d decimal.Decimal)

SetGridBuyCost sets the "gridBuyCost" field.

func (*OrderMutation) SetGridId

func (m *OrderMutation) SetGridId(s string)

SetGridId sets the "gridId" field.

func (*OrderMutation) SetGridNumber

func (m *OrderMutation) SetGridNumber(i int)

SetGridNumber sets the "gridNumber" field.

func (*OrderMutation) SetInAmount

func (m *OrderMutation) SetInAmount(d decimal.Decimal)

SetInAmount sets the "inAmount" field.

func (*OrderMutation) SetNonce

func (m *OrderMutation) SetNonce(u uint64)

SetNonce sets the "nonce" field.

func (*OrderMutation) SetOp

func (m *OrderMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*OrderMutation) SetOutAmount

func (m *OrderMutation) SetOutAmount(d decimal.Decimal)

SetOutAmount sets the "outAmount" field.

func (*OrderMutation) SetPrice

func (m *OrderMutation) SetPrice(d decimal.Decimal)

SetPrice sets the "price" field.

func (*OrderMutation) SetProfit

func (m *OrderMutation) SetProfit(d decimal.Decimal)

SetProfit sets the "profit" field.

func (*OrderMutation) SetReason

func (m *OrderMutation) SetReason(s string)

SetReason sets the "reason" field.

func (*OrderMutation) SetStatus

func (m *OrderMutation) SetStatus(o order.Status)

SetStatus sets the "status" field.

func (*OrderMutation) SetStrategyId

func (m *OrderMutation) SetStrategyId(s string)

SetStrategyId sets the "strategyId" field.

func (*OrderMutation) SetSymbol

func (m *OrderMutation) SetSymbol(s string)

SetSymbol sets the "symbol" field.

func (*OrderMutation) SetToken

func (m *OrderMutation) SetToken(s string)

SetToken sets the "token" field.

func (*OrderMutation) SetTxHash

func (m *OrderMutation) SetTxHash(s string)

SetTxHash sets the "txHash" field.

func (*OrderMutation) SetType

func (m *OrderMutation) SetType(o order.Type)

SetType sets the "type" field.

func (*OrderMutation) SetUpdateTime

func (m *OrderMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*OrderMutation) Status

func (m *OrderMutation) Status() (r order.Status, exists bool)

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

func (*OrderMutation) StrategyId

func (m *OrderMutation) StrategyId() (r string, exists bool)

StrategyId returns the value of the "strategyId" field in the mutation.

func (*OrderMutation) Symbol

func (m *OrderMutation) Symbol() (r string, exists bool)

Symbol returns the value of the "symbol" field in the mutation.

func (*OrderMutation) Token

func (m *OrderMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (OrderMutation) Tx

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

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

func (*OrderMutation) TxHash

func (m *OrderMutation) TxHash() (r string, exists bool)

TxHash returns the value of the "txHash" field in the mutation.

func (*OrderMutation) Type

func (m *OrderMutation) Type() string

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

func (*OrderMutation) UpdateTime

func (m *OrderMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*OrderMutation) Where

func (m *OrderMutation) Where(ps ...predicate.Order)

Where appends a list predicates to the OrderMutation builder.

func (*OrderMutation) WhereP

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

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

type OrderQuery

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

OrderQuery is the builder for querying Order entities.

func (*OrderQuery) Aggregate

func (_q *OrderQuery) Aggregate(fns ...AggregateFunc) *OrderSelect

Aggregate returns a OrderSelect configured with the given aggregations.

func (*OrderQuery) All

func (_q *OrderQuery) All(ctx context.Context) ([]*Order, error)

All executes the query and returns a list of Orders.

func (*OrderQuery) AllX

func (_q *OrderQuery) AllX(ctx context.Context) []*Order

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

func (*OrderQuery) Clone

func (_q *OrderQuery) Clone() *OrderQuery

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

func (*OrderQuery) Count

func (_q *OrderQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*OrderQuery) CountX

func (_q *OrderQuery) CountX(ctx context.Context) int

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

func (*OrderQuery) Exist

func (_q *OrderQuery) Exist(ctx context.Context) (bool, error)

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

func (*OrderQuery) ExistX

func (_q *OrderQuery) ExistX(ctx context.Context) bool

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

func (*OrderQuery) First

func (_q *OrderQuery) First(ctx context.Context) (*Order, error)

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

func (*OrderQuery) FirstID

func (_q *OrderQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*OrderQuery) FirstIDX

func (_q *OrderQuery) FirstIDX(ctx context.Context) int

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

func (*OrderQuery) FirstX

func (_q *OrderQuery) FirstX(ctx context.Context) *Order

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

func (*OrderQuery) GroupBy

func (_q *OrderQuery) GroupBy(field string, fields ...string) *OrderGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Order.Query().
	GroupBy(order.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*OrderQuery) IDs

func (_q *OrderQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*OrderQuery) IDsX

func (_q *OrderQuery) IDsX(ctx context.Context) []int

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

func (*OrderQuery) Limit

func (_q *OrderQuery) Limit(limit int) *OrderQuery

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

func (*OrderQuery) Offset

func (_q *OrderQuery) Offset(offset int) *OrderQuery

Offset to start from.

func (*OrderQuery) Only

func (_q *OrderQuery) Only(ctx context.Context) (*Order, error)

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

func (*OrderQuery) OnlyID

func (_q *OrderQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*OrderQuery) OnlyIDX

func (_q *OrderQuery) OnlyIDX(ctx context.Context) int

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

func (*OrderQuery) OnlyX

func (_q *OrderQuery) OnlyX(ctx context.Context) *Order

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

func (*OrderQuery) Order

func (_q *OrderQuery) Order(o ...order.OrderOption) *OrderQuery

Order specifies how the records should be ordered.

func (*OrderQuery) Select

func (_q *OrderQuery) Select(fields ...string) *OrderSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Order.Query().
	Select(order.FieldCreateTime).
	Scan(ctx, &v)

func (*OrderQuery) Unique

func (_q *OrderQuery) Unique(unique bool) *OrderQuery

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

func (_q *OrderQuery) Where(ps ...predicate.Order) *OrderQuery

Where adds a new predicate for the OrderQuery builder.

type OrderSelect

type OrderSelect struct {
	*OrderQuery
	// contains filtered or unexported fields
}

OrderSelect is the builder for selecting fields of Order entities.

func (*OrderSelect) Aggregate

func (_s *OrderSelect) Aggregate(fns ...AggregateFunc) *OrderSelect

Aggregate adds the given aggregation functions to the selector query.

func (*OrderSelect) Bool

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

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

func (*OrderSelect) BoolX

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

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

func (*OrderSelect) Bools

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

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

func (*OrderSelect) BoolsX

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

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

func (*OrderSelect) Float64

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

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

func (*OrderSelect) Float64X

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

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

func (*OrderSelect) Float64s

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

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

func (*OrderSelect) Float64sX

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

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

func (*OrderSelect) Int

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

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

func (*OrderSelect) IntX

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

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

func (*OrderSelect) Ints

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

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

func (*OrderSelect) IntsX

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

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

func (*OrderSelect) Scan

func (_s *OrderSelect) Scan(ctx context.Context, v any) error

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

func (*OrderSelect) ScanX

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

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

func (*OrderSelect) String

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

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

func (*OrderSelect) StringX

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

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

func (*OrderSelect) Strings

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

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

func (*OrderSelect) StringsX

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

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

type OrderUpdate

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

OrderUpdate is the builder for updating Order entities.

func (*OrderUpdate) AddGridNumber

func (_u *OrderUpdate) AddGridNumber(v int) *OrderUpdate

AddGridNumber adds value to the "gridNumber" field.

func (*OrderUpdate) AddNonce

func (_u *OrderUpdate) AddNonce(v int64) *OrderUpdate

AddNonce adds value to the "nonce" field.

func (*OrderUpdate) ClearGridBuyCost

func (_u *OrderUpdate) ClearGridBuyCost() *OrderUpdate

ClearGridBuyCost clears the value of the "gridBuyCost" field.

func (*OrderUpdate) ClearGridId

func (_u *OrderUpdate) ClearGridId() *OrderUpdate

ClearGridId clears the value of the "gridId" field.

func (*OrderUpdate) ClearGridNumber

func (_u *OrderUpdate) ClearGridNumber() *OrderUpdate

ClearGridNumber clears the value of the "gridNumber" field.

func (*OrderUpdate) ClearProfit

func (_u *OrderUpdate) ClearProfit() *OrderUpdate

ClearProfit clears the value of the "profit" field.

func (*OrderUpdate) Exec

func (_u *OrderUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*OrderUpdate) ExecX

func (_u *OrderUpdate) ExecX(ctx context.Context)

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

func (*OrderUpdate) Mutation

func (_u *OrderUpdate) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderUpdate) Save

func (_u *OrderUpdate) Save(ctx context.Context) (int, error)

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

func (*OrderUpdate) SaveX

func (_u *OrderUpdate) SaveX(ctx context.Context) int

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

func (*OrderUpdate) SetAccount

func (_u *OrderUpdate) SetAccount(v string) *OrderUpdate

SetAccount sets the "account" field.

func (*OrderUpdate) SetFinalPrice

func (_u *OrderUpdate) SetFinalPrice(v decimal.Decimal) *OrderUpdate

SetFinalPrice sets the "finalPrice" field.

func (*OrderUpdate) SetGridBuyCost

func (_u *OrderUpdate) SetGridBuyCost(v decimal.Decimal) *OrderUpdate

SetGridBuyCost sets the "gridBuyCost" field.

func (*OrderUpdate) SetGridId

func (_u *OrderUpdate) SetGridId(v string) *OrderUpdate

SetGridId sets the "gridId" field.

func (*OrderUpdate) SetGridNumber

func (_u *OrderUpdate) SetGridNumber(v int) *OrderUpdate

SetGridNumber sets the "gridNumber" field.

func (*OrderUpdate) SetInAmount

func (_u *OrderUpdate) SetInAmount(v decimal.Decimal) *OrderUpdate

SetInAmount sets the "inAmount" field.

func (*OrderUpdate) SetNillableAccount

func (_u *OrderUpdate) SetNillableAccount(v *string) *OrderUpdate

SetNillableAccount sets the "account" field if the given value is not nil.

func (*OrderUpdate) SetNillableFinalPrice

func (_u *OrderUpdate) SetNillableFinalPrice(v *decimal.Decimal) *OrderUpdate

SetNillableFinalPrice sets the "finalPrice" field if the given value is not nil.

func (*OrderUpdate) SetNillableGridBuyCost

func (_u *OrderUpdate) SetNillableGridBuyCost(v *decimal.Decimal) *OrderUpdate

SetNillableGridBuyCost sets the "gridBuyCost" field if the given value is not nil.

func (*OrderUpdate) SetNillableGridId

func (_u *OrderUpdate) SetNillableGridId(v *string) *OrderUpdate

SetNillableGridId sets the "gridId" field if the given value is not nil.

func (*OrderUpdate) SetNillableGridNumber

func (_u *OrderUpdate) SetNillableGridNumber(v *int) *OrderUpdate

SetNillableGridNumber sets the "gridNumber" field if the given value is not nil.

func (*OrderUpdate) SetNillableInAmount

func (_u *OrderUpdate) SetNillableInAmount(v *decimal.Decimal) *OrderUpdate

SetNillableInAmount sets the "inAmount" field if the given value is not nil.

func (*OrderUpdate) SetNillableNonce

func (_u *OrderUpdate) SetNillableNonce(v *uint64) *OrderUpdate

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*OrderUpdate) SetNillableOutAmount

func (_u *OrderUpdate) SetNillableOutAmount(v *decimal.Decimal) *OrderUpdate

SetNillableOutAmount sets the "outAmount" field if the given value is not nil.

func (*OrderUpdate) SetNillablePrice

func (_u *OrderUpdate) SetNillablePrice(v *decimal.Decimal) *OrderUpdate

SetNillablePrice sets the "price" field if the given value is not nil.

func (*OrderUpdate) SetNillableProfit

func (_u *OrderUpdate) SetNillableProfit(v *decimal.Decimal) *OrderUpdate

SetNillableProfit sets the "profit" field if the given value is not nil.

func (*OrderUpdate) SetNillableReason

func (_u *OrderUpdate) SetNillableReason(v *string) *OrderUpdate

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

func (*OrderUpdate) SetNillableStatus

func (_u *OrderUpdate) SetNillableStatus(v *order.Status) *OrderUpdate

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

func (*OrderUpdate) SetNillableStrategyId

func (_u *OrderUpdate) SetNillableStrategyId(v *string) *OrderUpdate

SetNillableStrategyId sets the "strategyId" field if the given value is not nil.

func (*OrderUpdate) SetNillableSymbol

func (_u *OrderUpdate) SetNillableSymbol(v *string) *OrderUpdate

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*OrderUpdate) SetNillableToken

func (_u *OrderUpdate) SetNillableToken(v *string) *OrderUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*OrderUpdate) SetNillableTxHash

func (_u *OrderUpdate) SetNillableTxHash(v *string) *OrderUpdate

SetNillableTxHash sets the "txHash" field if the given value is not nil.

func (*OrderUpdate) SetNillableType

func (_u *OrderUpdate) SetNillableType(v *order.Type) *OrderUpdate

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

func (*OrderUpdate) SetNonce

func (_u *OrderUpdate) SetNonce(v uint64) *OrderUpdate

SetNonce sets the "nonce" field.

func (*OrderUpdate) SetOutAmount

func (_u *OrderUpdate) SetOutAmount(v decimal.Decimal) *OrderUpdate

SetOutAmount sets the "outAmount" field.

func (*OrderUpdate) SetPrice

func (_u *OrderUpdate) SetPrice(v decimal.Decimal) *OrderUpdate

SetPrice sets the "price" field.

func (*OrderUpdate) SetProfit

func (_u *OrderUpdate) SetProfit(v decimal.Decimal) *OrderUpdate

SetProfit sets the "profit" field.

func (*OrderUpdate) SetReason

func (_u *OrderUpdate) SetReason(v string) *OrderUpdate

SetReason sets the "reason" field.

func (*OrderUpdate) SetStatus

func (_u *OrderUpdate) SetStatus(v order.Status) *OrderUpdate

SetStatus sets the "status" field.

func (*OrderUpdate) SetStrategyId

func (_u *OrderUpdate) SetStrategyId(v string) *OrderUpdate

SetStrategyId sets the "strategyId" field.

func (*OrderUpdate) SetSymbol

func (_u *OrderUpdate) SetSymbol(v string) *OrderUpdate

SetSymbol sets the "symbol" field.

func (*OrderUpdate) SetToken

func (_u *OrderUpdate) SetToken(v string) *OrderUpdate

SetToken sets the "token" field.

func (*OrderUpdate) SetTxHash

func (_u *OrderUpdate) SetTxHash(v string) *OrderUpdate

SetTxHash sets the "txHash" field.

func (*OrderUpdate) SetType

func (_u *OrderUpdate) SetType(v order.Type) *OrderUpdate

SetType sets the "type" field.

func (*OrderUpdate) SetUpdateTime

func (_u *OrderUpdate) SetUpdateTime(v time.Time) *OrderUpdate

SetUpdateTime sets the "update_time" field.

func (*OrderUpdate) Where

func (_u *OrderUpdate) Where(ps ...predicate.Order) *OrderUpdate

Where appends a list predicates to the OrderUpdate builder.

type OrderUpdateOne

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

OrderUpdateOne is the builder for updating a single Order entity.

func (*OrderUpdateOne) AddGridNumber

func (_u *OrderUpdateOne) AddGridNumber(v int) *OrderUpdateOne

AddGridNumber adds value to the "gridNumber" field.

func (*OrderUpdateOne) AddNonce

func (_u *OrderUpdateOne) AddNonce(v int64) *OrderUpdateOne

AddNonce adds value to the "nonce" field.

func (*OrderUpdateOne) ClearGridBuyCost

func (_u *OrderUpdateOne) ClearGridBuyCost() *OrderUpdateOne

ClearGridBuyCost clears the value of the "gridBuyCost" field.

func (*OrderUpdateOne) ClearGridId

func (_u *OrderUpdateOne) ClearGridId() *OrderUpdateOne

ClearGridId clears the value of the "gridId" field.

func (*OrderUpdateOne) ClearGridNumber

func (_u *OrderUpdateOne) ClearGridNumber() *OrderUpdateOne

ClearGridNumber clears the value of the "gridNumber" field.

func (*OrderUpdateOne) ClearProfit

func (_u *OrderUpdateOne) ClearProfit() *OrderUpdateOne

ClearProfit clears the value of the "profit" field.

func (*OrderUpdateOne) Exec

func (_u *OrderUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*OrderUpdateOne) ExecX

func (_u *OrderUpdateOne) ExecX(ctx context.Context)

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

func (*OrderUpdateOne) Mutation

func (_u *OrderUpdateOne) Mutation() *OrderMutation

Mutation returns the OrderMutation object of the builder.

func (*OrderUpdateOne) Save

func (_u *OrderUpdateOne) Save(ctx context.Context) (*Order, error)

Save executes the query and returns the updated Order entity.

func (*OrderUpdateOne) SaveX

func (_u *OrderUpdateOne) SaveX(ctx context.Context) *Order

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

func (*OrderUpdateOne) Select

func (_u *OrderUpdateOne) Select(field string, fields ...string) *OrderUpdateOne

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

func (*OrderUpdateOne) SetAccount

func (_u *OrderUpdateOne) SetAccount(v string) *OrderUpdateOne

SetAccount sets the "account" field.

func (*OrderUpdateOne) SetFinalPrice

func (_u *OrderUpdateOne) SetFinalPrice(v decimal.Decimal) *OrderUpdateOne

SetFinalPrice sets the "finalPrice" field.

func (*OrderUpdateOne) SetGridBuyCost

func (_u *OrderUpdateOne) SetGridBuyCost(v decimal.Decimal) *OrderUpdateOne

SetGridBuyCost sets the "gridBuyCost" field.

func (*OrderUpdateOne) SetGridId

func (_u *OrderUpdateOne) SetGridId(v string) *OrderUpdateOne

SetGridId sets the "gridId" field.

func (*OrderUpdateOne) SetGridNumber

func (_u *OrderUpdateOne) SetGridNumber(v int) *OrderUpdateOne

SetGridNumber sets the "gridNumber" field.

func (*OrderUpdateOne) SetInAmount

func (_u *OrderUpdateOne) SetInAmount(v decimal.Decimal) *OrderUpdateOne

SetInAmount sets the "inAmount" field.

func (*OrderUpdateOne) SetNillableAccount

func (_u *OrderUpdateOne) SetNillableAccount(v *string) *OrderUpdateOne

SetNillableAccount sets the "account" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableFinalPrice

func (_u *OrderUpdateOne) SetNillableFinalPrice(v *decimal.Decimal) *OrderUpdateOne

SetNillableFinalPrice sets the "finalPrice" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableGridBuyCost

func (_u *OrderUpdateOne) SetNillableGridBuyCost(v *decimal.Decimal) *OrderUpdateOne

SetNillableGridBuyCost sets the "gridBuyCost" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableGridId

func (_u *OrderUpdateOne) SetNillableGridId(v *string) *OrderUpdateOne

SetNillableGridId sets the "gridId" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableGridNumber

func (_u *OrderUpdateOne) SetNillableGridNumber(v *int) *OrderUpdateOne

SetNillableGridNumber sets the "gridNumber" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableInAmount

func (_u *OrderUpdateOne) SetNillableInAmount(v *decimal.Decimal) *OrderUpdateOne

SetNillableInAmount sets the "inAmount" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableNonce

func (_u *OrderUpdateOne) SetNillableNonce(v *uint64) *OrderUpdateOne

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableOutAmount

func (_u *OrderUpdateOne) SetNillableOutAmount(v *decimal.Decimal) *OrderUpdateOne

SetNillableOutAmount sets the "outAmount" field if the given value is not nil.

func (*OrderUpdateOne) SetNillablePrice

func (_u *OrderUpdateOne) SetNillablePrice(v *decimal.Decimal) *OrderUpdateOne

SetNillablePrice sets the "price" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableProfit

func (_u *OrderUpdateOne) SetNillableProfit(v *decimal.Decimal) *OrderUpdateOne

SetNillableProfit sets the "profit" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableReason

func (_u *OrderUpdateOne) SetNillableReason(v *string) *OrderUpdateOne

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

func (*OrderUpdateOne) SetNillableStatus

func (_u *OrderUpdateOne) SetNillableStatus(v *order.Status) *OrderUpdateOne

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

func (*OrderUpdateOne) SetNillableStrategyId

func (_u *OrderUpdateOne) SetNillableStrategyId(v *string) *OrderUpdateOne

SetNillableStrategyId sets the "strategyId" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableSymbol

func (_u *OrderUpdateOne) SetNillableSymbol(v *string) *OrderUpdateOne

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableToken

func (_u *OrderUpdateOne) SetNillableToken(v *string) *OrderUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableTxHash

func (_u *OrderUpdateOne) SetNillableTxHash(v *string) *OrderUpdateOne

SetNillableTxHash sets the "txHash" field if the given value is not nil.

func (*OrderUpdateOne) SetNillableType

func (_u *OrderUpdateOne) SetNillableType(v *order.Type) *OrderUpdateOne

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

func (*OrderUpdateOne) SetNonce

func (_u *OrderUpdateOne) SetNonce(v uint64) *OrderUpdateOne

SetNonce sets the "nonce" field.

func (*OrderUpdateOne) SetOutAmount

func (_u *OrderUpdateOne) SetOutAmount(v decimal.Decimal) *OrderUpdateOne

SetOutAmount sets the "outAmount" field.

func (*OrderUpdateOne) SetPrice

func (_u *OrderUpdateOne) SetPrice(v decimal.Decimal) *OrderUpdateOne

SetPrice sets the "price" field.

func (*OrderUpdateOne) SetProfit

func (_u *OrderUpdateOne) SetProfit(v decimal.Decimal) *OrderUpdateOne

SetProfit sets the "profit" field.

func (*OrderUpdateOne) SetReason

func (_u *OrderUpdateOne) SetReason(v string) *OrderUpdateOne

SetReason sets the "reason" field.

func (*OrderUpdateOne) SetStatus

func (_u *OrderUpdateOne) SetStatus(v order.Status) *OrderUpdateOne

SetStatus sets the "status" field.

func (*OrderUpdateOne) SetStrategyId

func (_u *OrderUpdateOne) SetStrategyId(v string) *OrderUpdateOne

SetStrategyId sets the "strategyId" field.

func (*OrderUpdateOne) SetSymbol

func (_u *OrderUpdateOne) SetSymbol(v string) *OrderUpdateOne

SetSymbol sets the "symbol" field.

func (*OrderUpdateOne) SetToken

func (_u *OrderUpdateOne) SetToken(v string) *OrderUpdateOne

SetToken sets the "token" field.

func (*OrderUpdateOne) SetTxHash

func (_u *OrderUpdateOne) SetTxHash(v string) *OrderUpdateOne

SetTxHash sets the "txHash" field.

func (*OrderUpdateOne) SetType

func (_u *OrderUpdateOne) SetType(v order.Type) *OrderUpdateOne

SetType sets the "type" field.

func (*OrderUpdateOne) SetUpdateTime

func (_u *OrderUpdateOne) SetUpdateTime(v time.Time) *OrderUpdateOne

SetUpdateTime sets the "update_time" field.

func (*OrderUpdateOne) Where

func (_u *OrderUpdateOne) Where(ps ...predicate.Order) *OrderUpdateOne

Where appends a list predicates to the OrderUpdate builder.

type Orders

type Orders []*Order

Orders is a parsable slice of Order.

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 Settings

type Settings struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// UserId holds the value of the "userId" field.
	UserId int64 `json:"userId,omitempty"`
	// SlippageBps holds the value of the "slippageBps" field.
	SlippageBps int `json:"slippageBps,omitempty"`
	// SellSlippageBps holds the value of the "sellSlippageBps" field.
	SellSlippageBps *int `json:"sellSlippageBps,omitempty"`
	// ExitSlippageBps holds the value of the "exitSlippageBps" field.
	ExitSlippageBps *int `json:"exitSlippageBps,omitempty"`
	// DexAggregator holds the value of the "dexAggregator" field.
	DexAggregator settings.DexAggregator `json:"dexAggregator,omitempty"`
	// EnableInfiniteApproval holds the value of the "enableInfiniteApproval" field.
	EnableInfiniteApproval *bool `json:"enableInfiniteApproval,omitempty"`
	// contains filtered or unexported fields
}

Settings is the model entity for the Settings schema.

func (*Settings) String

func (_m *Settings) String() string

String implements the fmt.Stringer.

func (*Settings) Unwrap

func (_m *Settings) Unwrap() *Settings

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

func (_m *Settings) Update() *SettingsUpdateOne

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

func (*Settings) Value

func (_m *Settings) Value(name string) (ent.Value, error)

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

type SettingsClient

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

SettingsClient is a client for the Settings schema.

func NewSettingsClient

func NewSettingsClient(c config) *SettingsClient

NewSettingsClient returns a client for the Settings from the given config.

func (*SettingsClient) Create

func (c *SettingsClient) Create() *SettingsCreate

Create returns a builder for creating a Settings entity.

func (*SettingsClient) CreateBulk

func (c *SettingsClient) CreateBulk(builders ...*SettingsCreate) *SettingsCreateBulk

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

func (*SettingsClient) Delete

func (c *SettingsClient) Delete() *SettingsDelete

Delete returns a delete builder for Settings.

func (*SettingsClient) DeleteOne

func (c *SettingsClient) DeleteOne(_m *Settings) *SettingsDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*SettingsClient) DeleteOneID

func (c *SettingsClient) DeleteOneID(id int) *SettingsDeleteOne

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

func (*SettingsClient) Get

func (c *SettingsClient) Get(ctx context.Context, id int) (*Settings, error)

Get returns a Settings entity by its id.

func (*SettingsClient) GetX

func (c *SettingsClient) GetX(ctx context.Context, id int) *Settings

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

func (*SettingsClient) Hooks

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

Hooks returns the client hooks.

func (*SettingsClient) Intercept

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

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

func (*SettingsClient) Interceptors

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

Interceptors returns the client interceptors.

func (*SettingsClient) MapCreateBulk

func (c *SettingsClient) MapCreateBulk(slice any, setFunc func(*SettingsCreate, int)) *SettingsCreateBulk

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 (*SettingsClient) Query

func (c *SettingsClient) Query() *SettingsQuery

Query returns a query builder for Settings.

func (*SettingsClient) Update

func (c *SettingsClient) Update() *SettingsUpdate

Update returns an update builder for Settings.

func (*SettingsClient) UpdateOne

func (c *SettingsClient) UpdateOne(_m *Settings) *SettingsUpdateOne

UpdateOne returns an update builder for the given entity.

func (*SettingsClient) UpdateOneID

func (c *SettingsClient) UpdateOneID(id int) *SettingsUpdateOne

UpdateOneID returns an update builder for the given id.

func (*SettingsClient) Use

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

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

type SettingsCreate

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

SettingsCreate is the builder for creating a Settings entity.

func (*SettingsCreate) Exec

func (_c *SettingsCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsCreate) ExecX

func (_c *SettingsCreate) ExecX(ctx context.Context)

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

func (*SettingsCreate) Mutation

func (_c *SettingsCreate) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsCreate) Save

func (_c *SettingsCreate) Save(ctx context.Context) (*Settings, error)

Save creates the Settings in the database.

func (*SettingsCreate) SaveX

func (_c *SettingsCreate) SaveX(ctx context.Context) *Settings

SaveX calls Save and panics if Save returns an error.

func (*SettingsCreate) SetCreateTime

func (_c *SettingsCreate) SetCreateTime(v time.Time) *SettingsCreate

SetCreateTime sets the "create_time" field.

func (*SettingsCreate) SetDexAggregator

func (_c *SettingsCreate) SetDexAggregator(v settings.DexAggregator) *SettingsCreate

SetDexAggregator sets the "dexAggregator" field.

func (*SettingsCreate) SetEnableInfiniteApproval

func (_c *SettingsCreate) SetEnableInfiniteApproval(v bool) *SettingsCreate

SetEnableInfiniteApproval sets the "enableInfiniteApproval" field.

func (*SettingsCreate) SetExitSlippageBps

func (_c *SettingsCreate) SetExitSlippageBps(v int) *SettingsCreate

SetExitSlippageBps sets the "exitSlippageBps" field.

func (*SettingsCreate) SetNillableCreateTime

func (_c *SettingsCreate) SetNillableCreateTime(v *time.Time) *SettingsCreate

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

func (*SettingsCreate) SetNillableEnableInfiniteApproval

func (_c *SettingsCreate) SetNillableEnableInfiniteApproval(v *bool) *SettingsCreate

SetNillableEnableInfiniteApproval sets the "enableInfiniteApproval" field if the given value is not nil.

func (*SettingsCreate) SetNillableExitSlippageBps

func (_c *SettingsCreate) SetNillableExitSlippageBps(v *int) *SettingsCreate

SetNillableExitSlippageBps sets the "exitSlippageBps" field if the given value is not nil.

func (*SettingsCreate) SetNillableSellSlippageBps

func (_c *SettingsCreate) SetNillableSellSlippageBps(v *int) *SettingsCreate

SetNillableSellSlippageBps sets the "sellSlippageBps" field if the given value is not nil.

func (*SettingsCreate) SetNillableUpdateTime

func (_c *SettingsCreate) SetNillableUpdateTime(v *time.Time) *SettingsCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*SettingsCreate) SetSellSlippageBps

func (_c *SettingsCreate) SetSellSlippageBps(v int) *SettingsCreate

SetSellSlippageBps sets the "sellSlippageBps" field.

func (*SettingsCreate) SetSlippageBps

func (_c *SettingsCreate) SetSlippageBps(v int) *SettingsCreate

SetSlippageBps sets the "slippageBps" field.

func (*SettingsCreate) SetUpdateTime

func (_c *SettingsCreate) SetUpdateTime(v time.Time) *SettingsCreate

SetUpdateTime sets the "update_time" field.

func (*SettingsCreate) SetUserId

func (_c *SettingsCreate) SetUserId(v int64) *SettingsCreate

SetUserId sets the "userId" field.

type SettingsCreateBulk

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

SettingsCreateBulk is the builder for creating many Settings entities in bulk.

func (*SettingsCreateBulk) Exec

func (_c *SettingsCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsCreateBulk) ExecX

func (_c *SettingsCreateBulk) ExecX(ctx context.Context)

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

func (*SettingsCreateBulk) Save

func (_c *SettingsCreateBulk) Save(ctx context.Context) ([]*Settings, error)

Save creates the Settings entities in the database.

func (*SettingsCreateBulk) SaveX

func (_c *SettingsCreateBulk) SaveX(ctx context.Context) []*Settings

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

type SettingsDelete

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

SettingsDelete is the builder for deleting a Settings entity.

func (*SettingsDelete) Exec

func (_d *SettingsDelete) Exec(ctx context.Context) (int, error)

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

func (*SettingsDelete) ExecX

func (_d *SettingsDelete) ExecX(ctx context.Context) int

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

func (*SettingsDelete) Where

func (_d *SettingsDelete) Where(ps ...predicate.Settings) *SettingsDelete

Where appends a list predicates to the SettingsDelete builder.

type SettingsDeleteOne

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

SettingsDeleteOne is the builder for deleting a single Settings entity.

func (*SettingsDeleteOne) Exec

func (_d *SettingsDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*SettingsDeleteOne) ExecX

func (_d *SettingsDeleteOne) ExecX(ctx context.Context)

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

func (*SettingsDeleteOne) Where

Where appends a list predicates to the SettingsDelete builder.

type SettingsGroupBy

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

SettingsGroupBy is the group-by builder for Settings entities.

func (*SettingsGroupBy) Aggregate

func (_g *SettingsGroupBy) Aggregate(fns ...AggregateFunc) *SettingsGroupBy

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

func (*SettingsGroupBy) Bool

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

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

func (*SettingsGroupBy) BoolX

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

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

func (*SettingsGroupBy) Bools

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

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

func (*SettingsGroupBy) BoolsX

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

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

func (*SettingsGroupBy) Float64

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

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

func (*SettingsGroupBy) Float64X

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

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

func (*SettingsGroupBy) Float64s

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

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

func (*SettingsGroupBy) Float64sX

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

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

func (*SettingsGroupBy) Int

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

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

func (*SettingsGroupBy) IntX

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

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

func (*SettingsGroupBy) Ints

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

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

func (*SettingsGroupBy) IntsX

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

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

func (*SettingsGroupBy) Scan

func (_g *SettingsGroupBy) Scan(ctx context.Context, v any) error

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

func (*SettingsGroupBy) ScanX

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

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

func (*SettingsGroupBy) String

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

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

func (*SettingsGroupBy) StringX

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

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

func (*SettingsGroupBy) Strings

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

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

func (*SettingsGroupBy) StringsX

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

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

type SettingsMutation

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

SettingsMutation represents an operation that mutates the Settings nodes in the graph.

func (*SettingsMutation) AddExitSlippageBps

func (m *SettingsMutation) AddExitSlippageBps(i int)

AddExitSlippageBps adds i to the "exitSlippageBps" field.

func (*SettingsMutation) AddField

func (m *SettingsMutation) 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 (*SettingsMutation) AddSellSlippageBps

func (m *SettingsMutation) AddSellSlippageBps(i int)

AddSellSlippageBps adds i to the "sellSlippageBps" field.

func (*SettingsMutation) AddSlippageBps

func (m *SettingsMutation) AddSlippageBps(i int)

AddSlippageBps adds i to the "slippageBps" field.

func (*SettingsMutation) AddUserId

func (m *SettingsMutation) AddUserId(i int64)

AddUserId adds i to the "userId" field.

func (*SettingsMutation) AddedEdges

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

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

func (*SettingsMutation) AddedExitSlippageBps

func (m *SettingsMutation) AddedExitSlippageBps() (r int, exists bool)

AddedExitSlippageBps returns the value that was added to the "exitSlippageBps" field in this mutation.

func (*SettingsMutation) AddedField

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

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

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

func (*SettingsMutation) AddedIDs

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

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

func (*SettingsMutation) AddedSellSlippageBps

func (m *SettingsMutation) AddedSellSlippageBps() (r int, exists bool)

AddedSellSlippageBps returns the value that was added to the "sellSlippageBps" field in this mutation.

func (*SettingsMutation) AddedSlippageBps

func (m *SettingsMutation) AddedSlippageBps() (r int, exists bool)

AddedSlippageBps returns the value that was added to the "slippageBps" field in this mutation.

func (*SettingsMutation) AddedUserId

func (m *SettingsMutation) AddedUserId() (r int64, exists bool)

AddedUserId returns the value that was added to the "userId" field in this mutation.

func (*SettingsMutation) ClearEdge

func (m *SettingsMutation) 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 (*SettingsMutation) ClearEnableInfiniteApproval

func (m *SettingsMutation) ClearEnableInfiniteApproval()

ClearEnableInfiniteApproval clears the value of the "enableInfiniteApproval" field.

func (*SettingsMutation) ClearExitSlippageBps

func (m *SettingsMutation) ClearExitSlippageBps()

ClearExitSlippageBps clears the value of the "exitSlippageBps" field.

func (*SettingsMutation) ClearField

func (m *SettingsMutation) 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 (*SettingsMutation) ClearSellSlippageBps

func (m *SettingsMutation) ClearSellSlippageBps()

ClearSellSlippageBps clears the value of the "sellSlippageBps" field.

func (*SettingsMutation) ClearedEdges

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

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

func (*SettingsMutation) ClearedFields

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

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

func (SettingsMutation) Client

func (m SettingsMutation) 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 (*SettingsMutation) CreateTime

func (m *SettingsMutation) CreateTime() (r time.Time, exists bool)

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

func (*SettingsMutation) DexAggregator

func (m *SettingsMutation) DexAggregator() (r settings.DexAggregator, exists bool)

DexAggregator returns the value of the "dexAggregator" field in the mutation.

func (*SettingsMutation) EdgeCleared

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

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

func (*SettingsMutation) EnableInfiniteApproval

func (m *SettingsMutation) EnableInfiniteApproval() (r bool, exists bool)

EnableInfiniteApproval returns the value of the "enableInfiniteApproval" field in the mutation.

func (*SettingsMutation) EnableInfiniteApprovalCleared

func (m *SettingsMutation) EnableInfiniteApprovalCleared() bool

EnableInfiniteApprovalCleared returns if the "enableInfiniteApproval" field was cleared in this mutation.

func (*SettingsMutation) ExitSlippageBps

func (m *SettingsMutation) ExitSlippageBps() (r int, exists bool)

ExitSlippageBps returns the value of the "exitSlippageBps" field in the mutation.

func (*SettingsMutation) ExitSlippageBpsCleared

func (m *SettingsMutation) ExitSlippageBpsCleared() bool

ExitSlippageBpsCleared returns if the "exitSlippageBps" field was cleared in this mutation.

func (*SettingsMutation) Field

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

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

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

func (*SettingsMutation) Fields

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

func (m *SettingsMutation) 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 (*SettingsMutation) IDs

func (m *SettingsMutation) 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 (*SettingsMutation) OldCreateTime

func (m *SettingsMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldDexAggregator

func (m *SettingsMutation) OldDexAggregator(ctx context.Context) (v settings.DexAggregator, err error)

OldDexAggregator returns the old "dexAggregator" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldEnableInfiniteApproval

func (m *SettingsMutation) OldEnableInfiniteApproval(ctx context.Context) (v *bool, err error)

OldEnableInfiniteApproval returns the old "enableInfiniteApproval" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldExitSlippageBps

func (m *SettingsMutation) OldExitSlippageBps(ctx context.Context) (v *int, err error)

OldExitSlippageBps returns the old "exitSlippageBps" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldField

func (m *SettingsMutation) 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 (*SettingsMutation) OldSellSlippageBps

func (m *SettingsMutation) OldSellSlippageBps(ctx context.Context) (v *int, err error)

OldSellSlippageBps returns the old "sellSlippageBps" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldSlippageBps

func (m *SettingsMutation) OldSlippageBps(ctx context.Context) (v int, err error)

OldSlippageBps returns the old "slippageBps" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldUpdateTime

func (m *SettingsMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) OldUserId

func (m *SettingsMutation) OldUserId(ctx context.Context) (v int64, err error)

OldUserId returns the old "userId" field's value of the Settings entity. If the Settings 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 (*SettingsMutation) Op

func (m *SettingsMutation) Op() Op

Op returns the operation name.

func (*SettingsMutation) RemovedEdges

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

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

func (*SettingsMutation) RemovedIDs

func (m *SettingsMutation) 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 (*SettingsMutation) ResetCreateTime

func (m *SettingsMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*SettingsMutation) ResetDexAggregator

func (m *SettingsMutation) ResetDexAggregator()

ResetDexAggregator resets all changes to the "dexAggregator" field.

func (*SettingsMutation) ResetEdge

func (m *SettingsMutation) 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 (*SettingsMutation) ResetEnableInfiniteApproval

func (m *SettingsMutation) ResetEnableInfiniteApproval()

ResetEnableInfiniteApproval resets all changes to the "enableInfiniteApproval" field.

func (*SettingsMutation) ResetExitSlippageBps

func (m *SettingsMutation) ResetExitSlippageBps()

ResetExitSlippageBps resets all changes to the "exitSlippageBps" field.

func (*SettingsMutation) ResetField

func (m *SettingsMutation) 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 (*SettingsMutation) ResetSellSlippageBps

func (m *SettingsMutation) ResetSellSlippageBps()

ResetSellSlippageBps resets all changes to the "sellSlippageBps" field.

func (*SettingsMutation) ResetSlippageBps

func (m *SettingsMutation) ResetSlippageBps()

ResetSlippageBps resets all changes to the "slippageBps" field.

func (*SettingsMutation) ResetUpdateTime

func (m *SettingsMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*SettingsMutation) ResetUserId

func (m *SettingsMutation) ResetUserId()

ResetUserId resets all changes to the "userId" field.

func (*SettingsMutation) SellSlippageBps

func (m *SettingsMutation) SellSlippageBps() (r int, exists bool)

SellSlippageBps returns the value of the "sellSlippageBps" field in the mutation.

func (*SettingsMutation) SellSlippageBpsCleared

func (m *SettingsMutation) SellSlippageBpsCleared() bool

SellSlippageBpsCleared returns if the "sellSlippageBps" field was cleared in this mutation.

func (*SettingsMutation) SetCreateTime

func (m *SettingsMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*SettingsMutation) SetDexAggregator

func (m *SettingsMutation) SetDexAggregator(sa settings.DexAggregator)

SetDexAggregator sets the "dexAggregator" field.

func (*SettingsMutation) SetEnableInfiniteApproval

func (m *SettingsMutation) SetEnableInfiniteApproval(b bool)

SetEnableInfiniteApproval sets the "enableInfiniteApproval" field.

func (*SettingsMutation) SetExitSlippageBps

func (m *SettingsMutation) SetExitSlippageBps(i int)

SetExitSlippageBps sets the "exitSlippageBps" field.

func (*SettingsMutation) SetField

func (m *SettingsMutation) 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 (*SettingsMutation) SetOp

func (m *SettingsMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*SettingsMutation) SetSellSlippageBps

func (m *SettingsMutation) SetSellSlippageBps(i int)

SetSellSlippageBps sets the "sellSlippageBps" field.

func (*SettingsMutation) SetSlippageBps

func (m *SettingsMutation) SetSlippageBps(i int)

SetSlippageBps sets the "slippageBps" field.

func (*SettingsMutation) SetUpdateTime

func (m *SettingsMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*SettingsMutation) SetUserId

func (m *SettingsMutation) SetUserId(i int64)

SetUserId sets the "userId" field.

func (*SettingsMutation) SlippageBps

func (m *SettingsMutation) SlippageBps() (r int, exists bool)

SlippageBps returns the value of the "slippageBps" field in the mutation.

func (SettingsMutation) Tx

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

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

func (*SettingsMutation) Type

func (m *SettingsMutation) Type() string

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

func (*SettingsMutation) UpdateTime

func (m *SettingsMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*SettingsMutation) UserId

func (m *SettingsMutation) UserId() (r int64, exists bool)

UserId returns the value of the "userId" field in the mutation.

func (*SettingsMutation) Where

func (m *SettingsMutation) Where(ps ...predicate.Settings)

Where appends a list predicates to the SettingsMutation builder.

func (*SettingsMutation) WhereP

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

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

type SettingsQuery

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

SettingsQuery is the builder for querying Settings entities.

func (*SettingsQuery) Aggregate

func (_q *SettingsQuery) Aggregate(fns ...AggregateFunc) *SettingsSelect

Aggregate returns a SettingsSelect configured with the given aggregations.

func (*SettingsQuery) All

func (_q *SettingsQuery) All(ctx context.Context) ([]*Settings, error)

All executes the query and returns a list of SettingsSlice.

func (*SettingsQuery) AllX

func (_q *SettingsQuery) AllX(ctx context.Context) []*Settings

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

func (*SettingsQuery) Clone

func (_q *SettingsQuery) Clone() *SettingsQuery

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

func (*SettingsQuery) Count

func (_q *SettingsQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*SettingsQuery) CountX

func (_q *SettingsQuery) CountX(ctx context.Context) int

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

func (*SettingsQuery) Exist

func (_q *SettingsQuery) Exist(ctx context.Context) (bool, error)

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

func (*SettingsQuery) ExistX

func (_q *SettingsQuery) ExistX(ctx context.Context) bool

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

func (*SettingsQuery) First

func (_q *SettingsQuery) First(ctx context.Context) (*Settings, error)

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

func (*SettingsQuery) FirstID

func (_q *SettingsQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*SettingsQuery) FirstIDX

func (_q *SettingsQuery) FirstIDX(ctx context.Context) int

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

func (*SettingsQuery) FirstX

func (_q *SettingsQuery) FirstX(ctx context.Context) *Settings

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

func (*SettingsQuery) GroupBy

func (_q *SettingsQuery) GroupBy(field string, fields ...string) *SettingsGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Settings.Query().
	GroupBy(settings.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*SettingsQuery) IDs

func (_q *SettingsQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*SettingsQuery) IDsX

func (_q *SettingsQuery) IDsX(ctx context.Context) []int

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

func (*SettingsQuery) Limit

func (_q *SettingsQuery) Limit(limit int) *SettingsQuery

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

func (*SettingsQuery) Offset

func (_q *SettingsQuery) Offset(offset int) *SettingsQuery

Offset to start from.

func (*SettingsQuery) Only

func (_q *SettingsQuery) Only(ctx context.Context) (*Settings, error)

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

func (*SettingsQuery) OnlyID

func (_q *SettingsQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*SettingsQuery) OnlyIDX

func (_q *SettingsQuery) OnlyIDX(ctx context.Context) int

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

func (*SettingsQuery) OnlyX

func (_q *SettingsQuery) OnlyX(ctx context.Context) *Settings

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

func (*SettingsQuery) Order

Order specifies how the records should be ordered.

func (*SettingsQuery) Select

func (_q *SettingsQuery) Select(fields ...string) *SettingsSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Settings.Query().
	Select(settings.FieldCreateTime).
	Scan(ctx, &v)

func (*SettingsQuery) Unique

func (_q *SettingsQuery) Unique(unique bool) *SettingsQuery

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

func (_q *SettingsQuery) Where(ps ...predicate.Settings) *SettingsQuery

Where adds a new predicate for the SettingsQuery builder.

type SettingsSelect

type SettingsSelect struct {
	*SettingsQuery
	// contains filtered or unexported fields
}

SettingsSelect is the builder for selecting fields of Settings entities.

func (*SettingsSelect) Aggregate

func (_s *SettingsSelect) Aggregate(fns ...AggregateFunc) *SettingsSelect

Aggregate adds the given aggregation functions to the selector query.

func (*SettingsSelect) Bool

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

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

func (*SettingsSelect) BoolX

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

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

func (*SettingsSelect) Bools

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

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

func (*SettingsSelect) BoolsX

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

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

func (*SettingsSelect) Float64

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

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

func (*SettingsSelect) Float64X

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

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

func (*SettingsSelect) Float64s

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

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

func (*SettingsSelect) Float64sX

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

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

func (*SettingsSelect) Int

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

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

func (*SettingsSelect) IntX

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

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

func (*SettingsSelect) Ints

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

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

func (*SettingsSelect) IntsX

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

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

func (*SettingsSelect) Scan

func (_s *SettingsSelect) Scan(ctx context.Context, v any) error

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

func (*SettingsSelect) ScanX

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

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

func (*SettingsSelect) String

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

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

func (*SettingsSelect) StringX

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

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

func (*SettingsSelect) Strings

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

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

func (*SettingsSelect) StringsX

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

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

type SettingsSlice

type SettingsSlice []*Settings

SettingsSlice is a parsable slice of Settings.

type SettingsUpdate

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

SettingsUpdate is the builder for updating Settings entities.

func (*SettingsUpdate) AddExitSlippageBps

func (_u *SettingsUpdate) AddExitSlippageBps(v int) *SettingsUpdate

AddExitSlippageBps adds value to the "exitSlippageBps" field.

func (*SettingsUpdate) AddSellSlippageBps

func (_u *SettingsUpdate) AddSellSlippageBps(v int) *SettingsUpdate

AddSellSlippageBps adds value to the "sellSlippageBps" field.

func (*SettingsUpdate) AddSlippageBps

func (_u *SettingsUpdate) AddSlippageBps(v int) *SettingsUpdate

AddSlippageBps adds value to the "slippageBps" field.

func (*SettingsUpdate) AddUserId

func (_u *SettingsUpdate) AddUserId(v int64) *SettingsUpdate

AddUserId adds value to the "userId" field.

func (*SettingsUpdate) ClearEnableInfiniteApproval

func (_u *SettingsUpdate) ClearEnableInfiniteApproval() *SettingsUpdate

ClearEnableInfiniteApproval clears the value of the "enableInfiniteApproval" field.

func (*SettingsUpdate) ClearExitSlippageBps

func (_u *SettingsUpdate) ClearExitSlippageBps() *SettingsUpdate

ClearExitSlippageBps clears the value of the "exitSlippageBps" field.

func (*SettingsUpdate) ClearSellSlippageBps

func (_u *SettingsUpdate) ClearSellSlippageBps() *SettingsUpdate

ClearSellSlippageBps clears the value of the "sellSlippageBps" field.

func (*SettingsUpdate) Exec

func (_u *SettingsUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*SettingsUpdate) ExecX

func (_u *SettingsUpdate) ExecX(ctx context.Context)

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

func (*SettingsUpdate) Mutation

func (_u *SettingsUpdate) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsUpdate) Save

func (_u *SettingsUpdate) Save(ctx context.Context) (int, error)

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

func (*SettingsUpdate) SaveX

func (_u *SettingsUpdate) SaveX(ctx context.Context) int

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

func (*SettingsUpdate) SetDexAggregator

func (_u *SettingsUpdate) SetDexAggregator(v settings.DexAggregator) *SettingsUpdate

SetDexAggregator sets the "dexAggregator" field.

func (*SettingsUpdate) SetEnableInfiniteApproval

func (_u *SettingsUpdate) SetEnableInfiniteApproval(v bool) *SettingsUpdate

SetEnableInfiniteApproval sets the "enableInfiniteApproval" field.

func (*SettingsUpdate) SetExitSlippageBps

func (_u *SettingsUpdate) SetExitSlippageBps(v int) *SettingsUpdate

SetExitSlippageBps sets the "exitSlippageBps" field.

func (*SettingsUpdate) SetNillableDexAggregator

func (_u *SettingsUpdate) SetNillableDexAggregator(v *settings.DexAggregator) *SettingsUpdate

SetNillableDexAggregator sets the "dexAggregator" field if the given value is not nil.

func (*SettingsUpdate) SetNillableEnableInfiniteApproval

func (_u *SettingsUpdate) SetNillableEnableInfiniteApproval(v *bool) *SettingsUpdate

SetNillableEnableInfiniteApproval sets the "enableInfiniteApproval" field if the given value is not nil.

func (*SettingsUpdate) SetNillableExitSlippageBps

func (_u *SettingsUpdate) SetNillableExitSlippageBps(v *int) *SettingsUpdate

SetNillableExitSlippageBps sets the "exitSlippageBps" field if the given value is not nil.

func (*SettingsUpdate) SetNillableSellSlippageBps

func (_u *SettingsUpdate) SetNillableSellSlippageBps(v *int) *SettingsUpdate

SetNillableSellSlippageBps sets the "sellSlippageBps" field if the given value is not nil.

func (*SettingsUpdate) SetNillableSlippageBps

func (_u *SettingsUpdate) SetNillableSlippageBps(v *int) *SettingsUpdate

SetNillableSlippageBps sets the "slippageBps" field if the given value is not nil.

func (*SettingsUpdate) SetNillableUserId

func (_u *SettingsUpdate) SetNillableUserId(v *int64) *SettingsUpdate

SetNillableUserId sets the "userId" field if the given value is not nil.

func (*SettingsUpdate) SetSellSlippageBps

func (_u *SettingsUpdate) SetSellSlippageBps(v int) *SettingsUpdate

SetSellSlippageBps sets the "sellSlippageBps" field.

func (*SettingsUpdate) SetSlippageBps

func (_u *SettingsUpdate) SetSlippageBps(v int) *SettingsUpdate

SetSlippageBps sets the "slippageBps" field.

func (*SettingsUpdate) SetUpdateTime

func (_u *SettingsUpdate) SetUpdateTime(v time.Time) *SettingsUpdate

SetUpdateTime sets the "update_time" field.

func (*SettingsUpdate) SetUserId

func (_u *SettingsUpdate) SetUserId(v int64) *SettingsUpdate

SetUserId sets the "userId" field.

func (*SettingsUpdate) Where

func (_u *SettingsUpdate) Where(ps ...predicate.Settings) *SettingsUpdate

Where appends a list predicates to the SettingsUpdate builder.

type SettingsUpdateOne

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

SettingsUpdateOne is the builder for updating a single Settings entity.

func (*SettingsUpdateOne) AddExitSlippageBps

func (_u *SettingsUpdateOne) AddExitSlippageBps(v int) *SettingsUpdateOne

AddExitSlippageBps adds value to the "exitSlippageBps" field.

func (*SettingsUpdateOne) AddSellSlippageBps

func (_u *SettingsUpdateOne) AddSellSlippageBps(v int) *SettingsUpdateOne

AddSellSlippageBps adds value to the "sellSlippageBps" field.

func (*SettingsUpdateOne) AddSlippageBps

func (_u *SettingsUpdateOne) AddSlippageBps(v int) *SettingsUpdateOne

AddSlippageBps adds value to the "slippageBps" field.

func (*SettingsUpdateOne) AddUserId

func (_u *SettingsUpdateOne) AddUserId(v int64) *SettingsUpdateOne

AddUserId adds value to the "userId" field.

func (*SettingsUpdateOne) ClearEnableInfiniteApproval

func (_u *SettingsUpdateOne) ClearEnableInfiniteApproval() *SettingsUpdateOne

ClearEnableInfiniteApproval clears the value of the "enableInfiniteApproval" field.

func (*SettingsUpdateOne) ClearExitSlippageBps

func (_u *SettingsUpdateOne) ClearExitSlippageBps() *SettingsUpdateOne

ClearExitSlippageBps clears the value of the "exitSlippageBps" field.

func (*SettingsUpdateOne) ClearSellSlippageBps

func (_u *SettingsUpdateOne) ClearSellSlippageBps() *SettingsUpdateOne

ClearSellSlippageBps clears the value of the "sellSlippageBps" field.

func (*SettingsUpdateOne) Exec

func (_u *SettingsUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*SettingsUpdateOne) ExecX

func (_u *SettingsUpdateOne) ExecX(ctx context.Context)

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

func (*SettingsUpdateOne) Mutation

func (_u *SettingsUpdateOne) Mutation() *SettingsMutation

Mutation returns the SettingsMutation object of the builder.

func (*SettingsUpdateOne) Save

func (_u *SettingsUpdateOne) Save(ctx context.Context) (*Settings, error)

Save executes the query and returns the updated Settings entity.

func (*SettingsUpdateOne) SaveX

func (_u *SettingsUpdateOne) SaveX(ctx context.Context) *Settings

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

func (*SettingsUpdateOne) Select

func (_u *SettingsUpdateOne) Select(field string, fields ...string) *SettingsUpdateOne

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

func (*SettingsUpdateOne) SetDexAggregator

func (_u *SettingsUpdateOne) SetDexAggregator(v settings.DexAggregator) *SettingsUpdateOne

SetDexAggregator sets the "dexAggregator" field.

func (*SettingsUpdateOne) SetEnableInfiniteApproval

func (_u *SettingsUpdateOne) SetEnableInfiniteApproval(v bool) *SettingsUpdateOne

SetEnableInfiniteApproval sets the "enableInfiniteApproval" field.

func (*SettingsUpdateOne) SetExitSlippageBps

func (_u *SettingsUpdateOne) SetExitSlippageBps(v int) *SettingsUpdateOne

SetExitSlippageBps sets the "exitSlippageBps" field.

func (*SettingsUpdateOne) SetNillableDexAggregator

func (_u *SettingsUpdateOne) SetNillableDexAggregator(v *settings.DexAggregator) *SettingsUpdateOne

SetNillableDexAggregator sets the "dexAggregator" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableEnableInfiniteApproval

func (_u *SettingsUpdateOne) SetNillableEnableInfiniteApproval(v *bool) *SettingsUpdateOne

SetNillableEnableInfiniteApproval sets the "enableInfiniteApproval" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableExitSlippageBps

func (_u *SettingsUpdateOne) SetNillableExitSlippageBps(v *int) *SettingsUpdateOne

SetNillableExitSlippageBps sets the "exitSlippageBps" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableSellSlippageBps

func (_u *SettingsUpdateOne) SetNillableSellSlippageBps(v *int) *SettingsUpdateOne

SetNillableSellSlippageBps sets the "sellSlippageBps" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableSlippageBps

func (_u *SettingsUpdateOne) SetNillableSlippageBps(v *int) *SettingsUpdateOne

SetNillableSlippageBps sets the "slippageBps" field if the given value is not nil.

func (*SettingsUpdateOne) SetNillableUserId

func (_u *SettingsUpdateOne) SetNillableUserId(v *int64) *SettingsUpdateOne

SetNillableUserId sets the "userId" field if the given value is not nil.

func (*SettingsUpdateOne) SetSellSlippageBps

func (_u *SettingsUpdateOne) SetSellSlippageBps(v int) *SettingsUpdateOne

SetSellSlippageBps sets the "sellSlippageBps" field.

func (*SettingsUpdateOne) SetSlippageBps

func (_u *SettingsUpdateOne) SetSlippageBps(v int) *SettingsUpdateOne

SetSlippageBps sets the "slippageBps" field.

func (*SettingsUpdateOne) SetUpdateTime

func (_u *SettingsUpdateOne) SetUpdateTime(v time.Time) *SettingsUpdateOne

SetUpdateTime sets the "update_time" field.

func (*SettingsUpdateOne) SetUserId

func (_u *SettingsUpdateOne) SetUserId(v int64) *SettingsUpdateOne

SetUserId sets the "userId" field.

func (*SettingsUpdateOne) Where

Where appends a list predicates to the SettingsUpdate builder.

type Strategies

type Strategies []*Strategy

Strategies is a parsable slice of Strategy.

type Strategy

type Strategy struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// GUID holds the value of the "guid" field.
	GUID string `json:"guid,omitempty"`
	// UserId holds the value of the "userId" field.
	UserId int64 `json:"userId,omitempty"`
	// Token holds the value of the "token" field.
	Token string `json:"token,omitempty"`
	// Symbol holds the value of the "symbol" field.
	Symbol string `json:"symbol,omitempty"`
	// MartinFactor holds the value of the "martinFactor" field.
	MartinFactor float64 `json:"martinFactor,omitempty"`
	// MaxGridLimit holds the value of the "maxGridLimit" field.
	MaxGridLimit *int `json:"maxGridLimit,omitempty"`
	// TakeProfitRatio holds the value of the "takeProfitRatio" field.
	TakeProfitRatio decimal.Decimal `json:"takeProfitRatio,omitempty"`
	// UpperPriceBound holds the value of the "upperPriceBound" field.
	UpperPriceBound decimal.Decimal `json:"upperPriceBound,omitempty"`
	// LowerPriceBound holds the value of the "lowerPriceBound" field.
	LowerPriceBound decimal.Decimal `json:"lowerPriceBound,omitempty"`
	// InitialOrderSize holds the value of the "initialOrderSize" field.
	InitialOrderSize decimal.Decimal `json:"initialOrderSize,omitempty"`
	// LastKlineVolume holds the value of the "lastKlineVolume" field.
	LastKlineVolume *decimal.Decimal `json:"lastKlineVolume,omitempty"`
	// FiveKlineVolume holds the value of the "fiveKlineVolume" field.
	FiveKlineVolume *decimal.Decimal `json:"fiveKlineVolume,omitempty"`
	// FirstOrderId holds the value of the "firstOrderId" field.
	FirstOrderId *int `json:"firstOrderId,omitempty"`
	// UpperBoundExit holds the value of the "upperBoundExit" field.
	UpperBoundExit *decimal.Decimal `json:"upperBoundExit,omitempty"`
	// StopLossExit holds the value of the "stopLossExit" field.
	StopLossExit *decimal.Decimal `json:"stopLossExit,omitempty"`
	// TakeProfitExit holds the value of the "takeProfitExit" field.
	TakeProfitExit *decimal.Decimal `json:"takeProfitExit,omitempty"`
	// GlobalTakeProfitRatio holds the value of the "globalTakeProfitRatio" field.
	GlobalTakeProfitRatio *decimal.Decimal `json:"globalTakeProfitRatio,omitempty"`
	// DynamicStopLoss holds the value of the "dynamicStopLoss" field.
	DynamicStopLoss bool `json:"dynamicStopLoss,omitempty"`
	// DropOn holds the value of the "dropOn" field.
	DropOn bool `json:"dropOn,omitempty"`
	// CandlesToCheck holds the value of the "candlesToCheck" field.
	CandlesToCheck int `json:"candlesToCheck,omitempty"`
	// DropThreshold holds the value of the "dropThreshold" field.
	DropThreshold *decimal.Decimal `json:"dropThreshold,omitempty"`
	// EnableAutoBuy holds the value of the "enableAutoBuy" field.
	EnableAutoBuy bool `json:"enableAutoBuy,omitempty"`
	// EnableAutoSell holds the value of the "enableAutoSell" field.
	EnableAutoSell bool `json:"enableAutoSell,omitempty"`
	// EnableAutoExit holds the value of the "enableAutoExit" field.
	EnableAutoExit bool `json:"enableAutoExit,omitempty"`
	// EnablePushNotification holds the value of the "enablePushNotification" field.
	EnablePushNotification bool `json:"enablePushNotification,omitempty"`
	// Status holds the value of the "status" field.
	Status strategy.Status `json:"status,omitempty"`
	// GridTrend holds the value of the "gridTrend" field.
	GridTrend *string `json:"gridTrend,omitempty"`
	// LastLowerThresholdAlertTime holds the value of the "lastLowerThresholdAlertTime" field.
	LastLowerThresholdAlertTime *time.Time `json:"lastLowerThresholdAlertTime,omitempty"`
	// LastUpperThresholdAlertTime holds the value of the "lastUpperThresholdAlertTime" field.
	LastUpperThresholdAlertTime *time.Time `json:"lastUpperThresholdAlertTime,omitempty"`
	// contains filtered or unexported fields
}

Strategy is the model entity for the Strategy schema.

func (*Strategy) String

func (_m *Strategy) String() string

String implements the fmt.Stringer.

func (*Strategy) Unwrap

func (_m *Strategy) Unwrap() *Strategy

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

func (_m *Strategy) Update() *StrategyUpdateOne

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

func (*Strategy) Value

func (_m *Strategy) Value(name string) (ent.Value, error)

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

type StrategyClient

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

StrategyClient is a client for the Strategy schema.

func NewStrategyClient

func NewStrategyClient(c config) *StrategyClient

NewStrategyClient returns a client for the Strategy from the given config.

func (*StrategyClient) Create

func (c *StrategyClient) Create() *StrategyCreate

Create returns a builder for creating a Strategy entity.

func (*StrategyClient) CreateBulk

func (c *StrategyClient) CreateBulk(builders ...*StrategyCreate) *StrategyCreateBulk

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

func (*StrategyClient) Delete

func (c *StrategyClient) Delete() *StrategyDelete

Delete returns a delete builder for Strategy.

func (*StrategyClient) DeleteOne

func (c *StrategyClient) DeleteOne(_m *Strategy) *StrategyDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*StrategyClient) DeleteOneID

func (c *StrategyClient) DeleteOneID(id int) *StrategyDeleteOne

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

func (*StrategyClient) Get

func (c *StrategyClient) Get(ctx context.Context, id int) (*Strategy, error)

Get returns a Strategy entity by its id.

func (*StrategyClient) GetX

func (c *StrategyClient) GetX(ctx context.Context, id int) *Strategy

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

func (*StrategyClient) Hooks

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

Hooks returns the client hooks.

func (*StrategyClient) Intercept

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

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

func (*StrategyClient) Interceptors

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

Interceptors returns the client interceptors.

func (*StrategyClient) MapCreateBulk

func (c *StrategyClient) MapCreateBulk(slice any, setFunc func(*StrategyCreate, int)) *StrategyCreateBulk

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 (*StrategyClient) Query

func (c *StrategyClient) Query() *StrategyQuery

Query returns a query builder for Strategy.

func (*StrategyClient) Update

func (c *StrategyClient) Update() *StrategyUpdate

Update returns an update builder for Strategy.

func (*StrategyClient) UpdateOne

func (c *StrategyClient) UpdateOne(_m *Strategy) *StrategyUpdateOne

UpdateOne returns an update builder for the given entity.

func (*StrategyClient) UpdateOneID

func (c *StrategyClient) UpdateOneID(id int) *StrategyUpdateOne

UpdateOneID returns an update builder for the given id.

func (*StrategyClient) Use

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

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

type StrategyCreate

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

StrategyCreate is the builder for creating a Strategy entity.

func (*StrategyCreate) Exec

func (_c *StrategyCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*StrategyCreate) ExecX

func (_c *StrategyCreate) ExecX(ctx context.Context)

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

func (*StrategyCreate) Mutation

func (_c *StrategyCreate) Mutation() *StrategyMutation

Mutation returns the StrategyMutation object of the builder.

func (*StrategyCreate) Save

func (_c *StrategyCreate) Save(ctx context.Context) (*Strategy, error)

Save creates the Strategy in the database.

func (*StrategyCreate) SaveX

func (_c *StrategyCreate) SaveX(ctx context.Context) *Strategy

SaveX calls Save and panics if Save returns an error.

func (*StrategyCreate) SetCandlesToCheck

func (_c *StrategyCreate) SetCandlesToCheck(v int) *StrategyCreate

SetCandlesToCheck sets the "candlesToCheck" field.

func (*StrategyCreate) SetCreateTime

func (_c *StrategyCreate) SetCreateTime(v time.Time) *StrategyCreate

SetCreateTime sets the "create_time" field.

func (*StrategyCreate) SetDropOn

func (_c *StrategyCreate) SetDropOn(v bool) *StrategyCreate

SetDropOn sets the "dropOn" field.

func (*StrategyCreate) SetDropThreshold

func (_c *StrategyCreate) SetDropThreshold(v decimal.Decimal) *StrategyCreate

SetDropThreshold sets the "dropThreshold" field.

func (*StrategyCreate) SetDynamicStopLoss

func (_c *StrategyCreate) SetDynamicStopLoss(v bool) *StrategyCreate

SetDynamicStopLoss sets the "dynamicStopLoss" field.

func (*StrategyCreate) SetEnableAutoBuy

func (_c *StrategyCreate) SetEnableAutoBuy(v bool) *StrategyCreate

SetEnableAutoBuy sets the "enableAutoBuy" field.

func (*StrategyCreate) SetEnableAutoExit

func (_c *StrategyCreate) SetEnableAutoExit(v bool) *StrategyCreate

SetEnableAutoExit sets the "enableAutoExit" field.

func (*StrategyCreate) SetEnableAutoSell

func (_c *StrategyCreate) SetEnableAutoSell(v bool) *StrategyCreate

SetEnableAutoSell sets the "enableAutoSell" field.

func (*StrategyCreate) SetEnablePushNotification

func (_c *StrategyCreate) SetEnablePushNotification(v bool) *StrategyCreate

SetEnablePushNotification sets the "enablePushNotification" field.

func (*StrategyCreate) SetFirstOrderId

func (_c *StrategyCreate) SetFirstOrderId(v int) *StrategyCreate

SetFirstOrderId sets the "firstOrderId" field.

func (*StrategyCreate) SetFiveKlineVolume

func (_c *StrategyCreate) SetFiveKlineVolume(v decimal.Decimal) *StrategyCreate

SetFiveKlineVolume sets the "fiveKlineVolume" field.

func (*StrategyCreate) SetGUID

func (_c *StrategyCreate) SetGUID(v string) *StrategyCreate

SetGUID sets the "guid" field.

func (*StrategyCreate) SetGlobalTakeProfitRatio

func (_c *StrategyCreate) SetGlobalTakeProfitRatio(v decimal.Decimal) *StrategyCreate

SetGlobalTakeProfitRatio sets the "globalTakeProfitRatio" field.

func (*StrategyCreate) SetGridTrend

func (_c *StrategyCreate) SetGridTrend(v string) *StrategyCreate

SetGridTrend sets the "gridTrend" field.

func (*StrategyCreate) SetInitialOrderSize

func (_c *StrategyCreate) SetInitialOrderSize(v decimal.Decimal) *StrategyCreate

SetInitialOrderSize sets the "initialOrderSize" field.

func (*StrategyCreate) SetLastKlineVolume

func (_c *StrategyCreate) SetLastKlineVolume(v decimal.Decimal) *StrategyCreate

SetLastKlineVolume sets the "lastKlineVolume" field.

func (*StrategyCreate) SetLastLowerThresholdAlertTime

func (_c *StrategyCreate) SetLastLowerThresholdAlertTime(v time.Time) *StrategyCreate

SetLastLowerThresholdAlertTime sets the "lastLowerThresholdAlertTime" field.

func (*StrategyCreate) SetLastUpperThresholdAlertTime

func (_c *StrategyCreate) SetLastUpperThresholdAlertTime(v time.Time) *StrategyCreate

SetLastUpperThresholdAlertTime sets the "lastUpperThresholdAlertTime" field.

func (*StrategyCreate) SetLowerPriceBound

func (_c *StrategyCreate) SetLowerPriceBound(v decimal.Decimal) *StrategyCreate

SetLowerPriceBound sets the "lowerPriceBound" field.

func (*StrategyCreate) SetMartinFactor

func (_c *StrategyCreate) SetMartinFactor(v float64) *StrategyCreate

SetMartinFactor sets the "martinFactor" field.

func (*StrategyCreate) SetMaxGridLimit

func (_c *StrategyCreate) SetMaxGridLimit(v int) *StrategyCreate

SetMaxGridLimit sets the "maxGridLimit" field.

func (*StrategyCreate) SetNillableCandlesToCheck

func (_c *StrategyCreate) SetNillableCandlesToCheck(v *int) *StrategyCreate

SetNillableCandlesToCheck sets the "candlesToCheck" field if the given value is not nil.

func (*StrategyCreate) SetNillableCreateTime

func (_c *StrategyCreate) SetNillableCreateTime(v *time.Time) *StrategyCreate

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

func (*StrategyCreate) SetNillableDropOn

func (_c *StrategyCreate) SetNillableDropOn(v *bool) *StrategyCreate

SetNillableDropOn sets the "dropOn" field if the given value is not nil.

func (*StrategyCreate) SetNillableDropThreshold

func (_c *StrategyCreate) SetNillableDropThreshold(v *decimal.Decimal) *StrategyCreate

SetNillableDropThreshold sets the "dropThreshold" field if the given value is not nil.

func (*StrategyCreate) SetNillableDynamicStopLoss

func (_c *StrategyCreate) SetNillableDynamicStopLoss(v *bool) *StrategyCreate

SetNillableDynamicStopLoss sets the "dynamicStopLoss" field if the given value is not nil.

func (*StrategyCreate) SetNillableFirstOrderId

func (_c *StrategyCreate) SetNillableFirstOrderId(v *int) *StrategyCreate

SetNillableFirstOrderId sets the "firstOrderId" field if the given value is not nil.

func (*StrategyCreate) SetNillableFiveKlineVolume

func (_c *StrategyCreate) SetNillableFiveKlineVolume(v *decimal.Decimal) *StrategyCreate

SetNillableFiveKlineVolume sets the "fiveKlineVolume" field if the given value is not nil.

func (*StrategyCreate) SetNillableGlobalTakeProfitRatio

func (_c *StrategyCreate) SetNillableGlobalTakeProfitRatio(v *decimal.Decimal) *StrategyCreate

SetNillableGlobalTakeProfitRatio sets the "globalTakeProfitRatio" field if the given value is not nil.

func (*StrategyCreate) SetNillableGridTrend

func (_c *StrategyCreate) SetNillableGridTrend(v *string) *StrategyCreate

SetNillableGridTrend sets the "gridTrend" field if the given value is not nil.

func (*StrategyCreate) SetNillableLastKlineVolume

func (_c *StrategyCreate) SetNillableLastKlineVolume(v *decimal.Decimal) *StrategyCreate

SetNillableLastKlineVolume sets the "lastKlineVolume" field if the given value is not nil.

func (*StrategyCreate) SetNillableLastLowerThresholdAlertTime

func (_c *StrategyCreate) SetNillableLastLowerThresholdAlertTime(v *time.Time) *StrategyCreate

SetNillableLastLowerThresholdAlertTime sets the "lastLowerThresholdAlertTime" field if the given value is not nil.

func (*StrategyCreate) SetNillableLastUpperThresholdAlertTime

func (_c *StrategyCreate) SetNillableLastUpperThresholdAlertTime(v *time.Time) *StrategyCreate

SetNillableLastUpperThresholdAlertTime sets the "lastUpperThresholdAlertTime" field if the given value is not nil.

func (*StrategyCreate) SetNillableMaxGridLimit

func (_c *StrategyCreate) SetNillableMaxGridLimit(v *int) *StrategyCreate

SetNillableMaxGridLimit sets the "maxGridLimit" field if the given value is not nil.

func (*StrategyCreate) SetNillableStopLossExit

func (_c *StrategyCreate) SetNillableStopLossExit(v *decimal.Decimal) *StrategyCreate

SetNillableStopLossExit sets the "stopLossExit" field if the given value is not nil.

func (*StrategyCreate) SetNillableTakeProfitExit

func (_c *StrategyCreate) SetNillableTakeProfitExit(v *decimal.Decimal) *StrategyCreate

SetNillableTakeProfitExit sets the "takeProfitExit" field if the given value is not nil.

func (*StrategyCreate) SetNillableUpdateTime

func (_c *StrategyCreate) SetNillableUpdateTime(v *time.Time) *StrategyCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*StrategyCreate) SetNillableUpperBoundExit

func (_c *StrategyCreate) SetNillableUpperBoundExit(v *decimal.Decimal) *StrategyCreate

SetNillableUpperBoundExit sets the "upperBoundExit" field if the given value is not nil.

func (*StrategyCreate) SetStatus

func (_c *StrategyCreate) SetStatus(v strategy.Status) *StrategyCreate

SetStatus sets the "status" field.

func (*StrategyCreate) SetStopLossExit

func (_c *StrategyCreate) SetStopLossExit(v decimal.Decimal) *StrategyCreate

SetStopLossExit sets the "stopLossExit" field.

func (*StrategyCreate) SetSymbol

func (_c *StrategyCreate) SetSymbol(v string) *StrategyCreate

SetSymbol sets the "symbol" field.

func (*StrategyCreate) SetTakeProfitExit

func (_c *StrategyCreate) SetTakeProfitExit(v decimal.Decimal) *StrategyCreate

SetTakeProfitExit sets the "takeProfitExit" field.

func (*StrategyCreate) SetTakeProfitRatio

func (_c *StrategyCreate) SetTakeProfitRatio(v decimal.Decimal) *StrategyCreate

SetTakeProfitRatio sets the "takeProfitRatio" field.

func (*StrategyCreate) SetToken

func (_c *StrategyCreate) SetToken(v string) *StrategyCreate

SetToken sets the "token" field.

func (*StrategyCreate) SetUpdateTime

func (_c *StrategyCreate) SetUpdateTime(v time.Time) *StrategyCreate

SetUpdateTime sets the "update_time" field.

func (*StrategyCreate) SetUpperBoundExit

func (_c *StrategyCreate) SetUpperBoundExit(v decimal.Decimal) *StrategyCreate

SetUpperBoundExit sets the "upperBoundExit" field.

func (*StrategyCreate) SetUpperPriceBound

func (_c *StrategyCreate) SetUpperPriceBound(v decimal.Decimal) *StrategyCreate

SetUpperPriceBound sets the "upperPriceBound" field.

func (*StrategyCreate) SetUserId

func (_c *StrategyCreate) SetUserId(v int64) *StrategyCreate

SetUserId sets the "userId" field.

type StrategyCreateBulk

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

StrategyCreateBulk is the builder for creating many Strategy entities in bulk.

func (*StrategyCreateBulk) Exec

func (_c *StrategyCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*StrategyCreateBulk) ExecX

func (_c *StrategyCreateBulk) ExecX(ctx context.Context)

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

func (*StrategyCreateBulk) Save

func (_c *StrategyCreateBulk) Save(ctx context.Context) ([]*Strategy, error)

Save creates the Strategy entities in the database.

func (*StrategyCreateBulk) SaveX

func (_c *StrategyCreateBulk) SaveX(ctx context.Context) []*Strategy

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

type StrategyDelete

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

StrategyDelete is the builder for deleting a Strategy entity.

func (*StrategyDelete) Exec

func (_d *StrategyDelete) Exec(ctx context.Context) (int, error)

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

func (*StrategyDelete) ExecX

func (_d *StrategyDelete) ExecX(ctx context.Context) int

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

func (*StrategyDelete) Where

func (_d *StrategyDelete) Where(ps ...predicate.Strategy) *StrategyDelete

Where appends a list predicates to the StrategyDelete builder.

type StrategyDeleteOne

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

StrategyDeleteOne is the builder for deleting a single Strategy entity.

func (*StrategyDeleteOne) Exec

func (_d *StrategyDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*StrategyDeleteOne) ExecX

func (_d *StrategyDeleteOne) ExecX(ctx context.Context)

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

func (*StrategyDeleteOne) Where

Where appends a list predicates to the StrategyDelete builder.

type StrategyGroupBy

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

StrategyGroupBy is the group-by builder for Strategy entities.

func (*StrategyGroupBy) Aggregate

func (_g *StrategyGroupBy) Aggregate(fns ...AggregateFunc) *StrategyGroupBy

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

func (*StrategyGroupBy) Bool

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

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

func (*StrategyGroupBy) BoolX

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

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

func (*StrategyGroupBy) Bools

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

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

func (*StrategyGroupBy) BoolsX

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

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

func (*StrategyGroupBy) Float64

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

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

func (*StrategyGroupBy) Float64X

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

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

func (*StrategyGroupBy) Float64s

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

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

func (*StrategyGroupBy) Float64sX

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

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

func (*StrategyGroupBy) Int

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

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

func (*StrategyGroupBy) IntX

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

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

func (*StrategyGroupBy) Ints

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

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

func (*StrategyGroupBy) IntsX

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

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

func (*StrategyGroupBy) Scan

func (_g *StrategyGroupBy) Scan(ctx context.Context, v any) error

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

func (*StrategyGroupBy) ScanX

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

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

func (*StrategyGroupBy) String

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

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

func (*StrategyGroupBy) StringX

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

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

func (*StrategyGroupBy) Strings

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

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

func (*StrategyGroupBy) StringsX

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

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

type StrategyMutation

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

StrategyMutation represents an operation that mutates the Strategy nodes in the graph.

func (*StrategyMutation) AddCandlesToCheck

func (m *StrategyMutation) AddCandlesToCheck(i int)

AddCandlesToCheck adds i to the "candlesToCheck" field.

func (*StrategyMutation) AddField

func (m *StrategyMutation) 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 (*StrategyMutation) AddFirstOrderId

func (m *StrategyMutation) AddFirstOrderId(i int)

AddFirstOrderId adds i to the "firstOrderId" field.

func (*StrategyMutation) AddMartinFactor

func (m *StrategyMutation) AddMartinFactor(f float64)

AddMartinFactor adds f to the "martinFactor" field.

func (*StrategyMutation) AddMaxGridLimit

func (m *StrategyMutation) AddMaxGridLimit(i int)

AddMaxGridLimit adds i to the "maxGridLimit" field.

func (*StrategyMutation) AddUserId

func (m *StrategyMutation) AddUserId(i int64)

AddUserId adds i to the "userId" field.

func (*StrategyMutation) AddedCandlesToCheck

func (m *StrategyMutation) AddedCandlesToCheck() (r int, exists bool)

AddedCandlesToCheck returns the value that was added to the "candlesToCheck" field in this mutation.

func (*StrategyMutation) AddedEdges

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

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

func (*StrategyMutation) AddedField

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

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

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

func (*StrategyMutation) AddedFirstOrderId

func (m *StrategyMutation) AddedFirstOrderId() (r int, exists bool)

AddedFirstOrderId returns the value that was added to the "firstOrderId" field in this mutation.

func (*StrategyMutation) AddedIDs

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

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

func (*StrategyMutation) AddedMartinFactor

func (m *StrategyMutation) AddedMartinFactor() (r float64, exists bool)

AddedMartinFactor returns the value that was added to the "martinFactor" field in this mutation.

func (*StrategyMutation) AddedMaxGridLimit

func (m *StrategyMutation) AddedMaxGridLimit() (r int, exists bool)

AddedMaxGridLimit returns the value that was added to the "maxGridLimit" field in this mutation.

func (*StrategyMutation) AddedUserId

func (m *StrategyMutation) AddedUserId() (r int64, exists bool)

AddedUserId returns the value that was added to the "userId" field in this mutation.

func (*StrategyMutation) CandlesToCheck

func (m *StrategyMutation) CandlesToCheck() (r int, exists bool)

CandlesToCheck returns the value of the "candlesToCheck" field in the mutation.

func (*StrategyMutation) CandlesToCheckCleared

func (m *StrategyMutation) CandlesToCheckCleared() bool

CandlesToCheckCleared returns if the "candlesToCheck" field was cleared in this mutation.

func (*StrategyMutation) ClearCandlesToCheck

func (m *StrategyMutation) ClearCandlesToCheck()

ClearCandlesToCheck clears the value of the "candlesToCheck" field.

func (*StrategyMutation) ClearDropOn

func (m *StrategyMutation) ClearDropOn()

ClearDropOn clears the value of the "dropOn" field.

func (*StrategyMutation) ClearDropThreshold

func (m *StrategyMutation) ClearDropThreshold()

ClearDropThreshold clears the value of the "dropThreshold" field.

func (*StrategyMutation) ClearDynamicStopLoss

func (m *StrategyMutation) ClearDynamicStopLoss()

ClearDynamicStopLoss clears the value of the "dynamicStopLoss" field.

func (*StrategyMutation) ClearEdge

func (m *StrategyMutation) 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 (*StrategyMutation) ClearField

func (m *StrategyMutation) 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 (*StrategyMutation) ClearFirstOrderId

func (m *StrategyMutation) ClearFirstOrderId()

ClearFirstOrderId clears the value of the "firstOrderId" field.

func (*StrategyMutation) ClearFiveKlineVolume

func (m *StrategyMutation) ClearFiveKlineVolume()

ClearFiveKlineVolume clears the value of the "fiveKlineVolume" field.

func (*StrategyMutation) ClearGlobalTakeProfitRatio

func (m *StrategyMutation) ClearGlobalTakeProfitRatio()

ClearGlobalTakeProfitRatio clears the value of the "globalTakeProfitRatio" field.

func (*StrategyMutation) ClearGridTrend

func (m *StrategyMutation) ClearGridTrend()

ClearGridTrend clears the value of the "gridTrend" field.

func (*StrategyMutation) ClearLastKlineVolume

func (m *StrategyMutation) ClearLastKlineVolume()

ClearLastKlineVolume clears the value of the "lastKlineVolume" field.

func (*StrategyMutation) ClearLastLowerThresholdAlertTime

func (m *StrategyMutation) ClearLastLowerThresholdAlertTime()

ClearLastLowerThresholdAlertTime clears the value of the "lastLowerThresholdAlertTime" field.

func (*StrategyMutation) ClearLastUpperThresholdAlertTime

func (m *StrategyMutation) ClearLastUpperThresholdAlertTime()

ClearLastUpperThresholdAlertTime clears the value of the "lastUpperThresholdAlertTime" field.

func (*StrategyMutation) ClearMaxGridLimit

func (m *StrategyMutation) ClearMaxGridLimit()

ClearMaxGridLimit clears the value of the "maxGridLimit" field.

func (*StrategyMutation) ClearStopLossExit

func (m *StrategyMutation) ClearStopLossExit()

ClearStopLossExit clears the value of the "stopLossExit" field.

func (*StrategyMutation) ClearTakeProfitExit

func (m *StrategyMutation) ClearTakeProfitExit()

ClearTakeProfitExit clears the value of the "takeProfitExit" field.

func (*StrategyMutation) ClearUpperBoundExit

func (m *StrategyMutation) ClearUpperBoundExit()

ClearUpperBoundExit clears the value of the "upperBoundExit" field.

func (*StrategyMutation) ClearedEdges

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

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

func (*StrategyMutation) ClearedFields

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

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

func (StrategyMutation) Client

func (m StrategyMutation) 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 (*StrategyMutation) CreateTime

func (m *StrategyMutation) CreateTime() (r time.Time, exists bool)

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

func (*StrategyMutation) DropOn

func (m *StrategyMutation) DropOn() (r bool, exists bool)

DropOn returns the value of the "dropOn" field in the mutation.

func (*StrategyMutation) DropOnCleared

func (m *StrategyMutation) DropOnCleared() bool

DropOnCleared returns if the "dropOn" field was cleared in this mutation.

func (*StrategyMutation) DropThreshold

func (m *StrategyMutation) DropThreshold() (r decimal.Decimal, exists bool)

DropThreshold returns the value of the "dropThreshold" field in the mutation.

func (*StrategyMutation) DropThresholdCleared

func (m *StrategyMutation) DropThresholdCleared() bool

DropThresholdCleared returns if the "dropThreshold" field was cleared in this mutation.

func (*StrategyMutation) DynamicStopLoss

func (m *StrategyMutation) DynamicStopLoss() (r bool, exists bool)

DynamicStopLoss returns the value of the "dynamicStopLoss" field in the mutation.

func (*StrategyMutation) DynamicStopLossCleared

func (m *StrategyMutation) DynamicStopLossCleared() bool

DynamicStopLossCleared returns if the "dynamicStopLoss" field was cleared in this mutation.

func (*StrategyMutation) EdgeCleared

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

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

func (*StrategyMutation) EnableAutoBuy

func (m *StrategyMutation) EnableAutoBuy() (r bool, exists bool)

EnableAutoBuy returns the value of the "enableAutoBuy" field in the mutation.

func (*StrategyMutation) EnableAutoExit

func (m *StrategyMutation) EnableAutoExit() (r bool, exists bool)

EnableAutoExit returns the value of the "enableAutoExit" field in the mutation.

func (*StrategyMutation) EnableAutoSell

func (m *StrategyMutation) EnableAutoSell() (r bool, exists bool)

EnableAutoSell returns the value of the "enableAutoSell" field in the mutation.

func (*StrategyMutation) EnablePushNotification

func (m *StrategyMutation) EnablePushNotification() (r bool, exists bool)

EnablePushNotification returns the value of the "enablePushNotification" field in the mutation.

func (*StrategyMutation) Field

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

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

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

func (*StrategyMutation) Fields

func (m *StrategyMutation) 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 (*StrategyMutation) FirstOrderId

func (m *StrategyMutation) FirstOrderId() (r int, exists bool)

FirstOrderId returns the value of the "firstOrderId" field in the mutation.

func (*StrategyMutation) FirstOrderIdCleared

func (m *StrategyMutation) FirstOrderIdCleared() bool

FirstOrderIdCleared returns if the "firstOrderId" field was cleared in this mutation.

func (*StrategyMutation) FiveKlineVolume

func (m *StrategyMutation) FiveKlineVolume() (r decimal.Decimal, exists bool)

FiveKlineVolume returns the value of the "fiveKlineVolume" field in the mutation.

func (*StrategyMutation) FiveKlineVolumeCleared

func (m *StrategyMutation) FiveKlineVolumeCleared() bool

FiveKlineVolumeCleared returns if the "fiveKlineVolume" field was cleared in this mutation.

func (*StrategyMutation) GUID

func (m *StrategyMutation) GUID() (r string, exists bool)

GUID returns the value of the "guid" field in the mutation.

func (*StrategyMutation) GlobalTakeProfitRatio

func (m *StrategyMutation) GlobalTakeProfitRatio() (r decimal.Decimal, exists bool)

GlobalTakeProfitRatio returns the value of the "globalTakeProfitRatio" field in the mutation.

func (*StrategyMutation) GlobalTakeProfitRatioCleared

func (m *StrategyMutation) GlobalTakeProfitRatioCleared() bool

GlobalTakeProfitRatioCleared returns if the "globalTakeProfitRatio" field was cleared in this mutation.

func (*StrategyMutation) GridTrend

func (m *StrategyMutation) GridTrend() (r string, exists bool)

GridTrend returns the value of the "gridTrend" field in the mutation.

func (*StrategyMutation) GridTrendCleared

func (m *StrategyMutation) GridTrendCleared() bool

GridTrendCleared returns if the "gridTrend" field was cleared in this mutation.

func (*StrategyMutation) ID

func (m *StrategyMutation) 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 (*StrategyMutation) IDs

func (m *StrategyMutation) 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 (*StrategyMutation) InitialOrderSize

func (m *StrategyMutation) InitialOrderSize() (r decimal.Decimal, exists bool)

InitialOrderSize returns the value of the "initialOrderSize" field in the mutation.

func (*StrategyMutation) LastKlineVolume

func (m *StrategyMutation) LastKlineVolume() (r decimal.Decimal, exists bool)

LastKlineVolume returns the value of the "lastKlineVolume" field in the mutation.

func (*StrategyMutation) LastKlineVolumeCleared

func (m *StrategyMutation) LastKlineVolumeCleared() bool

LastKlineVolumeCleared returns if the "lastKlineVolume" field was cleared in this mutation.

func (*StrategyMutation) LastLowerThresholdAlertTime

func (m *StrategyMutation) LastLowerThresholdAlertTime() (r time.Time, exists bool)

LastLowerThresholdAlertTime returns the value of the "lastLowerThresholdAlertTime" field in the mutation.

func (*StrategyMutation) LastLowerThresholdAlertTimeCleared

func (m *StrategyMutation) LastLowerThresholdAlertTimeCleared() bool

LastLowerThresholdAlertTimeCleared returns if the "lastLowerThresholdAlertTime" field was cleared in this mutation.

func (*StrategyMutation) LastUpperThresholdAlertTime

func (m *StrategyMutation) LastUpperThresholdAlertTime() (r time.Time, exists bool)

LastUpperThresholdAlertTime returns the value of the "lastUpperThresholdAlertTime" field in the mutation.

func (*StrategyMutation) LastUpperThresholdAlertTimeCleared

func (m *StrategyMutation) LastUpperThresholdAlertTimeCleared() bool

LastUpperThresholdAlertTimeCleared returns if the "lastUpperThresholdAlertTime" field was cleared in this mutation.

func (*StrategyMutation) LowerPriceBound

func (m *StrategyMutation) LowerPriceBound() (r decimal.Decimal, exists bool)

LowerPriceBound returns the value of the "lowerPriceBound" field in the mutation.

func (*StrategyMutation) MartinFactor

func (m *StrategyMutation) MartinFactor() (r float64, exists bool)

MartinFactor returns the value of the "martinFactor" field in the mutation.

func (*StrategyMutation) MaxGridLimit

func (m *StrategyMutation) MaxGridLimit() (r int, exists bool)

MaxGridLimit returns the value of the "maxGridLimit" field in the mutation.

func (*StrategyMutation) MaxGridLimitCleared

func (m *StrategyMutation) MaxGridLimitCleared() bool

MaxGridLimitCleared returns if the "maxGridLimit" field was cleared in this mutation.

func (*StrategyMutation) OldCandlesToCheck

func (m *StrategyMutation) OldCandlesToCheck(ctx context.Context) (v int, err error)

OldCandlesToCheck returns the old "candlesToCheck" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldCreateTime

func (m *StrategyMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldDropOn

func (m *StrategyMutation) OldDropOn(ctx context.Context) (v bool, err error)

OldDropOn returns the old "dropOn" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldDropThreshold

func (m *StrategyMutation) OldDropThreshold(ctx context.Context) (v *decimal.Decimal, err error)

OldDropThreshold returns the old "dropThreshold" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldDynamicStopLoss

func (m *StrategyMutation) OldDynamicStopLoss(ctx context.Context) (v bool, err error)

OldDynamicStopLoss returns the old "dynamicStopLoss" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldEnableAutoBuy

func (m *StrategyMutation) OldEnableAutoBuy(ctx context.Context) (v bool, err error)

OldEnableAutoBuy returns the old "enableAutoBuy" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldEnableAutoExit

func (m *StrategyMutation) OldEnableAutoExit(ctx context.Context) (v bool, err error)

OldEnableAutoExit returns the old "enableAutoExit" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldEnableAutoSell

func (m *StrategyMutation) OldEnableAutoSell(ctx context.Context) (v bool, err error)

OldEnableAutoSell returns the old "enableAutoSell" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldEnablePushNotification

func (m *StrategyMutation) OldEnablePushNotification(ctx context.Context) (v bool, err error)

OldEnablePushNotification returns the old "enablePushNotification" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldField

func (m *StrategyMutation) 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 (*StrategyMutation) OldFirstOrderId

func (m *StrategyMutation) OldFirstOrderId(ctx context.Context) (v *int, err error)

OldFirstOrderId returns the old "firstOrderId" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldFiveKlineVolume

func (m *StrategyMutation) OldFiveKlineVolume(ctx context.Context) (v *decimal.Decimal, err error)

OldFiveKlineVolume returns the old "fiveKlineVolume" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldGUID

func (m *StrategyMutation) OldGUID(ctx context.Context) (v string, err error)

OldGUID returns the old "guid" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldGlobalTakeProfitRatio

func (m *StrategyMutation) OldGlobalTakeProfitRatio(ctx context.Context) (v *decimal.Decimal, err error)

OldGlobalTakeProfitRatio returns the old "globalTakeProfitRatio" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldGridTrend

func (m *StrategyMutation) OldGridTrend(ctx context.Context) (v *string, err error)

OldGridTrend returns the old "gridTrend" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldInitialOrderSize

func (m *StrategyMutation) OldInitialOrderSize(ctx context.Context) (v decimal.Decimal, err error)

OldInitialOrderSize returns the old "initialOrderSize" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldLastKlineVolume

func (m *StrategyMutation) OldLastKlineVolume(ctx context.Context) (v *decimal.Decimal, err error)

OldLastKlineVolume returns the old "lastKlineVolume" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldLastLowerThresholdAlertTime

func (m *StrategyMutation) OldLastLowerThresholdAlertTime(ctx context.Context) (v *time.Time, err error)

OldLastLowerThresholdAlertTime returns the old "lastLowerThresholdAlertTime" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldLastUpperThresholdAlertTime

func (m *StrategyMutation) OldLastUpperThresholdAlertTime(ctx context.Context) (v *time.Time, err error)

OldLastUpperThresholdAlertTime returns the old "lastUpperThresholdAlertTime" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldLowerPriceBound

func (m *StrategyMutation) OldLowerPriceBound(ctx context.Context) (v decimal.Decimal, err error)

OldLowerPriceBound returns the old "lowerPriceBound" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldMartinFactor

func (m *StrategyMutation) OldMartinFactor(ctx context.Context) (v float64, err error)

OldMartinFactor returns the old "martinFactor" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldMaxGridLimit

func (m *StrategyMutation) OldMaxGridLimit(ctx context.Context) (v *int, err error)

OldMaxGridLimit returns the old "maxGridLimit" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldStatus

func (m *StrategyMutation) OldStatus(ctx context.Context) (v strategy.Status, err error)

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

func (m *StrategyMutation) OldStopLossExit(ctx context.Context) (v *decimal.Decimal, err error)

OldStopLossExit returns the old "stopLossExit" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldSymbol

func (m *StrategyMutation) OldSymbol(ctx context.Context) (v string, err error)

OldSymbol returns the old "symbol" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldTakeProfitExit

func (m *StrategyMutation) OldTakeProfitExit(ctx context.Context) (v *decimal.Decimal, err error)

OldTakeProfitExit returns the old "takeProfitExit" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldTakeProfitRatio

func (m *StrategyMutation) OldTakeProfitRatio(ctx context.Context) (v decimal.Decimal, err error)

OldTakeProfitRatio returns the old "takeProfitRatio" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldToken

func (m *StrategyMutation) OldToken(ctx context.Context) (v string, err error)

OldToken returns the old "token" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldUpdateTime

func (m *StrategyMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldUpperBoundExit

func (m *StrategyMutation) OldUpperBoundExit(ctx context.Context) (v *decimal.Decimal, err error)

OldUpperBoundExit returns the old "upperBoundExit" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldUpperPriceBound

func (m *StrategyMutation) OldUpperPriceBound(ctx context.Context) (v decimal.Decimal, err error)

OldUpperPriceBound returns the old "upperPriceBound" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) OldUserId

func (m *StrategyMutation) OldUserId(ctx context.Context) (v int64, err error)

OldUserId returns the old "userId" field's value of the Strategy entity. If the Strategy 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 (*StrategyMutation) Op

func (m *StrategyMutation) Op() Op

Op returns the operation name.

func (*StrategyMutation) RemovedEdges

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

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

func (*StrategyMutation) RemovedIDs

func (m *StrategyMutation) 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 (*StrategyMutation) ResetCandlesToCheck

func (m *StrategyMutation) ResetCandlesToCheck()

ResetCandlesToCheck resets all changes to the "candlesToCheck" field.

func (*StrategyMutation) ResetCreateTime

func (m *StrategyMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*StrategyMutation) ResetDropOn

func (m *StrategyMutation) ResetDropOn()

ResetDropOn resets all changes to the "dropOn" field.

func (*StrategyMutation) ResetDropThreshold

func (m *StrategyMutation) ResetDropThreshold()

ResetDropThreshold resets all changes to the "dropThreshold" field.

func (*StrategyMutation) ResetDynamicStopLoss

func (m *StrategyMutation) ResetDynamicStopLoss()

ResetDynamicStopLoss resets all changes to the "dynamicStopLoss" field.

func (*StrategyMutation) ResetEdge

func (m *StrategyMutation) 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 (*StrategyMutation) ResetEnableAutoBuy

func (m *StrategyMutation) ResetEnableAutoBuy()

ResetEnableAutoBuy resets all changes to the "enableAutoBuy" field.

func (*StrategyMutation) ResetEnableAutoExit

func (m *StrategyMutation) ResetEnableAutoExit()

ResetEnableAutoExit resets all changes to the "enableAutoExit" field.

func (*StrategyMutation) ResetEnableAutoSell

func (m *StrategyMutation) ResetEnableAutoSell()

ResetEnableAutoSell resets all changes to the "enableAutoSell" field.

func (*StrategyMutation) ResetEnablePushNotification

func (m *StrategyMutation) ResetEnablePushNotification()

ResetEnablePushNotification resets all changes to the "enablePushNotification" field.

func (*StrategyMutation) ResetField

func (m *StrategyMutation) 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 (*StrategyMutation) ResetFirstOrderId

func (m *StrategyMutation) ResetFirstOrderId()

ResetFirstOrderId resets all changes to the "firstOrderId" field.

func (*StrategyMutation) ResetFiveKlineVolume

func (m *StrategyMutation) ResetFiveKlineVolume()

ResetFiveKlineVolume resets all changes to the "fiveKlineVolume" field.

func (*StrategyMutation) ResetGUID

func (m *StrategyMutation) ResetGUID()

ResetGUID resets all changes to the "guid" field.

func (*StrategyMutation) ResetGlobalTakeProfitRatio

func (m *StrategyMutation) ResetGlobalTakeProfitRatio()

ResetGlobalTakeProfitRatio resets all changes to the "globalTakeProfitRatio" field.

func (*StrategyMutation) ResetGridTrend

func (m *StrategyMutation) ResetGridTrend()

ResetGridTrend resets all changes to the "gridTrend" field.

func (*StrategyMutation) ResetInitialOrderSize

func (m *StrategyMutation) ResetInitialOrderSize()

ResetInitialOrderSize resets all changes to the "initialOrderSize" field.

func (*StrategyMutation) ResetLastKlineVolume

func (m *StrategyMutation) ResetLastKlineVolume()

ResetLastKlineVolume resets all changes to the "lastKlineVolume" field.

func (*StrategyMutation) ResetLastLowerThresholdAlertTime

func (m *StrategyMutation) ResetLastLowerThresholdAlertTime()

ResetLastLowerThresholdAlertTime resets all changes to the "lastLowerThresholdAlertTime" field.

func (*StrategyMutation) ResetLastUpperThresholdAlertTime

func (m *StrategyMutation) ResetLastUpperThresholdAlertTime()

ResetLastUpperThresholdAlertTime resets all changes to the "lastUpperThresholdAlertTime" field.

func (*StrategyMutation) ResetLowerPriceBound

func (m *StrategyMutation) ResetLowerPriceBound()

ResetLowerPriceBound resets all changes to the "lowerPriceBound" field.

func (*StrategyMutation) ResetMartinFactor

func (m *StrategyMutation) ResetMartinFactor()

ResetMartinFactor resets all changes to the "martinFactor" field.

func (*StrategyMutation) ResetMaxGridLimit

func (m *StrategyMutation) ResetMaxGridLimit()

ResetMaxGridLimit resets all changes to the "maxGridLimit" field.

func (*StrategyMutation) ResetStatus

func (m *StrategyMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*StrategyMutation) ResetStopLossExit

func (m *StrategyMutation) ResetStopLossExit()

ResetStopLossExit resets all changes to the "stopLossExit" field.

func (*StrategyMutation) ResetSymbol

func (m *StrategyMutation) ResetSymbol()

ResetSymbol resets all changes to the "symbol" field.

func (*StrategyMutation) ResetTakeProfitExit

func (m *StrategyMutation) ResetTakeProfitExit()

ResetTakeProfitExit resets all changes to the "takeProfitExit" field.

func (*StrategyMutation) ResetTakeProfitRatio

func (m *StrategyMutation) ResetTakeProfitRatio()

ResetTakeProfitRatio resets all changes to the "takeProfitRatio" field.

func (*StrategyMutation) ResetToken

func (m *StrategyMutation) ResetToken()

ResetToken resets all changes to the "token" field.

func (*StrategyMutation) ResetUpdateTime

func (m *StrategyMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*StrategyMutation) ResetUpperBoundExit

func (m *StrategyMutation) ResetUpperBoundExit()

ResetUpperBoundExit resets all changes to the "upperBoundExit" field.

func (*StrategyMutation) ResetUpperPriceBound

func (m *StrategyMutation) ResetUpperPriceBound()

ResetUpperPriceBound resets all changes to the "upperPriceBound" field.

func (*StrategyMutation) ResetUserId

func (m *StrategyMutation) ResetUserId()

ResetUserId resets all changes to the "userId" field.

func (*StrategyMutation) SetCandlesToCheck

func (m *StrategyMutation) SetCandlesToCheck(i int)

SetCandlesToCheck sets the "candlesToCheck" field.

func (*StrategyMutation) SetCreateTime

func (m *StrategyMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*StrategyMutation) SetDropOn

func (m *StrategyMutation) SetDropOn(b bool)

SetDropOn sets the "dropOn" field.

func (*StrategyMutation) SetDropThreshold

func (m *StrategyMutation) SetDropThreshold(d decimal.Decimal)

SetDropThreshold sets the "dropThreshold" field.

func (*StrategyMutation) SetDynamicStopLoss

func (m *StrategyMutation) SetDynamicStopLoss(b bool)

SetDynamicStopLoss sets the "dynamicStopLoss" field.

func (*StrategyMutation) SetEnableAutoBuy

func (m *StrategyMutation) SetEnableAutoBuy(b bool)

SetEnableAutoBuy sets the "enableAutoBuy" field.

func (*StrategyMutation) SetEnableAutoExit

func (m *StrategyMutation) SetEnableAutoExit(b bool)

SetEnableAutoExit sets the "enableAutoExit" field.

func (*StrategyMutation) SetEnableAutoSell

func (m *StrategyMutation) SetEnableAutoSell(b bool)

SetEnableAutoSell sets the "enableAutoSell" field.

func (*StrategyMutation) SetEnablePushNotification

func (m *StrategyMutation) SetEnablePushNotification(b bool)

SetEnablePushNotification sets the "enablePushNotification" field.

func (*StrategyMutation) SetField

func (m *StrategyMutation) 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 (*StrategyMutation) SetFirstOrderId

func (m *StrategyMutation) SetFirstOrderId(i int)

SetFirstOrderId sets the "firstOrderId" field.

func (*StrategyMutation) SetFiveKlineVolume

func (m *StrategyMutation) SetFiveKlineVolume(d decimal.Decimal)

SetFiveKlineVolume sets the "fiveKlineVolume" field.

func (*StrategyMutation) SetGUID

func (m *StrategyMutation) SetGUID(s string)

SetGUID sets the "guid" field.

func (*StrategyMutation) SetGlobalTakeProfitRatio

func (m *StrategyMutation) SetGlobalTakeProfitRatio(d decimal.Decimal)

SetGlobalTakeProfitRatio sets the "globalTakeProfitRatio" field.

func (*StrategyMutation) SetGridTrend

func (m *StrategyMutation) SetGridTrend(s string)

SetGridTrend sets the "gridTrend" field.

func (*StrategyMutation) SetInitialOrderSize

func (m *StrategyMutation) SetInitialOrderSize(d decimal.Decimal)

SetInitialOrderSize sets the "initialOrderSize" field.

func (*StrategyMutation) SetLastKlineVolume

func (m *StrategyMutation) SetLastKlineVolume(d decimal.Decimal)

SetLastKlineVolume sets the "lastKlineVolume" field.

func (*StrategyMutation) SetLastLowerThresholdAlertTime

func (m *StrategyMutation) SetLastLowerThresholdAlertTime(t time.Time)

SetLastLowerThresholdAlertTime sets the "lastLowerThresholdAlertTime" field.

func (*StrategyMutation) SetLastUpperThresholdAlertTime

func (m *StrategyMutation) SetLastUpperThresholdAlertTime(t time.Time)

SetLastUpperThresholdAlertTime sets the "lastUpperThresholdAlertTime" field.

func (*StrategyMutation) SetLowerPriceBound

func (m *StrategyMutation) SetLowerPriceBound(d decimal.Decimal)

SetLowerPriceBound sets the "lowerPriceBound" field.

func (*StrategyMutation) SetMartinFactor

func (m *StrategyMutation) SetMartinFactor(f float64)

SetMartinFactor sets the "martinFactor" field.

func (*StrategyMutation) SetMaxGridLimit

func (m *StrategyMutation) SetMaxGridLimit(i int)

SetMaxGridLimit sets the "maxGridLimit" field.

func (*StrategyMutation) SetOp

func (m *StrategyMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*StrategyMutation) SetStatus

func (m *StrategyMutation) SetStatus(s strategy.Status)

SetStatus sets the "status" field.

func (*StrategyMutation) SetStopLossExit

func (m *StrategyMutation) SetStopLossExit(d decimal.Decimal)

SetStopLossExit sets the "stopLossExit" field.

func (*StrategyMutation) SetSymbol

func (m *StrategyMutation) SetSymbol(s string)

SetSymbol sets the "symbol" field.

func (*StrategyMutation) SetTakeProfitExit

func (m *StrategyMutation) SetTakeProfitExit(d decimal.Decimal)

SetTakeProfitExit sets the "takeProfitExit" field.

func (*StrategyMutation) SetTakeProfitRatio

func (m *StrategyMutation) SetTakeProfitRatio(d decimal.Decimal)

SetTakeProfitRatio sets the "takeProfitRatio" field.

func (*StrategyMutation) SetToken

func (m *StrategyMutation) SetToken(s string)

SetToken sets the "token" field.

func (*StrategyMutation) SetUpdateTime

func (m *StrategyMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*StrategyMutation) SetUpperBoundExit

func (m *StrategyMutation) SetUpperBoundExit(d decimal.Decimal)

SetUpperBoundExit sets the "upperBoundExit" field.

func (*StrategyMutation) SetUpperPriceBound

func (m *StrategyMutation) SetUpperPriceBound(d decimal.Decimal)

SetUpperPriceBound sets the "upperPriceBound" field.

func (*StrategyMutation) SetUserId

func (m *StrategyMutation) SetUserId(i int64)

SetUserId sets the "userId" field.

func (*StrategyMutation) Status

func (m *StrategyMutation) Status() (r strategy.Status, exists bool)

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

func (*StrategyMutation) StopLossExit

func (m *StrategyMutation) StopLossExit() (r decimal.Decimal, exists bool)

StopLossExit returns the value of the "stopLossExit" field in the mutation.

func (*StrategyMutation) StopLossExitCleared

func (m *StrategyMutation) StopLossExitCleared() bool

StopLossExitCleared returns if the "stopLossExit" field was cleared in this mutation.

func (*StrategyMutation) Symbol

func (m *StrategyMutation) Symbol() (r string, exists bool)

Symbol returns the value of the "symbol" field in the mutation.

func (*StrategyMutation) TakeProfitExit

func (m *StrategyMutation) TakeProfitExit() (r decimal.Decimal, exists bool)

TakeProfitExit returns the value of the "takeProfitExit" field in the mutation.

func (*StrategyMutation) TakeProfitExitCleared

func (m *StrategyMutation) TakeProfitExitCleared() bool

TakeProfitExitCleared returns if the "takeProfitExit" field was cleared in this mutation.

func (*StrategyMutation) TakeProfitRatio

func (m *StrategyMutation) TakeProfitRatio() (r decimal.Decimal, exists bool)

TakeProfitRatio returns the value of the "takeProfitRatio" field in the mutation.

func (*StrategyMutation) Token

func (m *StrategyMutation) Token() (r string, exists bool)

Token returns the value of the "token" field in the mutation.

func (StrategyMutation) Tx

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

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

func (*StrategyMutation) Type

func (m *StrategyMutation) Type() string

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

func (*StrategyMutation) UpdateTime

func (m *StrategyMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*StrategyMutation) UpperBoundExit

func (m *StrategyMutation) UpperBoundExit() (r decimal.Decimal, exists bool)

UpperBoundExit returns the value of the "upperBoundExit" field in the mutation.

func (*StrategyMutation) UpperBoundExitCleared

func (m *StrategyMutation) UpperBoundExitCleared() bool

UpperBoundExitCleared returns if the "upperBoundExit" field was cleared in this mutation.

func (*StrategyMutation) UpperPriceBound

func (m *StrategyMutation) UpperPriceBound() (r decimal.Decimal, exists bool)

UpperPriceBound returns the value of the "upperPriceBound" field in the mutation.

func (*StrategyMutation) UserId

func (m *StrategyMutation) UserId() (r int64, exists bool)

UserId returns the value of the "userId" field in the mutation.

func (*StrategyMutation) Where

func (m *StrategyMutation) Where(ps ...predicate.Strategy)

Where appends a list predicates to the StrategyMutation builder.

func (*StrategyMutation) WhereP

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

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

type StrategyQuery

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

StrategyQuery is the builder for querying Strategy entities.

func (*StrategyQuery) Aggregate

func (_q *StrategyQuery) Aggregate(fns ...AggregateFunc) *StrategySelect

Aggregate returns a StrategySelect configured with the given aggregations.

func (*StrategyQuery) All

func (_q *StrategyQuery) All(ctx context.Context) ([]*Strategy, error)

All executes the query and returns a list of Strategies.

func (*StrategyQuery) AllX

func (_q *StrategyQuery) AllX(ctx context.Context) []*Strategy

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

func (*StrategyQuery) Clone

func (_q *StrategyQuery) Clone() *StrategyQuery

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

func (*StrategyQuery) Count

func (_q *StrategyQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*StrategyQuery) CountX

func (_q *StrategyQuery) CountX(ctx context.Context) int

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

func (*StrategyQuery) Exist

func (_q *StrategyQuery) Exist(ctx context.Context) (bool, error)

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

func (*StrategyQuery) ExistX

func (_q *StrategyQuery) ExistX(ctx context.Context) bool

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

func (*StrategyQuery) First

func (_q *StrategyQuery) First(ctx context.Context) (*Strategy, error)

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

func (*StrategyQuery) FirstID

func (_q *StrategyQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*StrategyQuery) FirstIDX

func (_q *StrategyQuery) FirstIDX(ctx context.Context) int

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

func (*StrategyQuery) FirstX

func (_q *StrategyQuery) FirstX(ctx context.Context) *Strategy

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

func (*StrategyQuery) GroupBy

func (_q *StrategyQuery) GroupBy(field string, fields ...string) *StrategyGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Strategy.Query().
	GroupBy(strategy.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*StrategyQuery) IDs

func (_q *StrategyQuery) IDs(ctx context.Context) (ids []int, err error)

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

func (*StrategyQuery) IDsX

func (_q *StrategyQuery) IDsX(ctx context.Context) []int

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

func (*StrategyQuery) Limit

func (_q *StrategyQuery) Limit(limit int) *StrategyQuery

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

func (*StrategyQuery) Offset

func (_q *StrategyQuery) Offset(offset int) *StrategyQuery

Offset to start from.

func (*StrategyQuery) Only

func (_q *StrategyQuery) Only(ctx context.Context) (*Strategy, error)

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

func (*StrategyQuery) OnlyID

func (_q *StrategyQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*StrategyQuery) OnlyIDX

func (_q *StrategyQuery) OnlyIDX(ctx context.Context) int

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

func (*StrategyQuery) OnlyX

func (_q *StrategyQuery) OnlyX(ctx context.Context) *Strategy

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

func (*StrategyQuery) Order

Order specifies how the records should be ordered.

func (*StrategyQuery) Select

func (_q *StrategyQuery) Select(fields ...string) *StrategySelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Strategy.Query().
	Select(strategy.FieldCreateTime).
	Scan(ctx, &v)

func (*StrategyQuery) Unique

func (_q *StrategyQuery) Unique(unique bool) *StrategyQuery

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

func (_q *StrategyQuery) Where(ps ...predicate.Strategy) *StrategyQuery

Where adds a new predicate for the StrategyQuery builder.

type StrategySelect

type StrategySelect struct {
	*StrategyQuery
	// contains filtered or unexported fields
}

StrategySelect is the builder for selecting fields of Strategy entities.

func (*StrategySelect) Aggregate

func (_s *StrategySelect) Aggregate(fns ...AggregateFunc) *StrategySelect

Aggregate adds the given aggregation functions to the selector query.

func (*StrategySelect) Bool

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

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

func (*StrategySelect) BoolX

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

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

func (*StrategySelect) Bools

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

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

func (*StrategySelect) BoolsX

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

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

func (*StrategySelect) Float64

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

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

func (*StrategySelect) Float64X

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

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

func (*StrategySelect) Float64s

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

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

func (*StrategySelect) Float64sX

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

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

func (*StrategySelect) Int

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

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

func (*StrategySelect) IntX

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

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

func (*StrategySelect) Ints

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

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

func (*StrategySelect) IntsX

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

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

func (*StrategySelect) Scan

func (_s *StrategySelect) Scan(ctx context.Context, v any) error

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

func (*StrategySelect) ScanX

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

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

func (*StrategySelect) String

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

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

func (*StrategySelect) StringX

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

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

func (*StrategySelect) Strings

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

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

func (*StrategySelect) StringsX

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

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

type StrategyUpdate

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

StrategyUpdate is the builder for updating Strategy entities.

func (*StrategyUpdate) AddCandlesToCheck

func (_u *StrategyUpdate) AddCandlesToCheck(v int) *StrategyUpdate

AddCandlesToCheck adds value to the "candlesToCheck" field.

func (*StrategyUpdate) AddFirstOrderId

func (_u *StrategyUpdate) AddFirstOrderId(v int) *StrategyUpdate

AddFirstOrderId adds value to the "firstOrderId" field.

func (*StrategyUpdate) AddMartinFactor

func (_u *StrategyUpdate) AddMartinFactor(v float64) *StrategyUpdate

AddMartinFactor adds value to the "martinFactor" field.

func (*StrategyUpdate) AddMaxGridLimit

func (_u *StrategyUpdate) AddMaxGridLimit(v int) *StrategyUpdate

AddMaxGridLimit adds value to the "maxGridLimit" field.

func (*StrategyUpdate) AddUserId

func (_u *StrategyUpdate) AddUserId(v int64) *StrategyUpdate

AddUserId adds value to the "userId" field.

func (*StrategyUpdate) ClearCandlesToCheck

func (_u *StrategyUpdate) ClearCandlesToCheck() *StrategyUpdate

ClearCandlesToCheck clears the value of the "candlesToCheck" field.

func (*StrategyUpdate) ClearDropOn

func (_u *StrategyUpdate) ClearDropOn() *StrategyUpdate

ClearDropOn clears the value of the "dropOn" field.

func (*StrategyUpdate) ClearDropThreshold

func (_u *StrategyUpdate) ClearDropThreshold() *StrategyUpdate

ClearDropThreshold clears the value of the "dropThreshold" field.

func (*StrategyUpdate) ClearDynamicStopLoss

func (_u *StrategyUpdate) ClearDynamicStopLoss() *StrategyUpdate

ClearDynamicStopLoss clears the value of the "dynamicStopLoss" field.

func (*StrategyUpdate) ClearFirstOrderId

func (_u *StrategyUpdate) ClearFirstOrderId() *StrategyUpdate

ClearFirstOrderId clears the value of the "firstOrderId" field.

func (*StrategyUpdate) ClearFiveKlineVolume

func (_u *StrategyUpdate) ClearFiveKlineVolume() *StrategyUpdate

ClearFiveKlineVolume clears the value of the "fiveKlineVolume" field.

func (*StrategyUpdate) ClearGlobalTakeProfitRatio

func (_u *StrategyUpdate) ClearGlobalTakeProfitRatio() *StrategyUpdate

ClearGlobalTakeProfitRatio clears the value of the "globalTakeProfitRatio" field.

func (*StrategyUpdate) ClearGridTrend

func (_u *StrategyUpdate) ClearGridTrend() *StrategyUpdate

ClearGridTrend clears the value of the "gridTrend" field.

func (*StrategyUpdate) ClearLastKlineVolume

func (_u *StrategyUpdate) ClearLastKlineVolume() *StrategyUpdate

ClearLastKlineVolume clears the value of the "lastKlineVolume" field.

func (*StrategyUpdate) ClearLastLowerThresholdAlertTime

func (_u *StrategyUpdate) ClearLastLowerThresholdAlertTime() *StrategyUpdate

ClearLastLowerThresholdAlertTime clears the value of the "lastLowerThresholdAlertTime" field.

func (*StrategyUpdate) ClearLastUpperThresholdAlertTime

func (_u *StrategyUpdate) ClearLastUpperThresholdAlertTime() *StrategyUpdate

ClearLastUpperThresholdAlertTime clears the value of the "lastUpperThresholdAlertTime" field.

func (*StrategyUpdate) ClearMaxGridLimit

func (_u *StrategyUpdate) ClearMaxGridLimit() *StrategyUpdate

ClearMaxGridLimit clears the value of the "maxGridLimit" field.

func (*StrategyUpdate) ClearStopLossExit

func (_u *StrategyUpdate) ClearStopLossExit() *StrategyUpdate

ClearStopLossExit clears the value of the "stopLossExit" field.

func (*StrategyUpdate) ClearTakeProfitExit

func (_u *StrategyUpdate) ClearTakeProfitExit() *StrategyUpdate

ClearTakeProfitExit clears the value of the "takeProfitExit" field.

func (*StrategyUpdate) ClearUpperBoundExit

func (_u *StrategyUpdate) ClearUpperBoundExit() *StrategyUpdate

ClearUpperBoundExit clears the value of the "upperBoundExit" field.

func (*StrategyUpdate) Exec

func (_u *StrategyUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*StrategyUpdate) ExecX

func (_u *StrategyUpdate) ExecX(ctx context.Context)

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

func (*StrategyUpdate) Mutation

func (_u *StrategyUpdate) Mutation() *StrategyMutation

Mutation returns the StrategyMutation object of the builder.

func (*StrategyUpdate) Save

func (_u *StrategyUpdate) Save(ctx context.Context) (int, error)

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

func (*StrategyUpdate) SaveX

func (_u *StrategyUpdate) SaveX(ctx context.Context) int

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

func (*StrategyUpdate) SetCandlesToCheck

func (_u *StrategyUpdate) SetCandlesToCheck(v int) *StrategyUpdate

SetCandlesToCheck sets the "candlesToCheck" field.

func (*StrategyUpdate) SetDropOn

func (_u *StrategyUpdate) SetDropOn(v bool) *StrategyUpdate

SetDropOn sets the "dropOn" field.

func (*StrategyUpdate) SetDropThreshold

func (_u *StrategyUpdate) SetDropThreshold(v decimal.Decimal) *StrategyUpdate

SetDropThreshold sets the "dropThreshold" field.

func (*StrategyUpdate) SetDynamicStopLoss

func (_u *StrategyUpdate) SetDynamicStopLoss(v bool) *StrategyUpdate

SetDynamicStopLoss sets the "dynamicStopLoss" field.

func (*StrategyUpdate) SetEnableAutoBuy

func (_u *StrategyUpdate) SetEnableAutoBuy(v bool) *StrategyUpdate

SetEnableAutoBuy sets the "enableAutoBuy" field.

func (*StrategyUpdate) SetEnableAutoExit

func (_u *StrategyUpdate) SetEnableAutoExit(v bool) *StrategyUpdate

SetEnableAutoExit sets the "enableAutoExit" field.

func (*StrategyUpdate) SetEnableAutoSell

func (_u *StrategyUpdate) SetEnableAutoSell(v bool) *StrategyUpdate

SetEnableAutoSell sets the "enableAutoSell" field.

func (*StrategyUpdate) SetEnablePushNotification

func (_u *StrategyUpdate) SetEnablePushNotification(v bool) *StrategyUpdate

SetEnablePushNotification sets the "enablePushNotification" field.

func (*StrategyUpdate) SetFirstOrderId

func (_u *StrategyUpdate) SetFirstOrderId(v int) *StrategyUpdate

SetFirstOrderId sets the "firstOrderId" field.

func (*StrategyUpdate) SetFiveKlineVolume

func (_u *StrategyUpdate) SetFiveKlineVolume(v decimal.Decimal) *StrategyUpdate

SetFiveKlineVolume sets the "fiveKlineVolume" field.

func (*StrategyUpdate) SetGUID

func (_u *StrategyUpdate) SetGUID(v string) *StrategyUpdate

SetGUID sets the "guid" field.

func (*StrategyUpdate) SetGlobalTakeProfitRatio

func (_u *StrategyUpdate) SetGlobalTakeProfitRatio(v decimal.Decimal) *StrategyUpdate

SetGlobalTakeProfitRatio sets the "globalTakeProfitRatio" field.

func (*StrategyUpdate) SetGridTrend

func (_u *StrategyUpdate) SetGridTrend(v string) *StrategyUpdate

SetGridTrend sets the "gridTrend" field.

func (*StrategyUpdate) SetInitialOrderSize

func (_u *StrategyUpdate) SetInitialOrderSize(v decimal.Decimal) *StrategyUpdate

SetInitialOrderSize sets the "initialOrderSize" field.

func (*StrategyUpdate) SetLastKlineVolume

func (_u *StrategyUpdate) SetLastKlineVolume(v decimal.Decimal) *StrategyUpdate

SetLastKlineVolume sets the "lastKlineVolume" field.

func (*StrategyUpdate) SetLastLowerThresholdAlertTime

func (_u *StrategyUpdate) SetLastLowerThresholdAlertTime(v time.Time) *StrategyUpdate

SetLastLowerThresholdAlertTime sets the "lastLowerThresholdAlertTime" field.

func (*StrategyUpdate) SetLastUpperThresholdAlertTime

func (_u *StrategyUpdate) SetLastUpperThresholdAlertTime(v time.Time) *StrategyUpdate

SetLastUpperThresholdAlertTime sets the "lastUpperThresholdAlertTime" field.

func (*StrategyUpdate) SetLowerPriceBound

func (_u *StrategyUpdate) SetLowerPriceBound(v decimal.Decimal) *StrategyUpdate

SetLowerPriceBound sets the "lowerPriceBound" field.

func (*StrategyUpdate) SetMartinFactor

func (_u *StrategyUpdate) SetMartinFactor(v float64) *StrategyUpdate

SetMartinFactor sets the "martinFactor" field.

func (*StrategyUpdate) SetMaxGridLimit

func (_u *StrategyUpdate) SetMaxGridLimit(v int) *StrategyUpdate

SetMaxGridLimit sets the "maxGridLimit" field.

func (*StrategyUpdate) SetNillableCandlesToCheck

func (_u *StrategyUpdate) SetNillableCandlesToCheck(v *int) *StrategyUpdate

SetNillableCandlesToCheck sets the "candlesToCheck" field if the given value is not nil.

func (*StrategyUpdate) SetNillableDropOn

func (_u *StrategyUpdate) SetNillableDropOn(v *bool) *StrategyUpdate

SetNillableDropOn sets the "dropOn" field if the given value is not nil.

func (*StrategyUpdate) SetNillableDropThreshold

func (_u *StrategyUpdate) SetNillableDropThreshold(v *decimal.Decimal) *StrategyUpdate

SetNillableDropThreshold sets the "dropThreshold" field if the given value is not nil.

func (*StrategyUpdate) SetNillableDynamicStopLoss

func (_u *StrategyUpdate) SetNillableDynamicStopLoss(v *bool) *StrategyUpdate

SetNillableDynamicStopLoss sets the "dynamicStopLoss" field if the given value is not nil.

func (*StrategyUpdate) SetNillableEnableAutoBuy

func (_u *StrategyUpdate) SetNillableEnableAutoBuy(v *bool) *StrategyUpdate

SetNillableEnableAutoBuy sets the "enableAutoBuy" field if the given value is not nil.

func (*StrategyUpdate) SetNillableEnableAutoExit

func (_u *StrategyUpdate) SetNillableEnableAutoExit(v *bool) *StrategyUpdate

SetNillableEnableAutoExit sets the "enableAutoExit" field if the given value is not nil.

func (*StrategyUpdate) SetNillableEnableAutoSell

func (_u *StrategyUpdate) SetNillableEnableAutoSell(v *bool) *StrategyUpdate

SetNillableEnableAutoSell sets the "enableAutoSell" field if the given value is not nil.

func (*StrategyUpdate) SetNillableEnablePushNotification

func (_u *StrategyUpdate) SetNillableEnablePushNotification(v *bool) *StrategyUpdate

SetNillableEnablePushNotification sets the "enablePushNotification" field if the given value is not nil.

func (*StrategyUpdate) SetNillableFirstOrderId

func (_u *StrategyUpdate) SetNillableFirstOrderId(v *int) *StrategyUpdate

SetNillableFirstOrderId sets the "firstOrderId" field if the given value is not nil.

func (*StrategyUpdate) SetNillableFiveKlineVolume

func (_u *StrategyUpdate) SetNillableFiveKlineVolume(v *decimal.Decimal) *StrategyUpdate

SetNillableFiveKlineVolume sets the "fiveKlineVolume" field if the given value is not nil.

func (*StrategyUpdate) SetNillableGUID

func (_u *StrategyUpdate) SetNillableGUID(v *string) *StrategyUpdate

SetNillableGUID sets the "guid" field if the given value is not nil.

func (*StrategyUpdate) SetNillableGlobalTakeProfitRatio

func (_u *StrategyUpdate) SetNillableGlobalTakeProfitRatio(v *decimal.Decimal) *StrategyUpdate

SetNillableGlobalTakeProfitRatio sets the "globalTakeProfitRatio" field if the given value is not nil.

func (*StrategyUpdate) SetNillableGridTrend

func (_u *StrategyUpdate) SetNillableGridTrend(v *string) *StrategyUpdate

SetNillableGridTrend sets the "gridTrend" field if the given value is not nil.

func (*StrategyUpdate) SetNillableInitialOrderSize

func (_u *StrategyUpdate) SetNillableInitialOrderSize(v *decimal.Decimal) *StrategyUpdate

SetNillableInitialOrderSize sets the "initialOrderSize" field if the given value is not nil.

func (*StrategyUpdate) SetNillableLastKlineVolume

func (_u *StrategyUpdate) SetNillableLastKlineVolume(v *decimal.Decimal) *StrategyUpdate

SetNillableLastKlineVolume sets the "lastKlineVolume" field if the given value is not nil.

func (*StrategyUpdate) SetNillableLastLowerThresholdAlertTime

func (_u *StrategyUpdate) SetNillableLastLowerThresholdAlertTime(v *time.Time) *StrategyUpdate

SetNillableLastLowerThresholdAlertTime sets the "lastLowerThresholdAlertTime" field if the given value is not nil.

func (*StrategyUpdate) SetNillableLastUpperThresholdAlertTime

func (_u *StrategyUpdate) SetNillableLastUpperThresholdAlertTime(v *time.Time) *StrategyUpdate

SetNillableLastUpperThresholdAlertTime sets the "lastUpperThresholdAlertTime" field if the given value is not nil.

func (*StrategyUpdate) SetNillableLowerPriceBound

func (_u *StrategyUpdate) SetNillableLowerPriceBound(v *decimal.Decimal) *StrategyUpdate

SetNillableLowerPriceBound sets the "lowerPriceBound" field if the given value is not nil.

func (*StrategyUpdate) SetNillableMartinFactor

func (_u *StrategyUpdate) SetNillableMartinFactor(v *float64) *StrategyUpdate

SetNillableMartinFactor sets the "martinFactor" field if the given value is not nil.

func (*StrategyUpdate) SetNillableMaxGridLimit

func (_u *StrategyUpdate) SetNillableMaxGridLimit(v *int) *StrategyUpdate

SetNillableMaxGridLimit sets the "maxGridLimit" field if the given value is not nil.

func (*StrategyUpdate) SetNillableStatus

func (_u *StrategyUpdate) SetNillableStatus(v *strategy.Status) *StrategyUpdate

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

func (*StrategyUpdate) SetNillableStopLossExit

func (_u *StrategyUpdate) SetNillableStopLossExit(v *decimal.Decimal) *StrategyUpdate

SetNillableStopLossExit sets the "stopLossExit" field if the given value is not nil.

func (*StrategyUpdate) SetNillableSymbol

func (_u *StrategyUpdate) SetNillableSymbol(v *string) *StrategyUpdate

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*StrategyUpdate) SetNillableTakeProfitExit

func (_u *StrategyUpdate) SetNillableTakeProfitExit(v *decimal.Decimal) *StrategyUpdate

SetNillableTakeProfitExit sets the "takeProfitExit" field if the given value is not nil.

func (*StrategyUpdate) SetNillableTakeProfitRatio

func (_u *StrategyUpdate) SetNillableTakeProfitRatio(v *decimal.Decimal) *StrategyUpdate

SetNillableTakeProfitRatio sets the "takeProfitRatio" field if the given value is not nil.

func (*StrategyUpdate) SetNillableToken

func (_u *StrategyUpdate) SetNillableToken(v *string) *StrategyUpdate

SetNillableToken sets the "token" field if the given value is not nil.

func (*StrategyUpdate) SetNillableUpperBoundExit

func (_u *StrategyUpdate) SetNillableUpperBoundExit(v *decimal.Decimal) *StrategyUpdate

SetNillableUpperBoundExit sets the "upperBoundExit" field if the given value is not nil.

func (*StrategyUpdate) SetNillableUpperPriceBound

func (_u *StrategyUpdate) SetNillableUpperPriceBound(v *decimal.Decimal) *StrategyUpdate

SetNillableUpperPriceBound sets the "upperPriceBound" field if the given value is not nil.

func (*StrategyUpdate) SetNillableUserId

func (_u *StrategyUpdate) SetNillableUserId(v *int64) *StrategyUpdate

SetNillableUserId sets the "userId" field if the given value is not nil.

func (*StrategyUpdate) SetStatus

func (_u *StrategyUpdate) SetStatus(v strategy.Status) *StrategyUpdate

SetStatus sets the "status" field.

func (*StrategyUpdate) SetStopLossExit

func (_u *StrategyUpdate) SetStopLossExit(v decimal.Decimal) *StrategyUpdate

SetStopLossExit sets the "stopLossExit" field.

func (*StrategyUpdate) SetSymbol

func (_u *StrategyUpdate) SetSymbol(v string) *StrategyUpdate

SetSymbol sets the "symbol" field.

func (*StrategyUpdate) SetTakeProfitExit

func (_u *StrategyUpdate) SetTakeProfitExit(v decimal.Decimal) *StrategyUpdate

SetTakeProfitExit sets the "takeProfitExit" field.

func (*StrategyUpdate) SetTakeProfitRatio

func (_u *StrategyUpdate) SetTakeProfitRatio(v decimal.Decimal) *StrategyUpdate

SetTakeProfitRatio sets the "takeProfitRatio" field.

func (*StrategyUpdate) SetToken

func (_u *StrategyUpdate) SetToken(v string) *StrategyUpdate

SetToken sets the "token" field.

func (*StrategyUpdate) SetUpdateTime

func (_u *StrategyUpdate) SetUpdateTime(v time.Time) *StrategyUpdate

SetUpdateTime sets the "update_time" field.

func (*StrategyUpdate) SetUpperBoundExit

func (_u *StrategyUpdate) SetUpperBoundExit(v decimal.Decimal) *StrategyUpdate

SetUpperBoundExit sets the "upperBoundExit" field.

func (*StrategyUpdate) SetUpperPriceBound

func (_u *StrategyUpdate) SetUpperPriceBound(v decimal.Decimal) *StrategyUpdate

SetUpperPriceBound sets the "upperPriceBound" field.

func (*StrategyUpdate) SetUserId

func (_u *StrategyUpdate) SetUserId(v int64) *StrategyUpdate

SetUserId sets the "userId" field.

func (*StrategyUpdate) Where

func (_u *StrategyUpdate) Where(ps ...predicate.Strategy) *StrategyUpdate

Where appends a list predicates to the StrategyUpdate builder.

type StrategyUpdateOne

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

StrategyUpdateOne is the builder for updating a single Strategy entity.

func (*StrategyUpdateOne) AddCandlesToCheck

func (_u *StrategyUpdateOne) AddCandlesToCheck(v int) *StrategyUpdateOne

AddCandlesToCheck adds value to the "candlesToCheck" field.

func (*StrategyUpdateOne) AddFirstOrderId

func (_u *StrategyUpdateOne) AddFirstOrderId(v int) *StrategyUpdateOne

AddFirstOrderId adds value to the "firstOrderId" field.

func (*StrategyUpdateOne) AddMartinFactor

func (_u *StrategyUpdateOne) AddMartinFactor(v float64) *StrategyUpdateOne

AddMartinFactor adds value to the "martinFactor" field.

func (*StrategyUpdateOne) AddMaxGridLimit

func (_u *StrategyUpdateOne) AddMaxGridLimit(v int) *StrategyUpdateOne

AddMaxGridLimit adds value to the "maxGridLimit" field.

func (*StrategyUpdateOne) AddUserId

func (_u *StrategyUpdateOne) AddUserId(v int64) *StrategyUpdateOne

AddUserId adds value to the "userId" field.

func (*StrategyUpdateOne) ClearCandlesToCheck

func (_u *StrategyUpdateOne) ClearCandlesToCheck() *StrategyUpdateOne

ClearCandlesToCheck clears the value of the "candlesToCheck" field.

func (*StrategyUpdateOne) ClearDropOn

func (_u *StrategyUpdateOne) ClearDropOn() *StrategyUpdateOne

ClearDropOn clears the value of the "dropOn" field.

func (*StrategyUpdateOne) ClearDropThreshold

func (_u *StrategyUpdateOne) ClearDropThreshold() *StrategyUpdateOne

ClearDropThreshold clears the value of the "dropThreshold" field.

func (*StrategyUpdateOne) ClearDynamicStopLoss

func (_u *StrategyUpdateOne) ClearDynamicStopLoss() *StrategyUpdateOne

ClearDynamicStopLoss clears the value of the "dynamicStopLoss" field.

func (*StrategyUpdateOne) ClearFirstOrderId

func (_u *StrategyUpdateOne) ClearFirstOrderId() *StrategyUpdateOne

ClearFirstOrderId clears the value of the "firstOrderId" field.

func (*StrategyUpdateOne) ClearFiveKlineVolume

func (_u *StrategyUpdateOne) ClearFiveKlineVolume() *StrategyUpdateOne

ClearFiveKlineVolume clears the value of the "fiveKlineVolume" field.

func (*StrategyUpdateOne) ClearGlobalTakeProfitRatio

func (_u *StrategyUpdateOne) ClearGlobalTakeProfitRatio() *StrategyUpdateOne

ClearGlobalTakeProfitRatio clears the value of the "globalTakeProfitRatio" field.

func (*StrategyUpdateOne) ClearGridTrend

func (_u *StrategyUpdateOne) ClearGridTrend() *StrategyUpdateOne

ClearGridTrend clears the value of the "gridTrend" field.

func (*StrategyUpdateOne) ClearLastKlineVolume

func (_u *StrategyUpdateOne) ClearLastKlineVolume() *StrategyUpdateOne

ClearLastKlineVolume clears the value of the "lastKlineVolume" field.

func (*StrategyUpdateOne) ClearLastLowerThresholdAlertTime

func (_u *StrategyUpdateOne) ClearLastLowerThresholdAlertTime() *StrategyUpdateOne

ClearLastLowerThresholdAlertTime clears the value of the "lastLowerThresholdAlertTime" field.

func (*StrategyUpdateOne) ClearLastUpperThresholdAlertTime

func (_u *StrategyUpdateOne) ClearLastUpperThresholdAlertTime() *StrategyUpdateOne

ClearLastUpperThresholdAlertTime clears the value of the "lastUpperThresholdAlertTime" field.

func (*StrategyUpdateOne) ClearMaxGridLimit

func (_u *StrategyUpdateOne) ClearMaxGridLimit() *StrategyUpdateOne

ClearMaxGridLimit clears the value of the "maxGridLimit" field.

func (*StrategyUpdateOne) ClearStopLossExit

func (_u *StrategyUpdateOne) ClearStopLossExit() *StrategyUpdateOne

ClearStopLossExit clears the value of the "stopLossExit" field.

func (*StrategyUpdateOne) ClearTakeProfitExit

func (_u *StrategyUpdateOne) ClearTakeProfitExit() *StrategyUpdateOne

ClearTakeProfitExit clears the value of the "takeProfitExit" field.

func (*StrategyUpdateOne) ClearUpperBoundExit

func (_u *StrategyUpdateOne) ClearUpperBoundExit() *StrategyUpdateOne

ClearUpperBoundExit clears the value of the "upperBoundExit" field.

func (*StrategyUpdateOne) Exec

func (_u *StrategyUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*StrategyUpdateOne) ExecX

func (_u *StrategyUpdateOne) ExecX(ctx context.Context)

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

func (*StrategyUpdateOne) Mutation

func (_u *StrategyUpdateOne) Mutation() *StrategyMutation

Mutation returns the StrategyMutation object of the builder.

func (*StrategyUpdateOne) Save

func (_u *StrategyUpdateOne) Save(ctx context.Context) (*Strategy, error)

Save executes the query and returns the updated Strategy entity.

func (*StrategyUpdateOne) SaveX

func (_u *StrategyUpdateOne) SaveX(ctx context.Context) *Strategy

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

func (*StrategyUpdateOne) Select

func (_u *StrategyUpdateOne) Select(field string, fields ...string) *StrategyUpdateOne

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

func (*StrategyUpdateOne) SetCandlesToCheck

func (_u *StrategyUpdateOne) SetCandlesToCheck(v int) *StrategyUpdateOne

SetCandlesToCheck sets the "candlesToCheck" field.

func (*StrategyUpdateOne) SetDropOn

func (_u *StrategyUpdateOne) SetDropOn(v bool) *StrategyUpdateOne

SetDropOn sets the "dropOn" field.

func (*StrategyUpdateOne) SetDropThreshold

func (_u *StrategyUpdateOne) SetDropThreshold(v decimal.Decimal) *StrategyUpdateOne

SetDropThreshold sets the "dropThreshold" field.

func (*StrategyUpdateOne) SetDynamicStopLoss

func (_u *StrategyUpdateOne) SetDynamicStopLoss(v bool) *StrategyUpdateOne

SetDynamicStopLoss sets the "dynamicStopLoss" field.

func (*StrategyUpdateOne) SetEnableAutoBuy

func (_u *StrategyUpdateOne) SetEnableAutoBuy(v bool) *StrategyUpdateOne

SetEnableAutoBuy sets the "enableAutoBuy" field.

func (*StrategyUpdateOne) SetEnableAutoExit

func (_u *StrategyUpdateOne) SetEnableAutoExit(v bool) *StrategyUpdateOne

SetEnableAutoExit sets the "enableAutoExit" field.

func (*StrategyUpdateOne) SetEnableAutoSell

func (_u *StrategyUpdateOne) SetEnableAutoSell(v bool) *StrategyUpdateOne

SetEnableAutoSell sets the "enableAutoSell" field.

func (*StrategyUpdateOne) SetEnablePushNotification

func (_u *StrategyUpdateOne) SetEnablePushNotification(v bool) *StrategyUpdateOne

SetEnablePushNotification sets the "enablePushNotification" field.

func (*StrategyUpdateOne) SetFirstOrderId

func (_u *StrategyUpdateOne) SetFirstOrderId(v int) *StrategyUpdateOne

SetFirstOrderId sets the "firstOrderId" field.

func (*StrategyUpdateOne) SetFiveKlineVolume

func (_u *StrategyUpdateOne) SetFiveKlineVolume(v decimal.Decimal) *StrategyUpdateOne

SetFiveKlineVolume sets the "fiveKlineVolume" field.

func (*StrategyUpdateOne) SetGUID

func (_u *StrategyUpdateOne) SetGUID(v string) *StrategyUpdateOne

SetGUID sets the "guid" field.

func (*StrategyUpdateOne) SetGlobalTakeProfitRatio

func (_u *StrategyUpdateOne) SetGlobalTakeProfitRatio(v decimal.Decimal) *StrategyUpdateOne

SetGlobalTakeProfitRatio sets the "globalTakeProfitRatio" field.

func (*StrategyUpdateOne) SetGridTrend

func (_u *StrategyUpdateOne) SetGridTrend(v string) *StrategyUpdateOne

SetGridTrend sets the "gridTrend" field.

func (*StrategyUpdateOne) SetInitialOrderSize

func (_u *StrategyUpdateOne) SetInitialOrderSize(v decimal.Decimal) *StrategyUpdateOne

SetInitialOrderSize sets the "initialOrderSize" field.

func (*StrategyUpdateOne) SetLastKlineVolume

func (_u *StrategyUpdateOne) SetLastKlineVolume(v decimal.Decimal) *StrategyUpdateOne

SetLastKlineVolume sets the "lastKlineVolume" field.

func (*StrategyUpdateOne) SetLastLowerThresholdAlertTime

func (_u *StrategyUpdateOne) SetLastLowerThresholdAlertTime(v time.Time) *StrategyUpdateOne

SetLastLowerThresholdAlertTime sets the "lastLowerThresholdAlertTime" field.

func (*StrategyUpdateOne) SetLastUpperThresholdAlertTime

func (_u *StrategyUpdateOne) SetLastUpperThresholdAlertTime(v time.Time) *StrategyUpdateOne

SetLastUpperThresholdAlertTime sets the "lastUpperThresholdAlertTime" field.

func (*StrategyUpdateOne) SetLowerPriceBound

func (_u *StrategyUpdateOne) SetLowerPriceBound(v decimal.Decimal) *StrategyUpdateOne

SetLowerPriceBound sets the "lowerPriceBound" field.

func (*StrategyUpdateOne) SetMartinFactor

func (_u *StrategyUpdateOne) SetMartinFactor(v float64) *StrategyUpdateOne

SetMartinFactor sets the "martinFactor" field.

func (*StrategyUpdateOne) SetMaxGridLimit

func (_u *StrategyUpdateOne) SetMaxGridLimit(v int) *StrategyUpdateOne

SetMaxGridLimit sets the "maxGridLimit" field.

func (*StrategyUpdateOne) SetNillableCandlesToCheck

func (_u *StrategyUpdateOne) SetNillableCandlesToCheck(v *int) *StrategyUpdateOne

SetNillableCandlesToCheck sets the "candlesToCheck" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableDropOn

func (_u *StrategyUpdateOne) SetNillableDropOn(v *bool) *StrategyUpdateOne

SetNillableDropOn sets the "dropOn" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableDropThreshold

func (_u *StrategyUpdateOne) SetNillableDropThreshold(v *decimal.Decimal) *StrategyUpdateOne

SetNillableDropThreshold sets the "dropThreshold" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableDynamicStopLoss

func (_u *StrategyUpdateOne) SetNillableDynamicStopLoss(v *bool) *StrategyUpdateOne

SetNillableDynamicStopLoss sets the "dynamicStopLoss" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableEnableAutoBuy

func (_u *StrategyUpdateOne) SetNillableEnableAutoBuy(v *bool) *StrategyUpdateOne

SetNillableEnableAutoBuy sets the "enableAutoBuy" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableEnableAutoExit

func (_u *StrategyUpdateOne) SetNillableEnableAutoExit(v *bool) *StrategyUpdateOne

SetNillableEnableAutoExit sets the "enableAutoExit" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableEnableAutoSell

func (_u *StrategyUpdateOne) SetNillableEnableAutoSell(v *bool) *StrategyUpdateOne

SetNillableEnableAutoSell sets the "enableAutoSell" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableEnablePushNotification

func (_u *StrategyUpdateOne) SetNillableEnablePushNotification(v *bool) *StrategyUpdateOne

SetNillableEnablePushNotification sets the "enablePushNotification" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableFirstOrderId

func (_u *StrategyUpdateOne) SetNillableFirstOrderId(v *int) *StrategyUpdateOne

SetNillableFirstOrderId sets the "firstOrderId" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableFiveKlineVolume

func (_u *StrategyUpdateOne) SetNillableFiveKlineVolume(v *decimal.Decimal) *StrategyUpdateOne

SetNillableFiveKlineVolume sets the "fiveKlineVolume" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableGUID

func (_u *StrategyUpdateOne) SetNillableGUID(v *string) *StrategyUpdateOne

SetNillableGUID sets the "guid" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableGlobalTakeProfitRatio

func (_u *StrategyUpdateOne) SetNillableGlobalTakeProfitRatio(v *decimal.Decimal) *StrategyUpdateOne

SetNillableGlobalTakeProfitRatio sets the "globalTakeProfitRatio" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableGridTrend

func (_u *StrategyUpdateOne) SetNillableGridTrend(v *string) *StrategyUpdateOne

SetNillableGridTrend sets the "gridTrend" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableInitialOrderSize

func (_u *StrategyUpdateOne) SetNillableInitialOrderSize(v *decimal.Decimal) *StrategyUpdateOne

SetNillableInitialOrderSize sets the "initialOrderSize" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableLastKlineVolume

func (_u *StrategyUpdateOne) SetNillableLastKlineVolume(v *decimal.Decimal) *StrategyUpdateOne

SetNillableLastKlineVolume sets the "lastKlineVolume" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableLastLowerThresholdAlertTime

func (_u *StrategyUpdateOne) SetNillableLastLowerThresholdAlertTime(v *time.Time) *StrategyUpdateOne

SetNillableLastLowerThresholdAlertTime sets the "lastLowerThresholdAlertTime" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableLastUpperThresholdAlertTime

func (_u *StrategyUpdateOne) SetNillableLastUpperThresholdAlertTime(v *time.Time) *StrategyUpdateOne

SetNillableLastUpperThresholdAlertTime sets the "lastUpperThresholdAlertTime" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableLowerPriceBound

func (_u *StrategyUpdateOne) SetNillableLowerPriceBound(v *decimal.Decimal) *StrategyUpdateOne

SetNillableLowerPriceBound sets the "lowerPriceBound" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableMartinFactor

func (_u *StrategyUpdateOne) SetNillableMartinFactor(v *float64) *StrategyUpdateOne

SetNillableMartinFactor sets the "martinFactor" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableMaxGridLimit

func (_u *StrategyUpdateOne) SetNillableMaxGridLimit(v *int) *StrategyUpdateOne

SetNillableMaxGridLimit sets the "maxGridLimit" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableStatus

func (_u *StrategyUpdateOne) SetNillableStatus(v *strategy.Status) *StrategyUpdateOne

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

func (*StrategyUpdateOne) SetNillableStopLossExit

func (_u *StrategyUpdateOne) SetNillableStopLossExit(v *decimal.Decimal) *StrategyUpdateOne

SetNillableStopLossExit sets the "stopLossExit" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableSymbol

func (_u *StrategyUpdateOne) SetNillableSymbol(v *string) *StrategyUpdateOne

SetNillableSymbol sets the "symbol" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableTakeProfitExit

func (_u *StrategyUpdateOne) SetNillableTakeProfitExit(v *decimal.Decimal) *StrategyUpdateOne

SetNillableTakeProfitExit sets the "takeProfitExit" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableTakeProfitRatio

func (_u *StrategyUpdateOne) SetNillableTakeProfitRatio(v *decimal.Decimal) *StrategyUpdateOne

SetNillableTakeProfitRatio sets the "takeProfitRatio" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableToken

func (_u *StrategyUpdateOne) SetNillableToken(v *string) *StrategyUpdateOne

SetNillableToken sets the "token" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableUpperBoundExit

func (_u *StrategyUpdateOne) SetNillableUpperBoundExit(v *decimal.Decimal) *StrategyUpdateOne

SetNillableUpperBoundExit sets the "upperBoundExit" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableUpperPriceBound

func (_u *StrategyUpdateOne) SetNillableUpperPriceBound(v *decimal.Decimal) *StrategyUpdateOne

SetNillableUpperPriceBound sets the "upperPriceBound" field if the given value is not nil.

func (*StrategyUpdateOne) SetNillableUserId

func (_u *StrategyUpdateOne) SetNillableUserId(v *int64) *StrategyUpdateOne

SetNillableUserId sets the "userId" field if the given value is not nil.

func (*StrategyUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*StrategyUpdateOne) SetStopLossExit

func (_u *StrategyUpdateOne) SetStopLossExit(v decimal.Decimal) *StrategyUpdateOne

SetStopLossExit sets the "stopLossExit" field.

func (*StrategyUpdateOne) SetSymbol

func (_u *StrategyUpdateOne) SetSymbol(v string) *StrategyUpdateOne

SetSymbol sets the "symbol" field.

func (*StrategyUpdateOne) SetTakeProfitExit

func (_u *StrategyUpdateOne) SetTakeProfitExit(v decimal.Decimal) *StrategyUpdateOne

SetTakeProfitExit sets the "takeProfitExit" field.

func (*StrategyUpdateOne) SetTakeProfitRatio

func (_u *StrategyUpdateOne) SetTakeProfitRatio(v decimal.Decimal) *StrategyUpdateOne

SetTakeProfitRatio sets the "takeProfitRatio" field.

func (*StrategyUpdateOne) SetToken

func (_u *StrategyUpdateOne) SetToken(v string) *StrategyUpdateOne

SetToken sets the "token" field.

func (*StrategyUpdateOne) SetUpdateTime

func (_u *StrategyUpdateOne) SetUpdateTime(v time.Time) *StrategyUpdateOne

SetUpdateTime sets the "update_time" field.

func (*StrategyUpdateOne) SetUpperBoundExit

func (_u *StrategyUpdateOne) SetUpperBoundExit(v decimal.Decimal) *StrategyUpdateOne

SetUpperBoundExit sets the "upperBoundExit" field.

func (*StrategyUpdateOne) SetUpperPriceBound

func (_u *StrategyUpdateOne) SetUpperPriceBound(v decimal.Decimal) *StrategyUpdateOne

SetUpperPriceBound sets the "upperPriceBound" field.

func (*StrategyUpdateOne) SetUserId

func (_u *StrategyUpdateOne) SetUserId(v int64) *StrategyUpdateOne

SetUserId sets the "userId" field.

func (*StrategyUpdateOne) Where

Where appends a list predicates to the StrategyUpdate builder.

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 {

	// Grid is the client for interacting with the Grid builders.
	Grid *GridClient
	// Nonce is the client for interacting with the Nonce builders.
	Nonce *NonceClient
	// Order is the client for interacting with the Order builders.
	Order *OrderClient
	// Settings is the client for interacting with the Settings builders.
	Settings *SettingsClient
	// Strategy is the client for interacting with the Strategy builders.
	Strategy *StrategyClient
	// Wallet is the client for interacting with the Wallet builders.
	Wallet *WalletClient
	// 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 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.

type Wallet

type Wallet struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// CreateTime holds the value of the "create_time" field.
	CreateTime time.Time `json:"create_time,omitempty"`
	// UpdateTime holds the value of the "update_time" field.
	UpdateTime time.Time `json:"update_time,omitempty"`
	// UserId holds the value of the "userId" field.
	UserId int64 `json:"userId,omitempty"`
	// Account holds the value of the "account" field.
	Account string `json:"account,omitempty"`
	// Password holds the value of the "password" field.
	Password string `json:"password,omitempty"`
	// PrivateKey holds the value of the "privateKey" field.
	PrivateKey string `json:"privateKey,omitempty"`
	// contains filtered or unexported fields
}

Wallet is the model entity for the Wallet schema.

func (*Wallet) String

func (_m *Wallet) String() string

String implements the fmt.Stringer.

func (*Wallet) Unwrap

func (_m *Wallet) Unwrap() *Wallet

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

func (_m *Wallet) Update() *WalletUpdateOne

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

func (*Wallet) Value

func (_m *Wallet) Value(name string) (ent.Value, error)

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

type WalletClient

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

WalletClient is a client for the Wallet schema.

func NewWalletClient

func NewWalletClient(c config) *WalletClient

NewWalletClient returns a client for the Wallet from the given config.

func (*WalletClient) Create

func (c *WalletClient) Create() *WalletCreate

Create returns a builder for creating a Wallet entity.

func (*WalletClient) CreateBulk

func (c *WalletClient) CreateBulk(builders ...*WalletCreate) *WalletCreateBulk

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

func (*WalletClient) Delete

func (c *WalletClient) Delete() *WalletDelete

Delete returns a delete builder for Wallet.

func (*WalletClient) DeleteOne

func (c *WalletClient) DeleteOne(_m *Wallet) *WalletDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WalletClient) DeleteOneID

func (c *WalletClient) DeleteOneID(id int) *WalletDeleteOne

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

func (*WalletClient) Get

func (c *WalletClient) Get(ctx context.Context, id int) (*Wallet, error)

Get returns a Wallet entity by its id.

func (*WalletClient) GetX

func (c *WalletClient) GetX(ctx context.Context, id int) *Wallet

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

func (*WalletClient) Hooks

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

Hooks returns the client hooks.

func (*WalletClient) Intercept

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

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

func (*WalletClient) Interceptors

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

Interceptors returns the client interceptors.

func (*WalletClient) MapCreateBulk

func (c *WalletClient) MapCreateBulk(slice any, setFunc func(*WalletCreate, int)) *WalletCreateBulk

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 (*WalletClient) Query

func (c *WalletClient) Query() *WalletQuery

Query returns a query builder for Wallet.

func (*WalletClient) Update

func (c *WalletClient) Update() *WalletUpdate

Update returns an update builder for Wallet.

func (*WalletClient) UpdateOne

func (c *WalletClient) UpdateOne(_m *Wallet) *WalletUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WalletClient) UpdateOneID

func (c *WalletClient) UpdateOneID(id int) *WalletUpdateOne

UpdateOneID returns an update builder for the given id.

func (*WalletClient) Use

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

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

type WalletCreate

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

WalletCreate is the builder for creating a Wallet entity.

func (*WalletCreate) Exec

func (_c *WalletCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WalletCreate) ExecX

func (_c *WalletCreate) ExecX(ctx context.Context)

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

func (*WalletCreate) Mutation

func (_c *WalletCreate) Mutation() *WalletMutation

Mutation returns the WalletMutation object of the builder.

func (*WalletCreate) Save

func (_c *WalletCreate) Save(ctx context.Context) (*Wallet, error)

Save creates the Wallet in the database.

func (*WalletCreate) SaveX

func (_c *WalletCreate) SaveX(ctx context.Context) *Wallet

SaveX calls Save and panics if Save returns an error.

func (*WalletCreate) SetAccount

func (_c *WalletCreate) SetAccount(v string) *WalletCreate

SetAccount sets the "account" field.

func (*WalletCreate) SetCreateTime

func (_c *WalletCreate) SetCreateTime(v time.Time) *WalletCreate

SetCreateTime sets the "create_time" field.

func (*WalletCreate) SetNillableCreateTime

func (_c *WalletCreate) SetNillableCreateTime(v *time.Time) *WalletCreate

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

func (*WalletCreate) SetNillableUpdateTime

func (_c *WalletCreate) SetNillableUpdateTime(v *time.Time) *WalletCreate

SetNillableUpdateTime sets the "update_time" field if the given value is not nil.

func (*WalletCreate) SetPassword

func (_c *WalletCreate) SetPassword(v string) *WalletCreate

SetPassword sets the "password" field.

func (*WalletCreate) SetPrivateKey

func (_c *WalletCreate) SetPrivateKey(v string) *WalletCreate

SetPrivateKey sets the "privateKey" field.

func (*WalletCreate) SetUpdateTime

func (_c *WalletCreate) SetUpdateTime(v time.Time) *WalletCreate

SetUpdateTime sets the "update_time" field.

func (*WalletCreate) SetUserId

func (_c *WalletCreate) SetUserId(v int64) *WalletCreate

SetUserId sets the "userId" field.

type WalletCreateBulk

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

WalletCreateBulk is the builder for creating many Wallet entities in bulk.

func (*WalletCreateBulk) Exec

func (_c *WalletCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WalletCreateBulk) ExecX

func (_c *WalletCreateBulk) ExecX(ctx context.Context)

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

func (*WalletCreateBulk) Save

func (_c *WalletCreateBulk) Save(ctx context.Context) ([]*Wallet, error)

Save creates the Wallet entities in the database.

func (*WalletCreateBulk) SaveX

func (_c *WalletCreateBulk) SaveX(ctx context.Context) []*Wallet

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

type WalletDelete

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

WalletDelete is the builder for deleting a Wallet entity.

func (*WalletDelete) Exec

func (_d *WalletDelete) Exec(ctx context.Context) (int, error)

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

func (*WalletDelete) ExecX

func (_d *WalletDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*WalletDelete) Where

func (_d *WalletDelete) Where(ps ...predicate.Wallet) *WalletDelete

Where appends a list predicates to the WalletDelete builder.

type WalletDeleteOne

type WalletDeleteOne struct {
	// contains filtered or unexported fields
}

WalletDeleteOne is the builder for deleting a single Wallet entity.

func (*WalletDeleteOne) Exec

func (_d *WalletDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WalletDeleteOne) ExecX

func (_d *WalletDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalletDeleteOne) Where

func (_d *WalletDeleteOne) Where(ps ...predicate.Wallet) *WalletDeleteOne

Where appends a list predicates to the WalletDelete builder.

type WalletGroupBy

type WalletGroupBy struct {
	// contains filtered or unexported fields
}

WalletGroupBy is the group-by builder for Wallet entities.

func (*WalletGroupBy) Aggregate

func (_g *WalletGroupBy) Aggregate(fns ...AggregateFunc) *WalletGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*WalletGroupBy) Bool

func (s *WalletGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WalletGroupBy) BoolX

func (s *WalletGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WalletGroupBy) Bools

func (s *WalletGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WalletGroupBy) BoolsX

func (s *WalletGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WalletGroupBy) Float64

func (s *WalletGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WalletGroupBy) Float64X

func (s *WalletGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WalletGroupBy) Float64s

func (s *WalletGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WalletGroupBy) Float64sX

func (s *WalletGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WalletGroupBy) Int

func (s *WalletGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WalletGroupBy) IntX

func (s *WalletGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WalletGroupBy) Ints

func (s *WalletGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WalletGroupBy) IntsX

func (s *WalletGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WalletGroupBy) Scan

func (_g *WalletGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WalletGroupBy) ScanX

func (s *WalletGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WalletGroupBy) String

func (s *WalletGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WalletGroupBy) StringX

func (s *WalletGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WalletGroupBy) Strings

func (s *WalletGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WalletGroupBy) StringsX

func (s *WalletGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WalletMutation

type WalletMutation struct {
	// contains filtered or unexported fields
}

WalletMutation represents an operation that mutates the Wallet nodes in the graph.

func (*WalletMutation) Account

func (m *WalletMutation) Account() (r string, exists bool)

Account returns the value of the "account" field in the mutation.

func (*WalletMutation) AddField

func (m *WalletMutation) 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 (*WalletMutation) AddUserId

func (m *WalletMutation) AddUserId(i int64)

AddUserId adds i to the "userId" field.

func (*WalletMutation) AddedEdges

func (m *WalletMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*WalletMutation) AddedField

func (m *WalletMutation) 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 (*WalletMutation) AddedFields

func (m *WalletMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*WalletMutation) AddedIDs

func (m *WalletMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*WalletMutation) AddedUserId

func (m *WalletMutation) AddedUserId() (r int64, exists bool)

AddedUserId returns the value that was added to the "userId" field in this mutation.

func (*WalletMutation) ClearEdge

func (m *WalletMutation) 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 (*WalletMutation) ClearField

func (m *WalletMutation) 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 (*WalletMutation) ClearedEdges

func (m *WalletMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*WalletMutation) ClearedFields

func (m *WalletMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (WalletMutation) Client

func (m WalletMutation) 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 (*WalletMutation) CreateTime

func (m *WalletMutation) CreateTime() (r time.Time, exists bool)

CreateTime returns the value of the "create_time" field in the mutation.

func (*WalletMutation) EdgeCleared

func (m *WalletMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*WalletMutation) Field

func (m *WalletMutation) 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 (*WalletMutation) FieldCleared

func (m *WalletMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*WalletMutation) Fields

func (m *WalletMutation) 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 (*WalletMutation) ID

func (m *WalletMutation) 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 (*WalletMutation) IDs

func (m *WalletMutation) 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 (*WalletMutation) OldAccount

func (m *WalletMutation) OldAccount(ctx context.Context) (v string, err error)

OldAccount returns the old "account" field's value of the Wallet entity. If the Wallet 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 (*WalletMutation) OldCreateTime

func (m *WalletMutation) OldCreateTime(ctx context.Context) (v time.Time, err error)

OldCreateTime returns the old "create_time" field's value of the Wallet entity. If the Wallet 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 (*WalletMutation) OldField

func (m *WalletMutation) 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 (*WalletMutation) OldPassword

func (m *WalletMutation) OldPassword(ctx context.Context) (v string, err error)

OldPassword returns the old "password" field's value of the Wallet entity. If the Wallet 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 (*WalletMutation) OldPrivateKey

func (m *WalletMutation) OldPrivateKey(ctx context.Context) (v string, err error)

OldPrivateKey returns the old "privateKey" field's value of the Wallet entity. If the Wallet 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 (*WalletMutation) OldUpdateTime

func (m *WalletMutation) OldUpdateTime(ctx context.Context) (v time.Time, err error)

OldUpdateTime returns the old "update_time" field's value of the Wallet entity. If the Wallet 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 (*WalletMutation) OldUserId

func (m *WalletMutation) OldUserId(ctx context.Context) (v int64, err error)

OldUserId returns the old "userId" field's value of the Wallet entity. If the Wallet 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 (*WalletMutation) Op

func (m *WalletMutation) Op() Op

Op returns the operation name.

func (*WalletMutation) Password

func (m *WalletMutation) Password() (r string, exists bool)

Password returns the value of the "password" field in the mutation.

func (*WalletMutation) PrivateKey

func (m *WalletMutation) PrivateKey() (r string, exists bool)

PrivateKey returns the value of the "privateKey" field in the mutation.

func (*WalletMutation) RemovedEdges

func (m *WalletMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*WalletMutation) RemovedIDs

func (m *WalletMutation) 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 (*WalletMutation) ResetAccount

func (m *WalletMutation) ResetAccount()

ResetAccount resets all changes to the "account" field.

func (*WalletMutation) ResetCreateTime

func (m *WalletMutation) ResetCreateTime()

ResetCreateTime resets all changes to the "create_time" field.

func (*WalletMutation) ResetEdge

func (m *WalletMutation) 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 (*WalletMutation) ResetField

func (m *WalletMutation) 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 (*WalletMutation) ResetPassword

func (m *WalletMutation) ResetPassword()

ResetPassword resets all changes to the "password" field.

func (*WalletMutation) ResetPrivateKey

func (m *WalletMutation) ResetPrivateKey()

ResetPrivateKey resets all changes to the "privateKey" field.

func (*WalletMutation) ResetUpdateTime

func (m *WalletMutation) ResetUpdateTime()

ResetUpdateTime resets all changes to the "update_time" field.

func (*WalletMutation) ResetUserId

func (m *WalletMutation) ResetUserId()

ResetUserId resets all changes to the "userId" field.

func (*WalletMutation) SetAccount

func (m *WalletMutation) SetAccount(s string)

SetAccount sets the "account" field.

func (*WalletMutation) SetCreateTime

func (m *WalletMutation) SetCreateTime(t time.Time)

SetCreateTime sets the "create_time" field.

func (*WalletMutation) SetField

func (m *WalletMutation) 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 (*WalletMutation) SetOp

func (m *WalletMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*WalletMutation) SetPassword

func (m *WalletMutation) SetPassword(s string)

SetPassword sets the "password" field.

func (*WalletMutation) SetPrivateKey

func (m *WalletMutation) SetPrivateKey(s string)

SetPrivateKey sets the "privateKey" field.

func (*WalletMutation) SetUpdateTime

func (m *WalletMutation) SetUpdateTime(t time.Time)

SetUpdateTime sets the "update_time" field.

func (*WalletMutation) SetUserId

func (m *WalletMutation) SetUserId(i int64)

SetUserId sets the "userId" field.

func (WalletMutation) Tx

func (m WalletMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*WalletMutation) Type

func (m *WalletMutation) Type() string

Type returns the node type of this mutation (Wallet).

func (*WalletMutation) UpdateTime

func (m *WalletMutation) UpdateTime() (r time.Time, exists bool)

UpdateTime returns the value of the "update_time" field in the mutation.

func (*WalletMutation) UserId

func (m *WalletMutation) UserId() (r int64, exists bool)

UserId returns the value of the "userId" field in the mutation.

func (*WalletMutation) Where

func (m *WalletMutation) Where(ps ...predicate.Wallet)

Where appends a list predicates to the WalletMutation builder.

func (*WalletMutation) WhereP

func (m *WalletMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the WalletMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type WalletQuery

type WalletQuery struct {
	// contains filtered or unexported fields
}

WalletQuery is the builder for querying Wallet entities.

func (*WalletQuery) Aggregate

func (_q *WalletQuery) Aggregate(fns ...AggregateFunc) *WalletSelect

Aggregate returns a WalletSelect configured with the given aggregations.

func (*WalletQuery) All

func (_q *WalletQuery) All(ctx context.Context) ([]*Wallet, error)

All executes the query and returns a list of Wallets.

func (*WalletQuery) AllX

func (_q *WalletQuery) AllX(ctx context.Context) []*Wallet

AllX is like All, but panics if an error occurs.

func (*WalletQuery) Clone

func (_q *WalletQuery) Clone() *WalletQuery

Clone returns a duplicate of the WalletQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*WalletQuery) Count

func (_q *WalletQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WalletQuery) CountX

func (_q *WalletQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*WalletQuery) Exist

func (_q *WalletQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*WalletQuery) ExistX

func (_q *WalletQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*WalletQuery) First

func (_q *WalletQuery) First(ctx context.Context) (*Wallet, error)

First returns the first Wallet entity from the query. Returns a *NotFoundError when no Wallet was found.

func (*WalletQuery) FirstID

func (_q *WalletQuery) FirstID(ctx context.Context) (id int, err error)

FirstID returns the first Wallet ID from the query. Returns a *NotFoundError when no Wallet ID was found.

func (*WalletQuery) FirstIDX

func (_q *WalletQuery) FirstIDX(ctx context.Context) int

FirstIDX is like FirstID, but panics if an error occurs.

func (*WalletQuery) FirstX

func (_q *WalletQuery) FirstX(ctx context.Context) *Wallet

FirstX is like First, but panics if an error occurs.

func (*WalletQuery) GroupBy

func (_q *WalletQuery) GroupBy(field string, fields ...string) *WalletGroupBy

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Wallet.Query().
	GroupBy(wallet.FieldCreateTime).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WalletQuery) IDs

func (_q *WalletQuery) IDs(ctx context.Context) (ids []int, err error)

IDs executes the query and returns a list of Wallet IDs.

func (*WalletQuery) IDsX

func (_q *WalletQuery) IDsX(ctx context.Context) []int

IDsX is like IDs, but panics if an error occurs.

func (*WalletQuery) Limit

func (_q *WalletQuery) Limit(limit int) *WalletQuery

Limit the number of records to be returned by this query.

func (*WalletQuery) Offset

func (_q *WalletQuery) Offset(offset int) *WalletQuery

Offset to start from.

func (*WalletQuery) Only

func (_q *WalletQuery) Only(ctx context.Context) (*Wallet, error)

Only returns a single Wallet entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Wallet entity is found. Returns a *NotFoundError when no Wallet entities are found.

func (*WalletQuery) OnlyID

func (_q *WalletQuery) OnlyID(ctx context.Context) (id int, err error)

OnlyID is like Only, but returns the only Wallet ID in the query. Returns a *NotSingularError when more than one Wallet ID is found. Returns a *NotFoundError when no entities are found.

func (*WalletQuery) OnlyIDX

func (_q *WalletQuery) OnlyIDX(ctx context.Context) int

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*WalletQuery) OnlyX

func (_q *WalletQuery) OnlyX(ctx context.Context) *Wallet

OnlyX is like Only, but panics if an error occurs.

func (*WalletQuery) Order

func (_q *WalletQuery) Order(o ...wallet.OrderOption) *WalletQuery

Order specifies how the records should be ordered.

func (*WalletQuery) Select

func (_q *WalletQuery) Select(fields ...string) *WalletSelect

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 {
	CreateTime time.Time `json:"create_time,omitempty"`
}

client.Wallet.Query().
	Select(wallet.FieldCreateTime).
	Scan(ctx, &v)

func (*WalletQuery) Unique

func (_q *WalletQuery) Unique(unique bool) *WalletQuery

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 (*WalletQuery) Where

func (_q *WalletQuery) Where(ps ...predicate.Wallet) *WalletQuery

Where adds a new predicate for the WalletQuery builder.

type WalletSelect

type WalletSelect struct {
	*WalletQuery
	// contains filtered or unexported fields
}

WalletSelect is the builder for selecting fields of Wallet entities.

func (*WalletSelect) Aggregate

func (_s *WalletSelect) Aggregate(fns ...AggregateFunc) *WalletSelect

Aggregate adds the given aggregation functions to the selector query.

func (*WalletSelect) Bool

func (s *WalletSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*WalletSelect) BoolX

func (s *WalletSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*WalletSelect) Bools

func (s *WalletSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*WalletSelect) BoolsX

func (s *WalletSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*WalletSelect) Float64

func (s *WalletSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*WalletSelect) Float64X

func (s *WalletSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*WalletSelect) Float64s

func (s *WalletSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*WalletSelect) Float64sX

func (s *WalletSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*WalletSelect) Int

func (s *WalletSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*WalletSelect) IntX

func (s *WalletSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*WalletSelect) Ints

func (s *WalletSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*WalletSelect) IntsX

func (s *WalletSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*WalletSelect) Scan

func (_s *WalletSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*WalletSelect) ScanX

func (s *WalletSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*WalletSelect) String

func (s *WalletSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*WalletSelect) StringX

func (s *WalletSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*WalletSelect) Strings

func (s *WalletSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*WalletSelect) StringsX

func (s *WalletSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type WalletUpdate

type WalletUpdate struct {
	// contains filtered or unexported fields
}

WalletUpdate is the builder for updating Wallet entities.

func (*WalletUpdate) AddUserId

func (_u *WalletUpdate) AddUserId(v int64) *WalletUpdate

AddUserId adds value to the "userId" field.

func (*WalletUpdate) Exec

func (_u *WalletUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WalletUpdate) ExecX

func (_u *WalletUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalletUpdate) Mutation

func (_u *WalletUpdate) Mutation() *WalletMutation

Mutation returns the WalletMutation object of the builder.

func (*WalletUpdate) Save

func (_u *WalletUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*WalletUpdate) SaveX

func (_u *WalletUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*WalletUpdate) SetAccount

func (_u *WalletUpdate) SetAccount(v string) *WalletUpdate

SetAccount sets the "account" field.

func (*WalletUpdate) SetNillableAccount

func (_u *WalletUpdate) SetNillableAccount(v *string) *WalletUpdate

SetNillableAccount sets the "account" field if the given value is not nil.

func (*WalletUpdate) SetNillablePassword

func (_u *WalletUpdate) SetNillablePassword(v *string) *WalletUpdate

SetNillablePassword sets the "password" field if the given value is not nil.

func (*WalletUpdate) SetNillablePrivateKey

func (_u *WalletUpdate) SetNillablePrivateKey(v *string) *WalletUpdate

SetNillablePrivateKey sets the "privateKey" field if the given value is not nil.

func (*WalletUpdate) SetNillableUserId

func (_u *WalletUpdate) SetNillableUserId(v *int64) *WalletUpdate

SetNillableUserId sets the "userId" field if the given value is not nil.

func (*WalletUpdate) SetPassword

func (_u *WalletUpdate) SetPassword(v string) *WalletUpdate

SetPassword sets the "password" field.

func (*WalletUpdate) SetPrivateKey

func (_u *WalletUpdate) SetPrivateKey(v string) *WalletUpdate

SetPrivateKey sets the "privateKey" field.

func (*WalletUpdate) SetUpdateTime

func (_u *WalletUpdate) SetUpdateTime(v time.Time) *WalletUpdate

SetUpdateTime sets the "update_time" field.

func (*WalletUpdate) SetUserId

func (_u *WalletUpdate) SetUserId(v int64) *WalletUpdate

SetUserId sets the "userId" field.

func (*WalletUpdate) Where

func (_u *WalletUpdate) Where(ps ...predicate.Wallet) *WalletUpdate

Where appends a list predicates to the WalletUpdate builder.

type WalletUpdateOne

type WalletUpdateOne struct {
	// contains filtered or unexported fields
}

WalletUpdateOne is the builder for updating a single Wallet entity.

func (*WalletUpdateOne) AddUserId

func (_u *WalletUpdateOne) AddUserId(v int64) *WalletUpdateOne

AddUserId adds value to the "userId" field.

func (*WalletUpdateOne) Exec

func (_u *WalletUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WalletUpdateOne) ExecX

func (_u *WalletUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*WalletUpdateOne) Mutation

func (_u *WalletUpdateOne) Mutation() *WalletMutation

Mutation returns the WalletMutation object of the builder.

func (*WalletUpdateOne) Save

func (_u *WalletUpdateOne) Save(ctx context.Context) (*Wallet, error)

Save executes the query and returns the updated Wallet entity.

func (*WalletUpdateOne) SaveX

func (_u *WalletUpdateOne) SaveX(ctx context.Context) *Wallet

SaveX is like Save, but panics if an error occurs.

func (*WalletUpdateOne) Select

func (_u *WalletUpdateOne) Select(field string, fields ...string) *WalletUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*WalletUpdateOne) SetAccount

func (_u *WalletUpdateOne) SetAccount(v string) *WalletUpdateOne

SetAccount sets the "account" field.

func (*WalletUpdateOne) SetNillableAccount

func (_u *WalletUpdateOne) SetNillableAccount(v *string) *WalletUpdateOne

SetNillableAccount sets the "account" field if the given value is not nil.

func (*WalletUpdateOne) SetNillablePassword

func (_u *WalletUpdateOne) SetNillablePassword(v *string) *WalletUpdateOne

SetNillablePassword sets the "password" field if the given value is not nil.

func (*WalletUpdateOne) SetNillablePrivateKey

func (_u *WalletUpdateOne) SetNillablePrivateKey(v *string) *WalletUpdateOne

SetNillablePrivateKey sets the "privateKey" field if the given value is not nil.

func (*WalletUpdateOne) SetNillableUserId

func (_u *WalletUpdateOne) SetNillableUserId(v *int64) *WalletUpdateOne

SetNillableUserId sets the "userId" field if the given value is not nil.

func (*WalletUpdateOne) SetPassword

func (_u *WalletUpdateOne) SetPassword(v string) *WalletUpdateOne

SetPassword sets the "password" field.

func (*WalletUpdateOne) SetPrivateKey

func (_u *WalletUpdateOne) SetPrivateKey(v string) *WalletUpdateOne

SetPrivateKey sets the "privateKey" field.

func (*WalletUpdateOne) SetUpdateTime

func (_u *WalletUpdateOne) SetUpdateTime(v time.Time) *WalletUpdateOne

SetUpdateTime sets the "update_time" field.

func (*WalletUpdateOne) SetUserId

func (_u *WalletUpdateOne) SetUserId(v int64) *WalletUpdateOne

SetUserId sets the "userId" field.

func (*WalletUpdateOne) Where

func (_u *WalletUpdateOne) Where(ps ...predicate.Wallet) *WalletUpdateOne

Where appends a list predicates to the WalletUpdate builder.

type Wallets

type Wallets []*Wallet

Wallets is a parsable slice of Wallet.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL