ent

package
v0.0.0-...-8a2a8d6 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 22 Imported by: 3

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.
	TypeAccount = "Account"
	TypeBlock   = "Block"
	TypeWallet  = "Wallet"
)

Variables

This section is empty.

Functions

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type Account

type Account struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// WalletID holds the value of the "wallet_id" field.
	WalletID uuid.UUID `json:"wallet_id,omitempty"`
	// Address holds the value of the "address" field.
	Address string `json:"address,omitempty"`
	// AccountIndex holds the value of the "account_index" field.
	AccountIndex *int `json:"account_index,omitempty"`
	// PrivateKey holds the value of the "private_key" field.
	PrivateKey *string `json:"private_key,omitempty"`
	// Work holds the value of the "work" field.
	Work bool `json:"work,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the AccountQuery when eager-loading is set.
	Edges AccountEdges `json:"edges"`
	// contains filtered or unexported fields
}

Account is the model entity for the Account schema.

func (*Account) QueryBlocks

func (a *Account) QueryBlocks() *BlockQuery

QueryBlocks queries the "blocks" edge of the Account entity.

func (*Account) QueryWallet

func (a *Account) QueryWallet() *WalletQuery

QueryWallet queries the "wallet" edge of the Account entity.

func (*Account) String

func (a *Account) String() string

String implements the fmt.Stringer.

func (*Account) Unwrap

func (a *Account) Unwrap() *Account

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

func (a *Account) Update() *AccountUpdateOne

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

type AccountClient

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

AccountClient is a client for the Account schema.

func NewAccountClient

func NewAccountClient(c config) *AccountClient

NewAccountClient returns a client for the Account from the given config.

func (*AccountClient) Create

func (c *AccountClient) Create() *AccountCreate

Create returns a builder for creating a Account entity.

func (*AccountClient) CreateBulk

func (c *AccountClient) CreateBulk(builders ...*AccountCreate) *AccountCreateBulk

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

func (*AccountClient) Delete

func (c *AccountClient) Delete() *AccountDelete

Delete returns a delete builder for Account.

func (*AccountClient) DeleteOne

func (c *AccountClient) DeleteOne(a *Account) *AccountDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*AccountClient) DeleteOneID

func (c *AccountClient) DeleteOneID(id uuid.UUID) *AccountDeleteOne

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

func (*AccountClient) Get

func (c *AccountClient) Get(ctx context.Context, id uuid.UUID) (*Account, error)

Get returns a Account entity by its id.

func (*AccountClient) GetX

func (c *AccountClient) GetX(ctx context.Context, id uuid.UUID) *Account

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

func (*AccountClient) Hooks

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

Hooks returns the client hooks.

func (*AccountClient) Query

func (c *AccountClient) Query() *AccountQuery

Query returns a query builder for Account.

func (*AccountClient) QueryBlocks

func (c *AccountClient) QueryBlocks(a *Account) *BlockQuery

QueryBlocks queries the blocks edge of a Account.

func (*AccountClient) QueryWallet

func (c *AccountClient) QueryWallet(a *Account) *WalletQuery

QueryWallet queries the wallet edge of a Account.

func (*AccountClient) Update

func (c *AccountClient) Update() *AccountUpdate

Update returns an update builder for Account.

func (*AccountClient) UpdateOne

func (c *AccountClient) UpdateOne(a *Account) *AccountUpdateOne

UpdateOne returns an update builder for the given entity.

func (*AccountClient) UpdateOneID

func (c *AccountClient) UpdateOneID(id uuid.UUID) *AccountUpdateOne

UpdateOneID returns an update builder for the given id.

func (*AccountClient) Use

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

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

type AccountCreate

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

AccountCreate is the builder for creating a Account entity.

func (*AccountCreate) AddBlockIDs

func (ac *AccountCreate) AddBlockIDs(ids ...uuid.UUID) *AccountCreate

AddBlockIDs adds the "blocks" edge to the Block entity by IDs.

func (*AccountCreate) AddBlocks

func (ac *AccountCreate) AddBlocks(b ...*Block) *AccountCreate

AddBlocks adds the "blocks" edges to the Block entity.

func (*AccountCreate) Exec

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

Exec executes the query.

func (*AccountCreate) ExecX

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

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

func (*AccountCreate) Mutation

func (ac *AccountCreate) Mutation() *AccountMutation

Mutation returns the AccountMutation object of the builder.

func (*AccountCreate) Save

func (ac *AccountCreate) Save(ctx context.Context) (*Account, error)

Save creates the Account in the database.

func (*AccountCreate) SaveX

func (ac *AccountCreate) SaveX(ctx context.Context) *Account

SaveX calls Save and panics if Save returns an error.

func (*AccountCreate) SetAccountIndex

func (ac *AccountCreate) SetAccountIndex(i int) *AccountCreate

SetAccountIndex sets the "account_index" field.

func (*AccountCreate) SetAddress

func (ac *AccountCreate) SetAddress(s string) *AccountCreate

SetAddress sets the "address" field.

func (*AccountCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AccountCreate) SetID

func (ac *AccountCreate) SetID(u uuid.UUID) *AccountCreate

SetID sets the "id" field.

func (*AccountCreate) SetNillableAccountIndex

func (ac *AccountCreate) SetNillableAccountIndex(i *int) *AccountCreate

SetNillableAccountIndex sets the "account_index" field if the given value is not nil.

func (*AccountCreate) SetNillableCreatedAt

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

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

func (*AccountCreate) SetNillableID

func (ac *AccountCreate) SetNillableID(u *uuid.UUID) *AccountCreate

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

func (*AccountCreate) SetNillablePrivateKey

func (ac *AccountCreate) SetNillablePrivateKey(s *string) *AccountCreate

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

func (*AccountCreate) SetNillableWork

func (ac *AccountCreate) SetNillableWork(b *bool) *AccountCreate

SetNillableWork sets the "work" field if the given value is not nil.

func (*AccountCreate) SetPrivateKey

func (ac *AccountCreate) SetPrivateKey(s string) *AccountCreate

SetPrivateKey sets the "private_key" field.

func (*AccountCreate) SetWallet

func (ac *AccountCreate) SetWallet(w *Wallet) *AccountCreate

SetWallet sets the "wallet" edge to the Wallet entity.

func (*AccountCreate) SetWalletID

func (ac *AccountCreate) SetWalletID(u uuid.UUID) *AccountCreate

SetWalletID sets the "wallet_id" field.

func (*AccountCreate) SetWork

func (ac *AccountCreate) SetWork(b bool) *AccountCreate

SetWork sets the "work" field.

type AccountCreateBulk

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

AccountCreateBulk is the builder for creating many Account entities in bulk.

func (*AccountCreateBulk) Exec

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

Exec executes the query.

func (*AccountCreateBulk) ExecX

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

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

func (*AccountCreateBulk) Save

func (acb *AccountCreateBulk) Save(ctx context.Context) ([]*Account, error)

Save creates the Account entities in the database.

func (*AccountCreateBulk) SaveX

func (acb *AccountCreateBulk) SaveX(ctx context.Context) []*Account

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

type AccountDelete

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

AccountDelete is the builder for deleting a Account entity.

func (*AccountDelete) Exec

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

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

func (*AccountDelete) ExecX

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

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

func (*AccountDelete) Where

func (ad *AccountDelete) Where(ps ...predicate.Account) *AccountDelete

Where appends a list predicates to the AccountDelete builder.

type AccountDeleteOne

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

AccountDeleteOne is the builder for deleting a single Account entity.

func (*AccountDeleteOne) Exec

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

Exec executes the deletion query.

func (*AccountDeleteOne) ExecX

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

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

type AccountEdges

type AccountEdges struct {
	// Wallet holds the value of the wallet edge.
	Wallet *Wallet `json:"wallet,omitempty"`
	// Blocks holds the value of the blocks edge.
	Blocks []*Block `json:"blocks,omitempty"`
	// contains filtered or unexported fields
}

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

func (AccountEdges) BlocksOrErr

func (e AccountEdges) BlocksOrErr() ([]*Block, error)

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

func (AccountEdges) WalletOrErr

func (e AccountEdges) WalletOrErr() (*Wallet, error)

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

type AccountGroupBy

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

AccountGroupBy is the group-by builder for Account entities.

func (*AccountGroupBy) Aggregate

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

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

func (*AccountGroupBy) Bool

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

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

func (*AccountGroupBy) BoolX

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

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

func (*AccountGroupBy) Bools

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

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

func (*AccountGroupBy) BoolsX

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

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

func (*AccountGroupBy) Float64

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

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

func (*AccountGroupBy) Float64X

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

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

func (*AccountGroupBy) Float64s

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

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

func (*AccountGroupBy) Float64sX

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

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

func (*AccountGroupBy) Int

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

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

func (*AccountGroupBy) IntX

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

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

func (*AccountGroupBy) Ints

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

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

func (*AccountGroupBy) IntsX

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

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

func (*AccountGroupBy) Scan

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

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

func (*AccountGroupBy) ScanX

func (s *AccountGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*AccountGroupBy) String

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

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

func (*AccountGroupBy) StringX

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

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

func (*AccountGroupBy) Strings

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

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

func (*AccountGroupBy) StringsX

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

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

type AccountMutation

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

AccountMutation represents an operation that mutates the Account nodes in the graph.

func (*AccountMutation) AccountIndex

func (m *AccountMutation) AccountIndex() (r int, exists bool)

AccountIndex returns the value of the "account_index" field in the mutation.

func (*AccountMutation) AccountIndexCleared

func (m *AccountMutation) AccountIndexCleared() bool

AccountIndexCleared returns if the "account_index" field was cleared in this mutation.

func (*AccountMutation) AddAccountIndex

func (m *AccountMutation) AddAccountIndex(i int)

AddAccountIndex adds i to the "account_index" field.

func (*AccountMutation) AddBlockIDs

func (m *AccountMutation) AddBlockIDs(ids ...uuid.UUID)

AddBlockIDs adds the "blocks" edge to the Block entity by ids.

func (*AccountMutation) AddField

func (m *AccountMutation) 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 (*AccountMutation) AddedAccountIndex

func (m *AccountMutation) AddedAccountIndex() (r int, exists bool)

AddedAccountIndex returns the value that was added to the "account_index" field in this mutation.

func (*AccountMutation) AddedEdges

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

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

func (*AccountMutation) AddedField

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

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

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

func (*AccountMutation) AddedIDs

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

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

func (*AccountMutation) Address

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

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

func (*AccountMutation) BlocksCleared

func (m *AccountMutation) BlocksCleared() bool

BlocksCleared reports if the "blocks" edge to the Block entity was cleared.

func (*AccountMutation) BlocksIDs

func (m *AccountMutation) BlocksIDs() (ids []uuid.UUID)

BlocksIDs returns the "blocks" edge IDs in the mutation.

func (*AccountMutation) ClearAccountIndex

func (m *AccountMutation) ClearAccountIndex()

ClearAccountIndex clears the value of the "account_index" field.

func (*AccountMutation) ClearBlocks

func (m *AccountMutation) ClearBlocks()

ClearBlocks clears the "blocks" edge to the Block entity.

func (*AccountMutation) ClearEdge

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

func (m *AccountMutation) 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 (*AccountMutation) ClearPrivateKey

func (m *AccountMutation) ClearPrivateKey()

ClearPrivateKey clears the value of the "private_key" field.

func (*AccountMutation) ClearWallet

func (m *AccountMutation) ClearWallet()

ClearWallet clears the "wallet" edge to the Wallet entity.

func (*AccountMutation) ClearedEdges

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

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

func (*AccountMutation) ClearedFields

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

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

func (AccountMutation) Client

func (m AccountMutation) 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 (*AccountMutation) CreatedAt

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

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

func (*AccountMutation) EdgeCleared

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

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

func (*AccountMutation) Field

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

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

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

func (*AccountMutation) Fields

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

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

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

func (*AccountMutation) IDs

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

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

func (*AccountMutation) OldAccountIndex

func (m *AccountMutation) OldAccountIndex(ctx context.Context) (v *int, err error)

OldAccountIndex returns the old "account_index" field's value of the Account entity. If the Account 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 (*AccountMutation) OldAddress

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

OldAddress returns the old "address" field's value of the Account entity. If the Account 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 (*AccountMutation) OldCreatedAt

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

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

func (m *AccountMutation) 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 (*AccountMutation) OldPrivateKey

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

OldPrivateKey returns the old "private_key" field's value of the Account entity. If the Account 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 (*AccountMutation) OldWalletID

func (m *AccountMutation) OldWalletID(ctx context.Context) (v uuid.UUID, err error)

OldWalletID returns the old "wallet_id" field's value of the Account entity. If the Account 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 (*AccountMutation) OldWork

func (m *AccountMutation) OldWork(ctx context.Context) (v bool, err error)

OldWork returns the old "work" field's value of the Account entity. If the Account 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 (*AccountMutation) Op

func (m *AccountMutation) Op() Op

Op returns the operation name.

func (*AccountMutation) PrivateKey

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

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

func (*AccountMutation) PrivateKeyCleared

func (m *AccountMutation) PrivateKeyCleared() bool

PrivateKeyCleared returns if the "private_key" field was cleared in this mutation.

func (*AccountMutation) RemoveBlockIDs

func (m *AccountMutation) RemoveBlockIDs(ids ...uuid.UUID)

RemoveBlockIDs removes the "blocks" edge to the Block entity by IDs.

func (*AccountMutation) RemovedBlocksIDs

func (m *AccountMutation) RemovedBlocksIDs() (ids []uuid.UUID)

RemovedBlocks returns the removed IDs of the "blocks" edge to the Block entity.

func (*AccountMutation) RemovedEdges

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

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

func (*AccountMutation) RemovedIDs

func (m *AccountMutation) 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 (*AccountMutation) ResetAccountIndex

func (m *AccountMutation) ResetAccountIndex()

ResetAccountIndex resets all changes to the "account_index" field.

func (*AccountMutation) ResetAddress

func (m *AccountMutation) ResetAddress()

ResetAddress resets all changes to the "address" field.

func (*AccountMutation) ResetBlocks

func (m *AccountMutation) ResetBlocks()

ResetBlocks resets all changes to the "blocks" edge.

func (*AccountMutation) ResetCreatedAt

func (m *AccountMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*AccountMutation) ResetEdge

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

func (m *AccountMutation) 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 (*AccountMutation) ResetPrivateKey

func (m *AccountMutation) ResetPrivateKey()

ResetPrivateKey resets all changes to the "private_key" field.

func (*AccountMutation) ResetWallet

func (m *AccountMutation) ResetWallet()

ResetWallet resets all changes to the "wallet" edge.

func (*AccountMutation) ResetWalletID

func (m *AccountMutation) ResetWalletID()

ResetWalletID resets all changes to the "wallet_id" field.

func (*AccountMutation) ResetWork

func (m *AccountMutation) ResetWork()

ResetWork resets all changes to the "work" field.

func (*AccountMutation) SetAccountIndex

func (m *AccountMutation) SetAccountIndex(i int)

SetAccountIndex sets the "account_index" field.

func (*AccountMutation) SetAddress

func (m *AccountMutation) SetAddress(s string)

SetAddress sets the "address" field.

func (*AccountMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*AccountMutation) SetField

func (m *AccountMutation) 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 (*AccountMutation) SetID

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

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

func (*AccountMutation) SetPrivateKey

func (m *AccountMutation) SetPrivateKey(s string)

SetPrivateKey sets the "private_key" field.

func (*AccountMutation) SetWalletID

func (m *AccountMutation) SetWalletID(u uuid.UUID)

SetWalletID sets the "wallet_id" field.

func (*AccountMutation) SetWork

func (m *AccountMutation) SetWork(b bool)

SetWork sets the "work" field.

func (AccountMutation) Tx

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

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

func (*AccountMutation) Type

func (m *AccountMutation) Type() string

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

func (*AccountMutation) WalletCleared

func (m *AccountMutation) WalletCleared() bool

WalletCleared reports if the "wallet" edge to the Wallet entity was cleared.

func (*AccountMutation) WalletID

func (m *AccountMutation) WalletID() (r uuid.UUID, exists bool)

WalletID returns the value of the "wallet_id" field in the mutation.

func (*AccountMutation) WalletIDs

func (m *AccountMutation) WalletIDs() (ids []uuid.UUID)

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

func (*AccountMutation) Where

func (m *AccountMutation) Where(ps ...predicate.Account)

Where appends a list predicates to the AccountMutation builder.

func (*AccountMutation) Work

func (m *AccountMutation) Work() (r bool, exists bool)

Work returns the value of the "work" field in the mutation.

type AccountQuery

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

AccountQuery is the builder for querying Account entities.

func (*AccountQuery) All

func (aq *AccountQuery) All(ctx context.Context) ([]*Account, error)

All executes the query and returns a list of Accounts.

func (*AccountQuery) AllX

func (aq *AccountQuery) AllX(ctx context.Context) []*Account

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

func (*AccountQuery) Clone

func (aq *AccountQuery) Clone() *AccountQuery

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

func (*AccountQuery) Count

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

Count returns the count of the given query.

func (*AccountQuery) CountX

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

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

func (*AccountQuery) Exist

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

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

func (*AccountQuery) ExistX

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

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

func (*AccountQuery) First

func (aq *AccountQuery) First(ctx context.Context) (*Account, error)

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

func (*AccountQuery) FirstID

func (aq *AccountQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AccountQuery) FirstIDX

func (aq *AccountQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*AccountQuery) FirstX

func (aq *AccountQuery) FirstX(ctx context.Context) *Account

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

func (*AccountQuery) GroupBy

func (aq *AccountQuery) GroupBy(field string, fields ...string) *AccountGroupBy

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 {
	WalletID uuid.UUID `json:"wallet_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Account.Query().
	GroupBy(account.FieldWalletID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*AccountQuery) IDs

func (aq *AccountQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*AccountQuery) IDsX

func (aq *AccountQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*AccountQuery) Limit

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

Limit adds a limit step to the query.

func (*AccountQuery) Offset

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

Offset adds an offset step to the query.

func (*AccountQuery) Only

func (aq *AccountQuery) Only(ctx context.Context) (*Account, error)

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

func (*AccountQuery) OnlyID

func (aq *AccountQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*AccountQuery) OnlyIDX

func (aq *AccountQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*AccountQuery) OnlyX

func (aq *AccountQuery) OnlyX(ctx context.Context) *Account

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

func (*AccountQuery) Order

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

Order adds an order step to the query.

func (*AccountQuery) QueryBlocks

func (aq *AccountQuery) QueryBlocks() *BlockQuery

QueryBlocks chains the current query on the "blocks" edge.

func (*AccountQuery) QueryWallet

func (aq *AccountQuery) QueryWallet() *WalletQuery

QueryWallet chains the current query on the "wallet" edge.

func (*AccountQuery) Select

func (aq *AccountQuery) Select(fields ...string) *AccountSelect

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 {
	WalletID uuid.UUID `json:"wallet_id,omitempty"`
}

client.Account.Query().
	Select(account.FieldWalletID).
	Scan(ctx, &v)

func (*AccountQuery) Unique

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

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

func (aq *AccountQuery) Where(ps ...predicate.Account) *AccountQuery

Where adds a new predicate for the AccountQuery builder.

func (*AccountQuery) WithBlocks

func (aq *AccountQuery) WithBlocks(opts ...func(*BlockQuery)) *AccountQuery

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

func (*AccountQuery) WithWallet

func (aq *AccountQuery) WithWallet(opts ...func(*WalletQuery)) *AccountQuery

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

type AccountSelect

type AccountSelect struct {
	*AccountQuery
	// contains filtered or unexported fields
}

AccountSelect is the builder for selecting fields of Account entities.

func (*AccountSelect) Bool

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

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

func (*AccountSelect) BoolX

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

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

func (*AccountSelect) Bools

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

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

func (*AccountSelect) BoolsX

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

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

func (*AccountSelect) Float64

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

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

func (*AccountSelect) Float64X

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

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

func (*AccountSelect) Float64s

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

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

func (*AccountSelect) Float64sX

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

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

func (*AccountSelect) Int

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

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

func (*AccountSelect) IntX

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

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

func (*AccountSelect) Ints

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

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

func (*AccountSelect) IntsX

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

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

func (*AccountSelect) Scan

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

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

func (*AccountSelect) ScanX

func (s *AccountSelect) ScanX(ctx context.Context, v interface{})

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

func (*AccountSelect) String

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

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

func (*AccountSelect) StringX

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

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

func (*AccountSelect) Strings

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

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

func (*AccountSelect) StringsX

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

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

type AccountUpdate

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

AccountUpdate is the builder for updating Account entities.

func (*AccountUpdate) AddAccountIndex

func (au *AccountUpdate) AddAccountIndex(i int) *AccountUpdate

AddAccountIndex adds i to the "account_index" field.

func (*AccountUpdate) AddBlockIDs

func (au *AccountUpdate) AddBlockIDs(ids ...uuid.UUID) *AccountUpdate

AddBlockIDs adds the "blocks" edge to the Block entity by IDs.

func (*AccountUpdate) AddBlocks

func (au *AccountUpdate) AddBlocks(b ...*Block) *AccountUpdate

AddBlocks adds the "blocks" edges to the Block entity.

func (*AccountUpdate) ClearAccountIndex

func (au *AccountUpdate) ClearAccountIndex() *AccountUpdate

ClearAccountIndex clears the value of the "account_index" field.

func (*AccountUpdate) ClearBlocks

func (au *AccountUpdate) ClearBlocks() *AccountUpdate

ClearBlocks clears all "blocks" edges to the Block entity.

func (*AccountUpdate) ClearPrivateKey

func (au *AccountUpdate) ClearPrivateKey() *AccountUpdate

ClearPrivateKey clears the value of the "private_key" field.

func (*AccountUpdate) ClearWallet

func (au *AccountUpdate) ClearWallet() *AccountUpdate

ClearWallet clears the "wallet" edge to the Wallet entity.

func (*AccountUpdate) Exec

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

Exec executes the query.

func (*AccountUpdate) ExecX

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

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

func (*AccountUpdate) Mutation

func (au *AccountUpdate) Mutation() *AccountMutation

Mutation returns the AccountMutation object of the builder.

func (*AccountUpdate) RemoveBlockIDs

func (au *AccountUpdate) RemoveBlockIDs(ids ...uuid.UUID) *AccountUpdate

RemoveBlockIDs removes the "blocks" edge to Block entities by IDs.

func (*AccountUpdate) RemoveBlocks

func (au *AccountUpdate) RemoveBlocks(b ...*Block) *AccountUpdate

RemoveBlocks removes "blocks" edges to Block entities.

func (*AccountUpdate) Save

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

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

func (*AccountUpdate) SaveX

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

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

func (*AccountUpdate) SetAccountIndex

func (au *AccountUpdate) SetAccountIndex(i int) *AccountUpdate

SetAccountIndex sets the "account_index" field.

func (*AccountUpdate) SetAddress

func (au *AccountUpdate) SetAddress(s string) *AccountUpdate

SetAddress sets the "address" field.

func (*AccountUpdate) SetNillableAccountIndex

func (au *AccountUpdate) SetNillableAccountIndex(i *int) *AccountUpdate

SetNillableAccountIndex sets the "account_index" field if the given value is not nil.

func (*AccountUpdate) SetNillablePrivateKey

func (au *AccountUpdate) SetNillablePrivateKey(s *string) *AccountUpdate

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

func (*AccountUpdate) SetNillableWork

func (au *AccountUpdate) SetNillableWork(b *bool) *AccountUpdate

SetNillableWork sets the "work" field if the given value is not nil.

func (*AccountUpdate) SetPrivateKey

func (au *AccountUpdate) SetPrivateKey(s string) *AccountUpdate

SetPrivateKey sets the "private_key" field.

func (*AccountUpdate) SetWallet

func (au *AccountUpdate) SetWallet(w *Wallet) *AccountUpdate

SetWallet sets the "wallet" edge to the Wallet entity.

func (*AccountUpdate) SetWalletID

func (au *AccountUpdate) SetWalletID(u uuid.UUID) *AccountUpdate

SetWalletID sets the "wallet_id" field.

func (*AccountUpdate) SetWork

func (au *AccountUpdate) SetWork(b bool) *AccountUpdate

SetWork sets the "work" field.

func (*AccountUpdate) Where

func (au *AccountUpdate) Where(ps ...predicate.Account) *AccountUpdate

Where appends a list predicates to the AccountUpdate builder.

type AccountUpdateOne

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

AccountUpdateOne is the builder for updating a single Account entity.

func (*AccountUpdateOne) AddAccountIndex

func (auo *AccountUpdateOne) AddAccountIndex(i int) *AccountUpdateOne

AddAccountIndex adds i to the "account_index" field.

func (*AccountUpdateOne) AddBlockIDs

func (auo *AccountUpdateOne) AddBlockIDs(ids ...uuid.UUID) *AccountUpdateOne

AddBlockIDs adds the "blocks" edge to the Block entity by IDs.

func (*AccountUpdateOne) AddBlocks

func (auo *AccountUpdateOne) AddBlocks(b ...*Block) *AccountUpdateOne

AddBlocks adds the "blocks" edges to the Block entity.

func (*AccountUpdateOne) ClearAccountIndex

func (auo *AccountUpdateOne) ClearAccountIndex() *AccountUpdateOne

ClearAccountIndex clears the value of the "account_index" field.

func (*AccountUpdateOne) ClearBlocks

func (auo *AccountUpdateOne) ClearBlocks() *AccountUpdateOne

ClearBlocks clears all "blocks" edges to the Block entity.

func (*AccountUpdateOne) ClearPrivateKey

func (auo *AccountUpdateOne) ClearPrivateKey() *AccountUpdateOne

ClearPrivateKey clears the value of the "private_key" field.

func (*AccountUpdateOne) ClearWallet

func (auo *AccountUpdateOne) ClearWallet() *AccountUpdateOne

ClearWallet clears the "wallet" edge to the Wallet entity.

func (*AccountUpdateOne) Exec

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

Exec executes the query on the entity.

func (*AccountUpdateOne) ExecX

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

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

func (*AccountUpdateOne) Mutation

func (auo *AccountUpdateOne) Mutation() *AccountMutation

Mutation returns the AccountMutation object of the builder.

func (*AccountUpdateOne) RemoveBlockIDs

func (auo *AccountUpdateOne) RemoveBlockIDs(ids ...uuid.UUID) *AccountUpdateOne

RemoveBlockIDs removes the "blocks" edge to Block entities by IDs.

func (*AccountUpdateOne) RemoveBlocks

func (auo *AccountUpdateOne) RemoveBlocks(b ...*Block) *AccountUpdateOne

RemoveBlocks removes "blocks" edges to Block entities.

func (*AccountUpdateOne) Save

func (auo *AccountUpdateOne) Save(ctx context.Context) (*Account, error)

Save executes the query and returns the updated Account entity.

func (*AccountUpdateOne) SaveX

func (auo *AccountUpdateOne) SaveX(ctx context.Context) *Account

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

func (*AccountUpdateOne) Select

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

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

func (*AccountUpdateOne) SetAccountIndex

func (auo *AccountUpdateOne) SetAccountIndex(i int) *AccountUpdateOne

SetAccountIndex sets the "account_index" field.

func (*AccountUpdateOne) SetAddress

func (auo *AccountUpdateOne) SetAddress(s string) *AccountUpdateOne

SetAddress sets the "address" field.

func (*AccountUpdateOne) SetNillableAccountIndex

func (auo *AccountUpdateOne) SetNillableAccountIndex(i *int) *AccountUpdateOne

SetNillableAccountIndex sets the "account_index" field if the given value is not nil.

func (*AccountUpdateOne) SetNillablePrivateKey

func (auo *AccountUpdateOne) SetNillablePrivateKey(s *string) *AccountUpdateOne

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

func (*AccountUpdateOne) SetNillableWork

func (auo *AccountUpdateOne) SetNillableWork(b *bool) *AccountUpdateOne

SetNillableWork sets the "work" field if the given value is not nil.

func (*AccountUpdateOne) SetPrivateKey

func (auo *AccountUpdateOne) SetPrivateKey(s string) *AccountUpdateOne

SetPrivateKey sets the "private_key" field.

func (*AccountUpdateOne) SetWallet

func (auo *AccountUpdateOne) SetWallet(w *Wallet) *AccountUpdateOne

SetWallet sets the "wallet" edge to the Wallet entity.

func (*AccountUpdateOne) SetWalletID

func (auo *AccountUpdateOne) SetWalletID(u uuid.UUID) *AccountUpdateOne

SetWalletID sets the "wallet_id" field.

func (*AccountUpdateOne) SetWork

func (auo *AccountUpdateOne) SetWork(b bool) *AccountUpdateOne

SetWork sets the "work" field.

type Accounts

type Accounts []*Account

Accounts is a parsable slice of Account.

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 Block

type Block struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// AccountID holds the value of the "account_id" field.
	AccountID *uuid.UUID `json:"account_id,omitempty"`
	// BlockHash holds the value of the "block_hash" field.
	BlockHash string `json:"block_hash,omitempty"`
	// Block holds the value of the "block" field.
	Block map[string]interface{} `json:"block,omitempty"`
	// SendID holds the value of the "send_id" field.
	SendID *string `json:"send_id,omitempty"`
	// Subtype holds the value of the "subtype" field.
	Subtype string `json:"subtype,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BlockQuery when eager-loading is set.
	Edges BlockEdges `json:"edges"`
	// contains filtered or unexported fields
}

Block is the model entity for the Block schema.

func (*Block) QueryAccount

func (b *Block) QueryAccount() *AccountQuery

QueryAccount queries the "account" edge of the Block entity.

func (*Block) String

func (b *Block) String() string

String implements the fmt.Stringer.

func (*Block) Unwrap

func (b *Block) Unwrap() *Block

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

func (b *Block) Update() *BlockUpdateOne

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

type BlockClient

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

BlockClient is a client for the Block schema.

func NewBlockClient

func NewBlockClient(c config) *BlockClient

NewBlockClient returns a client for the Block from the given config.

func (*BlockClient) Create

func (c *BlockClient) Create() *BlockCreate

Create returns a builder for creating a Block entity.

func (*BlockClient) CreateBulk

func (c *BlockClient) CreateBulk(builders ...*BlockCreate) *BlockCreateBulk

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

func (*BlockClient) Delete

func (c *BlockClient) Delete() *BlockDelete

Delete returns a delete builder for Block.

func (*BlockClient) DeleteOne

func (c *BlockClient) DeleteOne(b *Block) *BlockDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BlockClient) DeleteOneID

func (c *BlockClient) DeleteOneID(id uuid.UUID) *BlockDeleteOne

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

func (*BlockClient) Get

func (c *BlockClient) Get(ctx context.Context, id uuid.UUID) (*Block, error)

Get returns a Block entity by its id.

func (*BlockClient) GetX

func (c *BlockClient) GetX(ctx context.Context, id uuid.UUID) *Block

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

func (*BlockClient) Hooks

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

Hooks returns the client hooks.

func (*BlockClient) Query

func (c *BlockClient) Query() *BlockQuery

Query returns a query builder for Block.

func (*BlockClient) QueryAccount

func (c *BlockClient) QueryAccount(b *Block) *AccountQuery

QueryAccount queries the account edge of a Block.

func (*BlockClient) Update

func (c *BlockClient) Update() *BlockUpdate

Update returns an update builder for Block.

func (*BlockClient) UpdateOne

func (c *BlockClient) UpdateOne(b *Block) *BlockUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BlockClient) UpdateOneID

func (c *BlockClient) UpdateOneID(id uuid.UUID) *BlockUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BlockClient) Use

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

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

type BlockCreate

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

BlockCreate is the builder for creating a Block entity.

func (*BlockCreate) Exec

func (bc *BlockCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BlockCreate) ExecX

func (bc *BlockCreate) ExecX(ctx context.Context)

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

func (*BlockCreate) Mutation

func (bc *BlockCreate) Mutation() *BlockMutation

Mutation returns the BlockMutation object of the builder.

func (*BlockCreate) Save

func (bc *BlockCreate) Save(ctx context.Context) (*Block, error)

Save creates the Block in the database.

func (*BlockCreate) SaveX

func (bc *BlockCreate) SaveX(ctx context.Context) *Block

SaveX calls Save and panics if Save returns an error.

func (*BlockCreate) SetAccount

func (bc *BlockCreate) SetAccount(a *Account) *BlockCreate

SetAccount sets the "account" edge to the Account entity.

func (*BlockCreate) SetAccountID

func (bc *BlockCreate) SetAccountID(u uuid.UUID) *BlockCreate

SetAccountID sets the "account_id" field.

func (*BlockCreate) SetBlock

func (bc *BlockCreate) SetBlock(m map[string]interface{}) *BlockCreate

SetBlock sets the "block" field.

func (*BlockCreate) SetBlockHash

func (bc *BlockCreate) SetBlockHash(s string) *BlockCreate

SetBlockHash sets the "block_hash" field.

func (*BlockCreate) SetCreatedAt

func (bc *BlockCreate) SetCreatedAt(t time.Time) *BlockCreate

SetCreatedAt sets the "created_at" field.

func (*BlockCreate) SetID

func (bc *BlockCreate) SetID(u uuid.UUID) *BlockCreate

SetID sets the "id" field.

func (*BlockCreate) SetNillableAccountID

func (bc *BlockCreate) SetNillableAccountID(u *uuid.UUID) *BlockCreate

SetNillableAccountID sets the "account_id" field if the given value is not nil.

func (*BlockCreate) SetNillableCreatedAt

func (bc *BlockCreate) SetNillableCreatedAt(t *time.Time) *BlockCreate

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

func (*BlockCreate) SetNillableID

func (bc *BlockCreate) SetNillableID(u *uuid.UUID) *BlockCreate

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

func (*BlockCreate) SetNillableSendID

func (bc *BlockCreate) SetNillableSendID(s *string) *BlockCreate

SetNillableSendID sets the "send_id" field if the given value is not nil.

func (*BlockCreate) SetSendID

func (bc *BlockCreate) SetSendID(s string) *BlockCreate

SetSendID sets the "send_id" field.

func (*BlockCreate) SetSubtype

func (bc *BlockCreate) SetSubtype(s string) *BlockCreate

SetSubtype sets the "subtype" field.

type BlockCreateBulk

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

BlockCreateBulk is the builder for creating many Block entities in bulk.

func (*BlockCreateBulk) Exec

func (bcb *BlockCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BlockCreateBulk) ExecX

func (bcb *BlockCreateBulk) ExecX(ctx context.Context)

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

func (*BlockCreateBulk) Save

func (bcb *BlockCreateBulk) Save(ctx context.Context) ([]*Block, error)

Save creates the Block entities in the database.

func (*BlockCreateBulk) SaveX

func (bcb *BlockCreateBulk) SaveX(ctx context.Context) []*Block

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

type BlockDelete

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

BlockDelete is the builder for deleting a Block entity.

func (*BlockDelete) Exec

func (bd *BlockDelete) Exec(ctx context.Context) (int, error)

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

func (*BlockDelete) ExecX

func (bd *BlockDelete) ExecX(ctx context.Context) int

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

func (*BlockDelete) Where

func (bd *BlockDelete) Where(ps ...predicate.Block) *BlockDelete

Where appends a list predicates to the BlockDelete builder.

type BlockDeleteOne

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

BlockDeleteOne is the builder for deleting a single Block entity.

func (*BlockDeleteOne) Exec

func (bdo *BlockDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BlockDeleteOne) ExecX

func (bdo *BlockDeleteOne) ExecX(ctx context.Context)

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

type BlockEdges

type BlockEdges struct {
	// Account holds the value of the account edge.
	Account *Account `json:"account,omitempty"`
	// contains filtered or unexported fields
}

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

func (BlockEdges) AccountOrErr

func (e BlockEdges) AccountOrErr() (*Account, error)

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

type BlockGroupBy

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

BlockGroupBy is the group-by builder for Block entities.

func (*BlockGroupBy) Aggregate

func (bgb *BlockGroupBy) Aggregate(fns ...AggregateFunc) *BlockGroupBy

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

func (*BlockGroupBy) Bool

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

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

func (*BlockGroupBy) BoolX

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

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

func (*BlockGroupBy) Bools

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

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

func (*BlockGroupBy) BoolsX

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

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

func (*BlockGroupBy) Float64

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

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

func (*BlockGroupBy) Float64X

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

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

func (*BlockGroupBy) Float64s

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

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

func (*BlockGroupBy) Float64sX

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

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

func (*BlockGroupBy) Int

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

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

func (*BlockGroupBy) IntX

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

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

func (*BlockGroupBy) Ints

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

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

func (*BlockGroupBy) IntsX

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

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

func (*BlockGroupBy) Scan

func (bgb *BlockGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*BlockGroupBy) ScanX

func (s *BlockGroupBy) ScanX(ctx context.Context, v interface{})

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

func (*BlockGroupBy) String

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

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

func (*BlockGroupBy) StringX

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

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

func (*BlockGroupBy) Strings

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

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

func (*BlockGroupBy) StringsX

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

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

type BlockMutation

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

BlockMutation represents an operation that mutates the Block nodes in the graph.

func (*BlockMutation) AccountCleared

func (m *BlockMutation) AccountCleared() bool

AccountCleared reports if the "account" edge to the Account entity was cleared.

func (*BlockMutation) AccountID

func (m *BlockMutation) AccountID() (r uuid.UUID, exists bool)

AccountID returns the value of the "account_id" field in the mutation.

func (*BlockMutation) AccountIDCleared

func (m *BlockMutation) AccountIDCleared() bool

AccountIDCleared returns if the "account_id" field was cleared in this mutation.

func (*BlockMutation) AccountIDs

func (m *BlockMutation) AccountIDs() (ids []uuid.UUID)

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

func (*BlockMutation) AddField

func (m *BlockMutation) 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 (*BlockMutation) AddedEdges

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

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

func (*BlockMutation) AddedField

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

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

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

func (*BlockMutation) AddedIDs

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

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

func (*BlockMutation) Block

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

Block returns the value of the "block" field in the mutation.

func (*BlockMutation) BlockHash

func (m *BlockMutation) BlockHash() (r string, exists bool)

BlockHash returns the value of the "block_hash" field in the mutation.

func (*BlockMutation) ClearAccount

func (m *BlockMutation) ClearAccount()

ClearAccount clears the "account" edge to the Account entity.

func (*BlockMutation) ClearAccountID

func (m *BlockMutation) ClearAccountID()

ClearAccountID clears the value of the "account_id" field.

func (*BlockMutation) ClearEdge

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

func (m *BlockMutation) 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 (*BlockMutation) ClearSendID

func (m *BlockMutation) ClearSendID()

ClearSendID clears the value of the "send_id" field.

func (*BlockMutation) ClearedEdges

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

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

func (*BlockMutation) ClearedFields

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

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

func (BlockMutation) Client

func (m BlockMutation) 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 (*BlockMutation) CreatedAt

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

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

func (*BlockMutation) EdgeCleared

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

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

func (*BlockMutation) Field

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

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

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

func (*BlockMutation) Fields

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

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

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

func (*BlockMutation) IDs

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

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

func (*BlockMutation) OldAccountID

func (m *BlockMutation) OldAccountID(ctx context.Context) (v *uuid.UUID, err error)

OldAccountID returns the old "account_id" field's value of the Block entity. If the Block 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 (*BlockMutation) OldBlock

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

OldBlock returns the old "block" field's value of the Block entity. If the Block 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 (*BlockMutation) OldBlockHash

func (m *BlockMutation) OldBlockHash(ctx context.Context) (v string, err error)

OldBlockHash returns the old "block_hash" field's value of the Block entity. If the Block 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 (*BlockMutation) OldCreatedAt

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

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

func (m *BlockMutation) 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 (*BlockMutation) OldSendID

func (m *BlockMutation) OldSendID(ctx context.Context) (v *string, err error)

OldSendID returns the old "send_id" field's value of the Block entity. If the Block 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 (*BlockMutation) OldSubtype

func (m *BlockMutation) OldSubtype(ctx context.Context) (v string, err error)

OldSubtype returns the old "subtype" field's value of the Block entity. If the Block 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 (*BlockMutation) Op

func (m *BlockMutation) Op() Op

Op returns the operation name.

func (*BlockMutation) RemovedEdges

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

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

func (*BlockMutation) RemovedIDs

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

func (m *BlockMutation) ResetAccount()

ResetAccount resets all changes to the "account" edge.

func (*BlockMutation) ResetAccountID

func (m *BlockMutation) ResetAccountID()

ResetAccountID resets all changes to the "account_id" field.

func (*BlockMutation) ResetBlock

func (m *BlockMutation) ResetBlock()

ResetBlock resets all changes to the "block" field.

func (*BlockMutation) ResetBlockHash

func (m *BlockMutation) ResetBlockHash()

ResetBlockHash resets all changes to the "block_hash" field.

func (*BlockMutation) ResetCreatedAt

func (m *BlockMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*BlockMutation) ResetEdge

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

func (m *BlockMutation) 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 (*BlockMutation) ResetSendID

func (m *BlockMutation) ResetSendID()

ResetSendID resets all changes to the "send_id" field.

func (*BlockMutation) ResetSubtype

func (m *BlockMutation) ResetSubtype()

ResetSubtype resets all changes to the "subtype" field.

func (*BlockMutation) SendID

func (m *BlockMutation) SendID() (r string, exists bool)

SendID returns the value of the "send_id" field in the mutation.

func (*BlockMutation) SendIDCleared

func (m *BlockMutation) SendIDCleared() bool

SendIDCleared returns if the "send_id" field was cleared in this mutation.

func (*BlockMutation) SetAccountID

func (m *BlockMutation) SetAccountID(u uuid.UUID)

SetAccountID sets the "account_id" field.

func (*BlockMutation) SetBlock

func (m *BlockMutation) SetBlock(value map[string]interface{})

SetBlock sets the "block" field.

func (*BlockMutation) SetBlockHash

func (m *BlockMutation) SetBlockHash(s string)

SetBlockHash sets the "block_hash" field.

func (*BlockMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BlockMutation) SetField

func (m *BlockMutation) 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 (*BlockMutation) SetID

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

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

func (*BlockMutation) SetSendID

func (m *BlockMutation) SetSendID(s string)

SetSendID sets the "send_id" field.

func (*BlockMutation) SetSubtype

func (m *BlockMutation) SetSubtype(s string)

SetSubtype sets the "subtype" field.

func (*BlockMutation) Subtype

func (m *BlockMutation) Subtype() (r string, exists bool)

Subtype returns the value of the "subtype" field in the mutation.

func (BlockMutation) Tx

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

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

func (*BlockMutation) Type

func (m *BlockMutation) Type() string

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

func (*BlockMutation) Where

func (m *BlockMutation) Where(ps ...predicate.Block)

Where appends a list predicates to the BlockMutation builder.

type BlockQuery

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

BlockQuery is the builder for querying Block entities.

func (*BlockQuery) All

func (bq *BlockQuery) All(ctx context.Context) ([]*Block, error)

All executes the query and returns a list of Blocks.

func (*BlockQuery) AllX

func (bq *BlockQuery) AllX(ctx context.Context) []*Block

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

func (*BlockQuery) Clone

func (bq *BlockQuery) Clone() *BlockQuery

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

func (*BlockQuery) Count

func (bq *BlockQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BlockQuery) CountX

func (bq *BlockQuery) CountX(ctx context.Context) int

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

func (*BlockQuery) Exist

func (bq *BlockQuery) Exist(ctx context.Context) (bool, error)

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

func (*BlockQuery) ExistX

func (bq *BlockQuery) ExistX(ctx context.Context) bool

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

func (*BlockQuery) First

func (bq *BlockQuery) First(ctx context.Context) (*Block, error)

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

func (*BlockQuery) FirstID

func (bq *BlockQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*BlockQuery) FirstIDX

func (bq *BlockQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*BlockQuery) FirstX

func (bq *BlockQuery) FirstX(ctx context.Context) *Block

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

func (*BlockQuery) GroupBy

func (bq *BlockQuery) GroupBy(field string, fields ...string) *BlockGroupBy

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 {
	AccountID uuid.UUID `json:"account_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Block.Query().
	GroupBy(block.FieldAccountID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BlockQuery) IDs

func (bq *BlockQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*BlockQuery) IDsX

func (bq *BlockQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*BlockQuery) Limit

func (bq *BlockQuery) Limit(limit int) *BlockQuery

Limit adds a limit step to the query.

func (*BlockQuery) Offset

func (bq *BlockQuery) Offset(offset int) *BlockQuery

Offset adds an offset step to the query.

func (*BlockQuery) Only

func (bq *BlockQuery) Only(ctx context.Context) (*Block, error)

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

func (*BlockQuery) OnlyID

func (bq *BlockQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

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

func (*BlockQuery) OnlyIDX

func (bq *BlockQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*BlockQuery) OnlyX

func (bq *BlockQuery) OnlyX(ctx context.Context) *Block

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

func (*BlockQuery) Order

func (bq *BlockQuery) Order(o ...OrderFunc) *BlockQuery

Order adds an order step to the query.

func (*BlockQuery) QueryAccount

func (bq *BlockQuery) QueryAccount() *AccountQuery

QueryAccount chains the current query on the "account" edge.

func (*BlockQuery) Select

func (bq *BlockQuery) Select(fields ...string) *BlockSelect

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 {
	AccountID uuid.UUID `json:"account_id,omitempty"`
}

client.Block.Query().
	Select(block.FieldAccountID).
	Scan(ctx, &v)

func (*BlockQuery) Unique

func (bq *BlockQuery) Unique(unique bool) *BlockQuery

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

func (bq *BlockQuery) Where(ps ...predicate.Block) *BlockQuery

Where adds a new predicate for the BlockQuery builder.

func (*BlockQuery) WithAccount

func (bq *BlockQuery) WithAccount(opts ...func(*AccountQuery)) *BlockQuery

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

type BlockSelect

type BlockSelect struct {
	*BlockQuery
	// contains filtered or unexported fields
}

BlockSelect is the builder for selecting fields of Block entities.

func (*BlockSelect) Bool

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

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

func (*BlockSelect) BoolX

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

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

func (*BlockSelect) Bools

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

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

func (*BlockSelect) BoolsX

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

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

func (*BlockSelect) Float64

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

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

func (*BlockSelect) Float64X

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

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

func (*BlockSelect) Float64s

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

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

func (*BlockSelect) Float64sX

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

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

func (*BlockSelect) Int

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

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

func (*BlockSelect) IntX

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

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

func (*BlockSelect) Ints

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

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

func (*BlockSelect) IntsX

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

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

func (*BlockSelect) Scan

func (bs *BlockSelect) Scan(ctx context.Context, v interface{}) error

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

func (*BlockSelect) ScanX

func (s *BlockSelect) ScanX(ctx context.Context, v interface{})

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

func (*BlockSelect) String

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

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

func (*BlockSelect) StringX

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

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

func (*BlockSelect) Strings

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

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

func (*BlockSelect) StringsX

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

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

type BlockUpdate

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

BlockUpdate is the builder for updating Block entities.

func (*BlockUpdate) ClearAccount

func (bu *BlockUpdate) ClearAccount() *BlockUpdate

ClearAccount clears the "account" edge to the Account entity.

func (*BlockUpdate) ClearAccountID

func (bu *BlockUpdate) ClearAccountID() *BlockUpdate

ClearAccountID clears the value of the "account_id" field.

func (*BlockUpdate) Exec

func (bu *BlockUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BlockUpdate) ExecX

func (bu *BlockUpdate) ExecX(ctx context.Context)

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

func (*BlockUpdate) Mutation

func (bu *BlockUpdate) Mutation() *BlockMutation

Mutation returns the BlockMutation object of the builder.

func (*BlockUpdate) Save

func (bu *BlockUpdate) Save(ctx context.Context) (int, error)

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

func (*BlockUpdate) SaveX

func (bu *BlockUpdate) SaveX(ctx context.Context) int

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

func (*BlockUpdate) SetAccount

func (bu *BlockUpdate) SetAccount(a *Account) *BlockUpdate

SetAccount sets the "account" edge to the Account entity.

func (*BlockUpdate) SetAccountID

func (bu *BlockUpdate) SetAccountID(u uuid.UUID) *BlockUpdate

SetAccountID sets the "account_id" field.

func (*BlockUpdate) SetNillableAccountID

func (bu *BlockUpdate) SetNillableAccountID(u *uuid.UUID) *BlockUpdate

SetNillableAccountID sets the "account_id" field if the given value is not nil.

func (*BlockUpdate) SetSubtype

func (bu *BlockUpdate) SetSubtype(s string) *BlockUpdate

SetSubtype sets the "subtype" field.

func (*BlockUpdate) Where

func (bu *BlockUpdate) Where(ps ...predicate.Block) *BlockUpdate

Where appends a list predicates to the BlockUpdate builder.

type BlockUpdateOne

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

BlockUpdateOne is the builder for updating a single Block entity.

func (*BlockUpdateOne) ClearAccount

func (buo *BlockUpdateOne) ClearAccount() *BlockUpdateOne

ClearAccount clears the "account" edge to the Account entity.

func (*BlockUpdateOne) ClearAccountID

func (buo *BlockUpdateOne) ClearAccountID() *BlockUpdateOne

ClearAccountID clears the value of the "account_id" field.

func (*BlockUpdateOne) Exec

func (buo *BlockUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BlockUpdateOne) ExecX

func (buo *BlockUpdateOne) ExecX(ctx context.Context)

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

func (*BlockUpdateOne) Mutation

func (buo *BlockUpdateOne) Mutation() *BlockMutation

Mutation returns the BlockMutation object of the builder.

func (*BlockUpdateOne) Save

func (buo *BlockUpdateOne) Save(ctx context.Context) (*Block, error)

Save executes the query and returns the updated Block entity.

func (*BlockUpdateOne) SaveX

func (buo *BlockUpdateOne) SaveX(ctx context.Context) *Block

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

func (*BlockUpdateOne) Select

func (buo *BlockUpdateOne) Select(field string, fields ...string) *BlockUpdateOne

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

func (*BlockUpdateOne) SetAccount

func (buo *BlockUpdateOne) SetAccount(a *Account) *BlockUpdateOne

SetAccount sets the "account" edge to the Account entity.

func (*BlockUpdateOne) SetAccountID

func (buo *BlockUpdateOne) SetAccountID(u uuid.UUID) *BlockUpdateOne

SetAccountID sets the "account_id" field.

func (*BlockUpdateOne) SetNillableAccountID

func (buo *BlockUpdateOne) SetNillableAccountID(u *uuid.UUID) *BlockUpdateOne

SetNillableAccountID sets the "account_id" field if the given value is not nil.

func (*BlockUpdateOne) SetSubtype

func (buo *BlockUpdateOne) SetSubtype(s string) *BlockUpdateOne

SetSubtype sets the "subtype" field.

type Blocks

type Blocks []*Block

Blocks is a parsable slice of Block.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Account is the client for interacting with the Account builders.
	Account *AccountClient
	// Block is the client for interacting with the Block builders.
	Block *BlockClient
	// 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().
	Account.
	Query().
	Count(ctx)

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

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

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type Policy

type Policy = ent.Policy

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

type Query

type Query = ent.Query

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

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type Tx

type Tx struct {

	// Account is the client for interacting with the Account builders.
	Account *AccountClient
	// Block is the client for interacting with the Block builders.
	Block *BlockClient
	// 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 uuid.UUID `json:"id,omitempty"`
	// Seed holds the value of the "seed" field.
	Seed string `json:"seed,omitempty"`
	// Representative holds the value of the "representative" field.
	Representative *string `json:"representative,omitempty"`
	// Encrypted holds the value of the "encrypted" field.
	Encrypted bool `json:"encrypted,omitempty"`
	// Work holds the value of the "work" field.
	Work bool `json:"work,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the WalletQuery when eager-loading is set.
	Edges WalletEdges `json:"edges"`
	// contains filtered or unexported fields
}

Wallet is the model entity for the Wallet schema.

func (*Wallet) QueryAccounts

func (w *Wallet) QueryAccounts() *AccountQuery

QueryAccounts queries the "accounts" edge of the Wallet entity.

func (*Wallet) String

func (w *Wallet) String() string

String implements the fmt.Stringer.

func (*Wallet) Unwrap

func (w *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 (w *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.

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(w *Wallet) *WalletDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*WalletClient) DeleteOneID

func (c *WalletClient) DeleteOneID(id uuid.UUID) *WalletDeleteOne

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

func (*WalletClient) Get

func (c *WalletClient) Get(ctx context.Context, id uuid.UUID) (*Wallet, error)

Get returns a Wallet entity by its id.

func (*WalletClient) GetX

func (c *WalletClient) GetX(ctx context.Context, id uuid.UUID) *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) Query

func (c *WalletClient) Query() *WalletQuery

Query returns a query builder for Wallet.

func (*WalletClient) QueryAccounts

func (c *WalletClient) QueryAccounts(w *Wallet) *AccountQuery

QueryAccounts queries the accounts edge of a Wallet.

func (*WalletClient) Update

func (c *WalletClient) Update() *WalletUpdate

Update returns an update builder for Wallet.

func (*WalletClient) UpdateOne

func (c *WalletClient) UpdateOne(w *Wallet) *WalletUpdateOne

UpdateOne returns an update builder for the given entity.

func (*WalletClient) UpdateOneID

func (c *WalletClient) UpdateOneID(id uuid.UUID) *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) AddAccountIDs

func (wc *WalletCreate) AddAccountIDs(ids ...uuid.UUID) *WalletCreate

AddAccountIDs adds the "accounts" edge to the Account entity by IDs.

func (*WalletCreate) AddAccounts

func (wc *WalletCreate) AddAccounts(a ...*Account) *WalletCreate

AddAccounts adds the "accounts" edges to the Account entity.

func (*WalletCreate) Exec

func (wc *WalletCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*WalletCreate) ExecX

func (wc *WalletCreate) ExecX(ctx context.Context)

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

func (*WalletCreate) Mutation

func (wc *WalletCreate) Mutation() *WalletMutation

Mutation returns the WalletMutation object of the builder.

func (*WalletCreate) Save

func (wc *WalletCreate) Save(ctx context.Context) (*Wallet, error)

Save creates the Wallet in the database.

func (*WalletCreate) SaveX

func (wc *WalletCreate) SaveX(ctx context.Context) *Wallet

SaveX calls Save and panics if Save returns an error.

func (*WalletCreate) SetCreatedAt

func (wc *WalletCreate) SetCreatedAt(t time.Time) *WalletCreate

SetCreatedAt sets the "created_at" field.

func (*WalletCreate) SetEncrypted

func (wc *WalletCreate) SetEncrypted(b bool) *WalletCreate

SetEncrypted sets the "encrypted" field.

func (*WalletCreate) SetID

func (wc *WalletCreate) SetID(u uuid.UUID) *WalletCreate

SetID sets the "id" field.

func (*WalletCreate) SetNillableCreatedAt

func (wc *WalletCreate) SetNillableCreatedAt(t *time.Time) *WalletCreate

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

func (*WalletCreate) SetNillableEncrypted

func (wc *WalletCreate) SetNillableEncrypted(b *bool) *WalletCreate

SetNillableEncrypted sets the "encrypted" field if the given value is not nil.

func (*WalletCreate) SetNillableID

func (wc *WalletCreate) SetNillableID(u *uuid.UUID) *WalletCreate

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

func (*WalletCreate) SetNillableRepresentative

func (wc *WalletCreate) SetNillableRepresentative(s *string) *WalletCreate

SetNillableRepresentative sets the "representative" field if the given value is not nil.

func (*WalletCreate) SetNillableWork

func (wc *WalletCreate) SetNillableWork(b *bool) *WalletCreate

SetNillableWork sets the "work" field if the given value is not nil.

func (*WalletCreate) SetRepresentative

func (wc *WalletCreate) SetRepresentative(s string) *WalletCreate

SetRepresentative sets the "representative" field.

func (*WalletCreate) SetSeed

func (wc *WalletCreate) SetSeed(s string) *WalletCreate

SetSeed sets the "seed" field.

func (*WalletCreate) SetWork

func (wc *WalletCreate) SetWork(b bool) *WalletCreate

SetWork sets the "work" 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 (wcb *WalletCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*WalletCreateBulk) ExecX

func (wcb *WalletCreateBulk) ExecX(ctx context.Context)

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

func (*WalletCreateBulk) Save

func (wcb *WalletCreateBulk) Save(ctx context.Context) ([]*Wallet, error)

Save creates the Wallet entities in the database.

func (*WalletCreateBulk) SaveX

func (wcb *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 (wd *WalletDelete) Exec(ctx context.Context) (int, error)

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

func (*WalletDelete) ExecX

func (wd *WalletDelete) ExecX(ctx context.Context) int

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

func (*WalletDelete) Where

func (wd *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 (wdo *WalletDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*WalletDeleteOne) ExecX

func (wdo *WalletDeleteOne) ExecX(ctx context.Context)

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

type WalletEdges

type WalletEdges struct {
	// Accounts holds the value of the accounts edge.
	Accounts []*Account `json:"accounts,omitempty"`
	// contains filtered or unexported fields
}

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

func (WalletEdges) AccountsOrErr

func (e WalletEdges) AccountsOrErr() ([]*Account, error)

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

type WalletGroupBy

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

WalletGroupBy is the group-by builder for Wallet entities.

func (*WalletGroupBy) Aggregate

func (wgb *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 (wgb *WalletGroupBy) Scan(ctx context.Context, v interface{}) error

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

func (*WalletGroupBy) ScanX

func (s *WalletGroupBy) ScanX(ctx context.Context, v interface{})

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

func (m *WalletMutation) AccountsCleared() bool

AccountsCleared reports if the "accounts" edge to the Account entity was cleared.

func (*WalletMutation) AccountsIDs

func (m *WalletMutation) AccountsIDs() (ids []uuid.UUID)

AccountsIDs returns the "accounts" edge IDs in the mutation.

func (*WalletMutation) AddAccountIDs

func (m *WalletMutation) AddAccountIDs(ids ...uuid.UUID)

AddAccountIDs adds the "accounts" edge to the Account entity by ids.

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

func (m *WalletMutation) ClearAccounts()

ClearAccounts clears the "accounts" edge to the Account entity.

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

func (m *WalletMutation) ClearRepresentative()

ClearRepresentative clears the value of the "representative" field.

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

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

CreatedAt returns the value of the "created_at" 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) Encrypted

func (m *WalletMutation) Encrypted() (r bool, exists bool)

Encrypted returns the value of the "encrypted" field in the 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 uuid.UUID, exists bool)

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

func (*WalletMutation) IDs

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

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

func (*WalletMutation) OldCreatedAt

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

OldCreatedAt returns the old "created_at" 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) OldEncrypted

func (m *WalletMutation) OldEncrypted(ctx context.Context) (v bool, err error)

OldEncrypted returns the old "encrypted" 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) OldRepresentative

func (m *WalletMutation) OldRepresentative(ctx context.Context) (v *string, err error)

OldRepresentative returns the old "representative" 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) OldSeed

func (m *WalletMutation) OldSeed(ctx context.Context) (v string, err error)

OldSeed returns the old "seed" 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) OldWork

func (m *WalletMutation) OldWork(ctx context.Context) (v bool, err error)

OldWork returns the old "work" 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) RemoveAccountIDs

func (m *WalletMutation) RemoveAccountIDs(ids ...uuid.UUID)

RemoveAccountIDs removes the "accounts" edge to the Account entity by IDs.

func (*WalletMutation) RemovedAccountsIDs

func (m *WalletMutation) RemovedAccountsIDs() (ids []uuid.UUID)

RemovedAccounts returns the removed IDs of the "accounts" edge to the Account entity.

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

func (m *WalletMutation) Representative() (r string, exists bool)

Representative returns the value of the "representative" field in the mutation.

func (*WalletMutation) RepresentativeCleared

func (m *WalletMutation) RepresentativeCleared() bool

RepresentativeCleared returns if the "representative" field was cleared in this mutation.

func (*WalletMutation) ResetAccounts

func (m *WalletMutation) ResetAccounts()

ResetAccounts resets all changes to the "accounts" edge.

func (*WalletMutation) ResetCreatedAt

func (m *WalletMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" 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) ResetEncrypted

func (m *WalletMutation) ResetEncrypted()

ResetEncrypted resets all changes to the "encrypted" field.

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

func (m *WalletMutation) ResetRepresentative()

ResetRepresentative resets all changes to the "representative" field.

func (*WalletMutation) ResetSeed

func (m *WalletMutation) ResetSeed()

ResetSeed resets all changes to the "seed" field.

func (*WalletMutation) ResetWork

func (m *WalletMutation) ResetWork()

ResetWork resets all changes to the "work" field.

func (*WalletMutation) Seed

func (m *WalletMutation) Seed() (r string, exists bool)

Seed returns the value of the "seed" field in the mutation.

func (*WalletMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*WalletMutation) SetEncrypted

func (m *WalletMutation) SetEncrypted(b bool)

SetEncrypted sets the "encrypted" 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) SetID

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

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

func (*WalletMutation) SetRepresentative

func (m *WalletMutation) SetRepresentative(s string)

SetRepresentative sets the "representative" field.

func (*WalletMutation) SetSeed

func (m *WalletMutation) SetSeed(s string)

SetSeed sets the "seed" field.

func (*WalletMutation) SetWork

func (m *WalletMutation) SetWork(b bool)

SetWork sets the "work" 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) Where

func (m *WalletMutation) Where(ps ...predicate.Wallet)

Where appends a list predicates to the WalletMutation builder.

func (*WalletMutation) Work

func (m *WalletMutation) Work() (r bool, exists bool)

Work returns the value of the "work" field in the mutation.

type WalletQuery

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

WalletQuery is the builder for querying Wallet entities.

func (*WalletQuery) All

func (wq *WalletQuery) All(ctx context.Context) ([]*Wallet, error)

All executes the query and returns a list of Wallets.

func (*WalletQuery) AllX

func (wq *WalletQuery) AllX(ctx context.Context) []*Wallet

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

func (*WalletQuery) Clone

func (wq *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 (wq *WalletQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*WalletQuery) CountX

func (wq *WalletQuery) CountX(ctx context.Context) int

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

func (*WalletQuery) Exist

func (wq *WalletQuery) Exist(ctx context.Context) (bool, error)

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

func (*WalletQuery) ExistX

func (wq *WalletQuery) ExistX(ctx context.Context) bool

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

func (*WalletQuery) First

func (wq *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 (wq *WalletQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

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

func (*WalletQuery) FirstIDX

func (wq *WalletQuery) FirstIDX(ctx context.Context) uuid.UUID

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

func (*WalletQuery) FirstX

func (wq *WalletQuery) FirstX(ctx context.Context) *Wallet

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

func (*WalletQuery) GroupBy

func (wq *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 {
	Seed string `json:"seed,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Wallet.Query().
	GroupBy(wallet.FieldSeed).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*WalletQuery) IDs

func (wq *WalletQuery) IDs(ctx context.Context) ([]uuid.UUID, error)

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

func (*WalletQuery) IDsX

func (wq *WalletQuery) IDsX(ctx context.Context) []uuid.UUID

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

func (*WalletQuery) Limit

func (wq *WalletQuery) Limit(limit int) *WalletQuery

Limit adds a limit step to the query.

func (*WalletQuery) Offset

func (wq *WalletQuery) Offset(offset int) *WalletQuery

Offset adds an offset step to the query.

func (*WalletQuery) Only

func (wq *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 (wq *WalletQuery) OnlyID(ctx context.Context) (id uuid.UUID, 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 (wq *WalletQuery) OnlyIDX(ctx context.Context) uuid.UUID

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

func (*WalletQuery) OnlyX

func (wq *WalletQuery) OnlyX(ctx context.Context) *Wallet

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

func (*WalletQuery) Order

func (wq *WalletQuery) Order(o ...OrderFunc) *WalletQuery

Order adds an order step to the query.

func (*WalletQuery) QueryAccounts

func (wq *WalletQuery) QueryAccounts() *AccountQuery

QueryAccounts chains the current query on the "accounts" edge.

func (*WalletQuery) Select

func (wq *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 {
	Seed string `json:"seed,omitempty"`
}

client.Wallet.Query().
	Select(wallet.FieldSeed).
	Scan(ctx, &v)

func (*WalletQuery) Unique

func (wq *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 (wq *WalletQuery) Where(ps ...predicate.Wallet) *WalletQuery

Where adds a new predicate for the WalletQuery builder.

func (*WalletQuery) WithAccounts

func (wq *WalletQuery) WithAccounts(opts ...func(*AccountQuery)) *WalletQuery

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

type WalletSelect

type WalletSelect struct {
	*WalletQuery
	// contains filtered or unexported fields
}

WalletSelect is the builder for selecting fields of Wallet entities.

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 (ws *WalletSelect) Scan(ctx context.Context, v interface{}) 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 interface{})

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

func (wu *WalletUpdate) AddAccountIDs(ids ...uuid.UUID) *WalletUpdate

AddAccountIDs adds the "accounts" edge to the Account entity by IDs.

func (*WalletUpdate) AddAccounts

func (wu *WalletUpdate) AddAccounts(a ...*Account) *WalletUpdate

AddAccounts adds the "accounts" edges to the Account entity.

func (*WalletUpdate) ClearAccounts

func (wu *WalletUpdate) ClearAccounts() *WalletUpdate

ClearAccounts clears all "accounts" edges to the Account entity.

func (*WalletUpdate) ClearRepresentative

func (wu *WalletUpdate) ClearRepresentative() *WalletUpdate

ClearRepresentative clears the value of the "representative" field.

func (*WalletUpdate) Exec

func (wu *WalletUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*WalletUpdate) ExecX

func (wu *WalletUpdate) ExecX(ctx context.Context)

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

func (*WalletUpdate) Mutation

func (wu *WalletUpdate) Mutation() *WalletMutation

Mutation returns the WalletMutation object of the builder.

func (*WalletUpdate) RemoveAccountIDs

func (wu *WalletUpdate) RemoveAccountIDs(ids ...uuid.UUID) *WalletUpdate

RemoveAccountIDs removes the "accounts" edge to Account entities by IDs.

func (*WalletUpdate) RemoveAccounts

func (wu *WalletUpdate) RemoveAccounts(a ...*Account) *WalletUpdate

RemoveAccounts removes "accounts" edges to Account entities.

func (*WalletUpdate) Save

func (wu *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 (wu *WalletUpdate) SaveX(ctx context.Context) int

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

func (*WalletUpdate) SetEncrypted

func (wu *WalletUpdate) SetEncrypted(b bool) *WalletUpdate

SetEncrypted sets the "encrypted" field.

func (*WalletUpdate) SetNillableEncrypted

func (wu *WalletUpdate) SetNillableEncrypted(b *bool) *WalletUpdate

SetNillableEncrypted sets the "encrypted" field if the given value is not nil.

func (*WalletUpdate) SetNillableRepresentative

func (wu *WalletUpdate) SetNillableRepresentative(s *string) *WalletUpdate

SetNillableRepresentative sets the "representative" field if the given value is not nil.

func (*WalletUpdate) SetNillableWork

func (wu *WalletUpdate) SetNillableWork(b *bool) *WalletUpdate

SetNillableWork sets the "work" field if the given value is not nil.

func (*WalletUpdate) SetRepresentative

func (wu *WalletUpdate) SetRepresentative(s string) *WalletUpdate

SetRepresentative sets the "representative" field.

func (*WalletUpdate) SetSeed

func (wu *WalletUpdate) SetSeed(s string) *WalletUpdate

SetSeed sets the "seed" field.

func (*WalletUpdate) SetWork

func (wu *WalletUpdate) SetWork(b bool) *WalletUpdate

SetWork sets the "work" field.

func (*WalletUpdate) Where

func (wu *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) AddAccountIDs

func (wuo *WalletUpdateOne) AddAccountIDs(ids ...uuid.UUID) *WalletUpdateOne

AddAccountIDs adds the "accounts" edge to the Account entity by IDs.

func (*WalletUpdateOne) AddAccounts

func (wuo *WalletUpdateOne) AddAccounts(a ...*Account) *WalletUpdateOne

AddAccounts adds the "accounts" edges to the Account entity.

func (*WalletUpdateOne) ClearAccounts

func (wuo *WalletUpdateOne) ClearAccounts() *WalletUpdateOne

ClearAccounts clears all "accounts" edges to the Account entity.

func (*WalletUpdateOne) ClearRepresentative

func (wuo *WalletUpdateOne) ClearRepresentative() *WalletUpdateOne

ClearRepresentative clears the value of the "representative" field.

func (*WalletUpdateOne) Exec

func (wuo *WalletUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*WalletUpdateOne) ExecX

func (wuo *WalletUpdateOne) ExecX(ctx context.Context)

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

func (*WalletUpdateOne) Mutation

func (wuo *WalletUpdateOne) Mutation() *WalletMutation

Mutation returns the WalletMutation object of the builder.

func (*WalletUpdateOne) RemoveAccountIDs

func (wuo *WalletUpdateOne) RemoveAccountIDs(ids ...uuid.UUID) *WalletUpdateOne

RemoveAccountIDs removes the "accounts" edge to Account entities by IDs.

func (*WalletUpdateOne) RemoveAccounts

func (wuo *WalletUpdateOne) RemoveAccounts(a ...*Account) *WalletUpdateOne

RemoveAccounts removes "accounts" edges to Account entities.

func (*WalletUpdateOne) Save

func (wuo *WalletUpdateOne) Save(ctx context.Context) (*Wallet, error)

Save executes the query and returns the updated Wallet entity.

func (*WalletUpdateOne) SaveX

func (wuo *WalletUpdateOne) SaveX(ctx context.Context) *Wallet

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

func (*WalletUpdateOne) Select

func (wuo *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) SetEncrypted

func (wuo *WalletUpdateOne) SetEncrypted(b bool) *WalletUpdateOne

SetEncrypted sets the "encrypted" field.

func (*WalletUpdateOne) SetNillableEncrypted

func (wuo *WalletUpdateOne) SetNillableEncrypted(b *bool) *WalletUpdateOne

SetNillableEncrypted sets the "encrypted" field if the given value is not nil.

func (*WalletUpdateOne) SetNillableRepresentative

func (wuo *WalletUpdateOne) SetNillableRepresentative(s *string) *WalletUpdateOne

SetNillableRepresentative sets the "representative" field if the given value is not nil.

func (*WalletUpdateOne) SetNillableWork

func (wuo *WalletUpdateOne) SetNillableWork(b *bool) *WalletUpdateOne

SetNillableWork sets the "work" field if the given value is not nil.

func (*WalletUpdateOne) SetRepresentative

func (wuo *WalletUpdateOne) SetRepresentative(s string) *WalletUpdateOne

SetRepresentative sets the "representative" field.

func (*WalletUpdateOne) SetSeed

func (wuo *WalletUpdateOne) SetSeed(s string) *WalletUpdateOne

SetSeed sets the "seed" field.

func (*WalletUpdateOne) SetWork

func (wuo *WalletUpdateOne) SetWork(b bool) *WalletUpdateOne

SetWork sets the "work" field.

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