Documentation ¶
Index ¶
- Constants
- func IsConstraintError(err error) bool
- func IsNotFound(err error) bool
- func IsNotLoaded(err error) bool
- func IsNotSingular(err error) bool
- func IsValidationError(err error) bool
- func MaskNotFound(err error) error
- func NewContext(parent context.Context, c *Client) context.Context
- func NewTxContext(parent context.Context, tx *Tx) context.Context
- type Account
- type AccountClient
- func (c *AccountClient) Create() *AccountCreate
- func (c *AccountClient) CreateBulk(builders ...*AccountCreate) *AccountCreateBulk
- func (c *AccountClient) Delete() *AccountDelete
- func (c *AccountClient) DeleteOne(a *Account) *AccountDeleteOne
- func (c *AccountClient) DeleteOneID(id uuid.UUID) *AccountDeleteOne
- func (c *AccountClient) Get(ctx context.Context, id uuid.UUID) (*Account, error)
- func (c *AccountClient) GetX(ctx context.Context, id uuid.UUID) *Account
- func (c *AccountClient) Hooks() []Hook
- func (c *AccountClient) Query() *AccountQuery
- func (c *AccountClient) QueryBlocks(a *Account) *BlockQuery
- func (c *AccountClient) QueryWallet(a *Account) *WalletQuery
- func (c *AccountClient) Update() *AccountUpdate
- func (c *AccountClient) UpdateOne(a *Account) *AccountUpdateOne
- func (c *AccountClient) UpdateOneID(id uuid.UUID) *AccountUpdateOne
- func (c *AccountClient) Use(hooks ...Hook)
- type AccountCreate
- func (ac *AccountCreate) AddBlockIDs(ids ...uuid.UUID) *AccountCreate
- func (ac *AccountCreate) AddBlocks(b ...*Block) *AccountCreate
- func (ac *AccountCreate) Exec(ctx context.Context) error
- func (ac *AccountCreate) ExecX(ctx context.Context)
- func (ac *AccountCreate) Mutation() *AccountMutation
- func (ac *AccountCreate) Save(ctx context.Context) (*Account, error)
- func (ac *AccountCreate) SaveX(ctx context.Context) *Account
- func (ac *AccountCreate) SetAccountIndex(i int) *AccountCreate
- func (ac *AccountCreate) SetAddress(s string) *AccountCreate
- func (ac *AccountCreate) SetCreatedAt(t time.Time) *AccountCreate
- func (ac *AccountCreate) SetID(u uuid.UUID) *AccountCreate
- func (ac *AccountCreate) SetNillableAccountIndex(i *int) *AccountCreate
- func (ac *AccountCreate) SetNillableCreatedAt(t *time.Time) *AccountCreate
- func (ac *AccountCreate) SetNillableID(u *uuid.UUID) *AccountCreate
- func (ac *AccountCreate) SetNillablePrivateKey(s *string) *AccountCreate
- func (ac *AccountCreate) SetNillableWork(b *bool) *AccountCreate
- func (ac *AccountCreate) SetPrivateKey(s string) *AccountCreate
- func (ac *AccountCreate) SetWallet(w *Wallet) *AccountCreate
- func (ac *AccountCreate) SetWalletID(u uuid.UUID) *AccountCreate
- func (ac *AccountCreate) SetWork(b bool) *AccountCreate
- type AccountCreateBulk
- type AccountDelete
- type AccountDeleteOne
- type AccountEdges
- type AccountGroupBy
- func (agb *AccountGroupBy) Aggregate(fns ...AggregateFunc) *AccountGroupBy
- func (s *AccountGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccountGroupBy) BoolX(ctx context.Context) bool
- func (s *AccountGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *AccountGroupBy) BoolsX(ctx context.Context) []bool
- func (s *AccountGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccountGroupBy) Float64X(ctx context.Context) float64
- func (s *AccountGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccountGroupBy) Float64sX(ctx context.Context) []float64
- func (s *AccountGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *AccountGroupBy) IntX(ctx context.Context) int
- func (s *AccountGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *AccountGroupBy) IntsX(ctx context.Context) []int
- func (agb *AccountGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *AccountGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *AccountGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *AccountGroupBy) StringX(ctx context.Context) string
- func (s *AccountGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *AccountGroupBy) StringsX(ctx context.Context) []string
- type AccountMutation
- func (m *AccountMutation) AccountIndex() (r int, exists bool)
- func (m *AccountMutation) AccountIndexCleared() bool
- func (m *AccountMutation) AddAccountIndex(i int)
- func (m *AccountMutation) AddBlockIDs(ids ...uuid.UUID)
- func (m *AccountMutation) AddField(name string, value ent.Value) error
- func (m *AccountMutation) AddedAccountIndex() (r int, exists bool)
- func (m *AccountMutation) AddedEdges() []string
- func (m *AccountMutation) AddedField(name string) (ent.Value, bool)
- func (m *AccountMutation) AddedFields() []string
- func (m *AccountMutation) AddedIDs(name string) []ent.Value
- func (m *AccountMutation) Address() (r string, exists bool)
- func (m *AccountMutation) BlocksCleared() bool
- func (m *AccountMutation) BlocksIDs() (ids []uuid.UUID)
- func (m *AccountMutation) ClearAccountIndex()
- func (m *AccountMutation) ClearBlocks()
- func (m *AccountMutation) ClearEdge(name string) error
- func (m *AccountMutation) ClearField(name string) error
- func (m *AccountMutation) ClearPrivateKey()
- func (m *AccountMutation) ClearWallet()
- func (m *AccountMutation) ClearedEdges() []string
- func (m *AccountMutation) ClearedFields() []string
- func (m AccountMutation) Client() *Client
- func (m *AccountMutation) CreatedAt() (r time.Time, exists bool)
- func (m *AccountMutation) EdgeCleared(name string) bool
- func (m *AccountMutation) Field(name string) (ent.Value, bool)
- func (m *AccountMutation) FieldCleared(name string) bool
- func (m *AccountMutation) Fields() []string
- func (m *AccountMutation) ID() (id uuid.UUID, exists bool)
- func (m *AccountMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *AccountMutation) OldAccountIndex(ctx context.Context) (v *int, err error)
- func (m *AccountMutation) OldAddress(ctx context.Context) (v string, err error)
- func (m *AccountMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *AccountMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *AccountMutation) OldPrivateKey(ctx context.Context) (v *string, err error)
- func (m *AccountMutation) OldWalletID(ctx context.Context) (v uuid.UUID, err error)
- func (m *AccountMutation) OldWork(ctx context.Context) (v bool, err error)
- func (m *AccountMutation) Op() Op
- func (m *AccountMutation) PrivateKey() (r string, exists bool)
- func (m *AccountMutation) PrivateKeyCleared() bool
- func (m *AccountMutation) RemoveBlockIDs(ids ...uuid.UUID)
- func (m *AccountMutation) RemovedBlocksIDs() (ids []uuid.UUID)
- func (m *AccountMutation) RemovedEdges() []string
- func (m *AccountMutation) RemovedIDs(name string) []ent.Value
- func (m *AccountMutation) ResetAccountIndex()
- func (m *AccountMutation) ResetAddress()
- func (m *AccountMutation) ResetBlocks()
- func (m *AccountMutation) ResetCreatedAt()
- func (m *AccountMutation) ResetEdge(name string) error
- func (m *AccountMutation) ResetField(name string) error
- func (m *AccountMutation) ResetPrivateKey()
- func (m *AccountMutation) ResetWallet()
- func (m *AccountMutation) ResetWalletID()
- func (m *AccountMutation) ResetWork()
- func (m *AccountMutation) SetAccountIndex(i int)
- func (m *AccountMutation) SetAddress(s string)
- func (m *AccountMutation) SetCreatedAt(t time.Time)
- func (m *AccountMutation) SetField(name string, value ent.Value) error
- func (m *AccountMutation) SetID(id uuid.UUID)
- func (m *AccountMutation) SetPrivateKey(s string)
- func (m *AccountMutation) SetWalletID(u uuid.UUID)
- func (m *AccountMutation) SetWork(b bool)
- func (m AccountMutation) Tx() (*Tx, error)
- func (m *AccountMutation) Type() string
- func (m *AccountMutation) WalletCleared() bool
- func (m *AccountMutation) WalletID() (r uuid.UUID, exists bool)
- func (m *AccountMutation) WalletIDs() (ids []uuid.UUID)
- func (m *AccountMutation) Where(ps ...predicate.Account)
- func (m *AccountMutation) Work() (r bool, exists bool)
- type AccountQuery
- func (aq *AccountQuery) All(ctx context.Context) ([]*Account, error)
- func (aq *AccountQuery) AllX(ctx context.Context) []*Account
- func (aq *AccountQuery) Clone() *AccountQuery
- func (aq *AccountQuery) Count(ctx context.Context) (int, error)
- func (aq *AccountQuery) CountX(ctx context.Context) int
- func (aq *AccountQuery) Exist(ctx context.Context) (bool, error)
- func (aq *AccountQuery) ExistX(ctx context.Context) bool
- func (aq *AccountQuery) First(ctx context.Context) (*Account, error)
- func (aq *AccountQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (aq *AccountQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (aq *AccountQuery) FirstX(ctx context.Context) *Account
- func (aq *AccountQuery) GroupBy(field string, fields ...string) *AccountGroupBy
- func (aq *AccountQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (aq *AccountQuery) IDsX(ctx context.Context) []uuid.UUID
- func (aq *AccountQuery) Limit(limit int) *AccountQuery
- func (aq *AccountQuery) Offset(offset int) *AccountQuery
- func (aq *AccountQuery) Only(ctx context.Context) (*Account, error)
- func (aq *AccountQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (aq *AccountQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (aq *AccountQuery) OnlyX(ctx context.Context) *Account
- func (aq *AccountQuery) Order(o ...OrderFunc) *AccountQuery
- func (aq *AccountQuery) QueryBlocks() *BlockQuery
- func (aq *AccountQuery) QueryWallet() *WalletQuery
- func (aq *AccountQuery) Select(fields ...string) *AccountSelect
- func (aq *AccountQuery) Unique(unique bool) *AccountQuery
- func (aq *AccountQuery) Where(ps ...predicate.Account) *AccountQuery
- func (aq *AccountQuery) WithBlocks(opts ...func(*BlockQuery)) *AccountQuery
- func (aq *AccountQuery) WithWallet(opts ...func(*WalletQuery)) *AccountQuery
- type AccountSelect
- func (s *AccountSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *AccountSelect) BoolX(ctx context.Context) bool
- func (s *AccountSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *AccountSelect) BoolsX(ctx context.Context) []bool
- func (s *AccountSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *AccountSelect) Float64X(ctx context.Context) float64
- func (s *AccountSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *AccountSelect) Float64sX(ctx context.Context) []float64
- func (s *AccountSelect) Int(ctx context.Context) (_ int, err error)
- func (s *AccountSelect) IntX(ctx context.Context) int
- func (s *AccountSelect) Ints(ctx context.Context) ([]int, error)
- func (s *AccountSelect) IntsX(ctx context.Context) []int
- func (as *AccountSelect) Scan(ctx context.Context, v interface{}) error
- func (s *AccountSelect) ScanX(ctx context.Context, v interface{})
- func (s *AccountSelect) String(ctx context.Context) (_ string, err error)
- func (s *AccountSelect) StringX(ctx context.Context) string
- func (s *AccountSelect) Strings(ctx context.Context) ([]string, error)
- func (s *AccountSelect) StringsX(ctx context.Context) []string
- type AccountUpdate
- func (au *AccountUpdate) AddAccountIndex(i int) *AccountUpdate
- func (au *AccountUpdate) AddBlockIDs(ids ...uuid.UUID) *AccountUpdate
- func (au *AccountUpdate) AddBlocks(b ...*Block) *AccountUpdate
- func (au *AccountUpdate) ClearAccountIndex() *AccountUpdate
- func (au *AccountUpdate) ClearBlocks() *AccountUpdate
- func (au *AccountUpdate) ClearPrivateKey() *AccountUpdate
- func (au *AccountUpdate) ClearWallet() *AccountUpdate
- func (au *AccountUpdate) Exec(ctx context.Context) error
- func (au *AccountUpdate) ExecX(ctx context.Context)
- func (au *AccountUpdate) Mutation() *AccountMutation
- func (au *AccountUpdate) RemoveBlockIDs(ids ...uuid.UUID) *AccountUpdate
- func (au *AccountUpdate) RemoveBlocks(b ...*Block) *AccountUpdate
- func (au *AccountUpdate) Save(ctx context.Context) (int, error)
- func (au *AccountUpdate) SaveX(ctx context.Context) int
- func (au *AccountUpdate) SetAccountIndex(i int) *AccountUpdate
- func (au *AccountUpdate) SetAddress(s string) *AccountUpdate
- func (au *AccountUpdate) SetNillableAccountIndex(i *int) *AccountUpdate
- func (au *AccountUpdate) SetNillablePrivateKey(s *string) *AccountUpdate
- func (au *AccountUpdate) SetNillableWork(b *bool) *AccountUpdate
- func (au *AccountUpdate) SetPrivateKey(s string) *AccountUpdate
- func (au *AccountUpdate) SetWallet(w *Wallet) *AccountUpdate
- func (au *AccountUpdate) SetWalletID(u uuid.UUID) *AccountUpdate
- func (au *AccountUpdate) SetWork(b bool) *AccountUpdate
- func (au *AccountUpdate) Where(ps ...predicate.Account) *AccountUpdate
- type AccountUpdateOne
- func (auo *AccountUpdateOne) AddAccountIndex(i int) *AccountUpdateOne
- func (auo *AccountUpdateOne) AddBlockIDs(ids ...uuid.UUID) *AccountUpdateOne
- func (auo *AccountUpdateOne) AddBlocks(b ...*Block) *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearAccountIndex() *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearBlocks() *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearPrivateKey() *AccountUpdateOne
- func (auo *AccountUpdateOne) ClearWallet() *AccountUpdateOne
- func (auo *AccountUpdateOne) Exec(ctx context.Context) error
- func (auo *AccountUpdateOne) ExecX(ctx context.Context)
- func (auo *AccountUpdateOne) Mutation() *AccountMutation
- func (auo *AccountUpdateOne) RemoveBlockIDs(ids ...uuid.UUID) *AccountUpdateOne
- func (auo *AccountUpdateOne) RemoveBlocks(b ...*Block) *AccountUpdateOne
- func (auo *AccountUpdateOne) Save(ctx context.Context) (*Account, error)
- func (auo *AccountUpdateOne) SaveX(ctx context.Context) *Account
- func (auo *AccountUpdateOne) Select(field string, fields ...string) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetAccountIndex(i int) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetAddress(s string) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetNillableAccountIndex(i *int) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetNillablePrivateKey(s *string) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetNillableWork(b *bool) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetPrivateKey(s string) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetWallet(w *Wallet) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetWalletID(u uuid.UUID) *AccountUpdateOne
- func (auo *AccountUpdateOne) SetWork(b bool) *AccountUpdateOne
- type Accounts
- type AggregateFunc
- type Block
- type BlockClient
- func (c *BlockClient) Create() *BlockCreate
- func (c *BlockClient) CreateBulk(builders ...*BlockCreate) *BlockCreateBulk
- func (c *BlockClient) Delete() *BlockDelete
- func (c *BlockClient) DeleteOne(b *Block) *BlockDeleteOne
- func (c *BlockClient) DeleteOneID(id uuid.UUID) *BlockDeleteOne
- func (c *BlockClient) Get(ctx context.Context, id uuid.UUID) (*Block, error)
- func (c *BlockClient) GetX(ctx context.Context, id uuid.UUID) *Block
- func (c *BlockClient) Hooks() []Hook
- func (c *BlockClient) Query() *BlockQuery
- func (c *BlockClient) QueryAccount(b *Block) *AccountQuery
- func (c *BlockClient) Update() *BlockUpdate
- func (c *BlockClient) UpdateOne(b *Block) *BlockUpdateOne
- func (c *BlockClient) UpdateOneID(id uuid.UUID) *BlockUpdateOne
- func (c *BlockClient) Use(hooks ...Hook)
- type BlockCreate
- func (bc *BlockCreate) Exec(ctx context.Context) error
- func (bc *BlockCreate) ExecX(ctx context.Context)
- func (bc *BlockCreate) Mutation() *BlockMutation
- func (bc *BlockCreate) Save(ctx context.Context) (*Block, error)
- func (bc *BlockCreate) SaveX(ctx context.Context) *Block
- func (bc *BlockCreate) SetAccount(a *Account) *BlockCreate
- func (bc *BlockCreate) SetAccountID(u uuid.UUID) *BlockCreate
- func (bc *BlockCreate) SetBlock(m map[string]interface{}) *BlockCreate
- func (bc *BlockCreate) SetBlockHash(s string) *BlockCreate
- func (bc *BlockCreate) SetCreatedAt(t time.Time) *BlockCreate
- func (bc *BlockCreate) SetID(u uuid.UUID) *BlockCreate
- func (bc *BlockCreate) SetNillableAccountID(u *uuid.UUID) *BlockCreate
- func (bc *BlockCreate) SetNillableCreatedAt(t *time.Time) *BlockCreate
- func (bc *BlockCreate) SetNillableID(u *uuid.UUID) *BlockCreate
- func (bc *BlockCreate) SetNillableSendID(s *string) *BlockCreate
- func (bc *BlockCreate) SetSendID(s string) *BlockCreate
- func (bc *BlockCreate) SetSubtype(s string) *BlockCreate
- type BlockCreateBulk
- type BlockDelete
- type BlockDeleteOne
- type BlockEdges
- type BlockGroupBy
- func (bgb *BlockGroupBy) Aggregate(fns ...AggregateFunc) *BlockGroupBy
- func (s *BlockGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *BlockGroupBy) BoolX(ctx context.Context) bool
- func (s *BlockGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *BlockGroupBy) BoolsX(ctx context.Context) []bool
- func (s *BlockGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *BlockGroupBy) Float64X(ctx context.Context) float64
- func (s *BlockGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *BlockGroupBy) Float64sX(ctx context.Context) []float64
- func (s *BlockGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *BlockGroupBy) IntX(ctx context.Context) int
- func (s *BlockGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *BlockGroupBy) IntsX(ctx context.Context) []int
- func (bgb *BlockGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *BlockGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *BlockGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *BlockGroupBy) StringX(ctx context.Context) string
- func (s *BlockGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *BlockGroupBy) StringsX(ctx context.Context) []string
- type BlockMutation
- func (m *BlockMutation) AccountCleared() bool
- func (m *BlockMutation) AccountID() (r uuid.UUID, exists bool)
- func (m *BlockMutation) AccountIDCleared() bool
- func (m *BlockMutation) AccountIDs() (ids []uuid.UUID)
- func (m *BlockMutation) AddField(name string, value ent.Value) error
- func (m *BlockMutation) AddedEdges() []string
- func (m *BlockMutation) AddedField(name string) (ent.Value, bool)
- func (m *BlockMutation) AddedFields() []string
- func (m *BlockMutation) AddedIDs(name string) []ent.Value
- func (m *BlockMutation) Block() (r map[string]interface{}, exists bool)
- func (m *BlockMutation) BlockHash() (r string, exists bool)
- func (m *BlockMutation) ClearAccount()
- func (m *BlockMutation) ClearAccountID()
- func (m *BlockMutation) ClearEdge(name string) error
- func (m *BlockMutation) ClearField(name string) error
- func (m *BlockMutation) ClearSendID()
- func (m *BlockMutation) ClearedEdges() []string
- func (m *BlockMutation) ClearedFields() []string
- func (m BlockMutation) Client() *Client
- func (m *BlockMutation) CreatedAt() (r time.Time, exists bool)
- func (m *BlockMutation) EdgeCleared(name string) bool
- func (m *BlockMutation) Field(name string) (ent.Value, bool)
- func (m *BlockMutation) FieldCleared(name string) bool
- func (m *BlockMutation) Fields() []string
- func (m *BlockMutation) ID() (id uuid.UUID, exists bool)
- func (m *BlockMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *BlockMutation) OldAccountID(ctx context.Context) (v *uuid.UUID, err error)
- func (m *BlockMutation) OldBlock(ctx context.Context) (v map[string]interface{}, err error)
- func (m *BlockMutation) OldBlockHash(ctx context.Context) (v string, err error)
- func (m *BlockMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *BlockMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *BlockMutation) OldSendID(ctx context.Context) (v *string, err error)
- func (m *BlockMutation) OldSubtype(ctx context.Context) (v string, err error)
- func (m *BlockMutation) Op() Op
- func (m *BlockMutation) RemovedEdges() []string
- func (m *BlockMutation) RemovedIDs(name string) []ent.Value
- func (m *BlockMutation) ResetAccount()
- func (m *BlockMutation) ResetAccountID()
- func (m *BlockMutation) ResetBlock()
- func (m *BlockMutation) ResetBlockHash()
- func (m *BlockMutation) ResetCreatedAt()
- func (m *BlockMutation) ResetEdge(name string) error
- func (m *BlockMutation) ResetField(name string) error
- func (m *BlockMutation) ResetSendID()
- func (m *BlockMutation) ResetSubtype()
- func (m *BlockMutation) SendID() (r string, exists bool)
- func (m *BlockMutation) SendIDCleared() bool
- func (m *BlockMutation) SetAccountID(u uuid.UUID)
- func (m *BlockMutation) SetBlock(value map[string]interface{})
- func (m *BlockMutation) SetBlockHash(s string)
- func (m *BlockMutation) SetCreatedAt(t time.Time)
- func (m *BlockMutation) SetField(name string, value ent.Value) error
- func (m *BlockMutation) SetID(id uuid.UUID)
- func (m *BlockMutation) SetSendID(s string)
- func (m *BlockMutation) SetSubtype(s string)
- func (m *BlockMutation) Subtype() (r string, exists bool)
- func (m BlockMutation) Tx() (*Tx, error)
- func (m *BlockMutation) Type() string
- func (m *BlockMutation) Where(ps ...predicate.Block)
- type BlockQuery
- func (bq *BlockQuery) All(ctx context.Context) ([]*Block, error)
- func (bq *BlockQuery) AllX(ctx context.Context) []*Block
- func (bq *BlockQuery) Clone() *BlockQuery
- func (bq *BlockQuery) Count(ctx context.Context) (int, error)
- func (bq *BlockQuery) CountX(ctx context.Context) int
- func (bq *BlockQuery) Exist(ctx context.Context) (bool, error)
- func (bq *BlockQuery) ExistX(ctx context.Context) bool
- func (bq *BlockQuery) First(ctx context.Context) (*Block, error)
- func (bq *BlockQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (bq *BlockQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (bq *BlockQuery) FirstX(ctx context.Context) *Block
- func (bq *BlockQuery) GroupBy(field string, fields ...string) *BlockGroupBy
- func (bq *BlockQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (bq *BlockQuery) IDsX(ctx context.Context) []uuid.UUID
- func (bq *BlockQuery) Limit(limit int) *BlockQuery
- func (bq *BlockQuery) Offset(offset int) *BlockQuery
- func (bq *BlockQuery) Only(ctx context.Context) (*Block, error)
- func (bq *BlockQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (bq *BlockQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (bq *BlockQuery) OnlyX(ctx context.Context) *Block
- func (bq *BlockQuery) Order(o ...OrderFunc) *BlockQuery
- func (bq *BlockQuery) QueryAccount() *AccountQuery
- func (bq *BlockQuery) Select(fields ...string) *BlockSelect
- func (bq *BlockQuery) Unique(unique bool) *BlockQuery
- func (bq *BlockQuery) Where(ps ...predicate.Block) *BlockQuery
- func (bq *BlockQuery) WithAccount(opts ...func(*AccountQuery)) *BlockQuery
- type BlockSelect
- func (s *BlockSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *BlockSelect) BoolX(ctx context.Context) bool
- func (s *BlockSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *BlockSelect) BoolsX(ctx context.Context) []bool
- func (s *BlockSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *BlockSelect) Float64X(ctx context.Context) float64
- func (s *BlockSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *BlockSelect) Float64sX(ctx context.Context) []float64
- func (s *BlockSelect) Int(ctx context.Context) (_ int, err error)
- func (s *BlockSelect) IntX(ctx context.Context) int
- func (s *BlockSelect) Ints(ctx context.Context) ([]int, error)
- func (s *BlockSelect) IntsX(ctx context.Context) []int
- func (bs *BlockSelect) Scan(ctx context.Context, v interface{}) error
- func (s *BlockSelect) ScanX(ctx context.Context, v interface{})
- func (s *BlockSelect) String(ctx context.Context) (_ string, err error)
- func (s *BlockSelect) StringX(ctx context.Context) string
- func (s *BlockSelect) Strings(ctx context.Context) ([]string, error)
- func (s *BlockSelect) StringsX(ctx context.Context) []string
- type BlockUpdate
- func (bu *BlockUpdate) ClearAccount() *BlockUpdate
- func (bu *BlockUpdate) ClearAccountID() *BlockUpdate
- func (bu *BlockUpdate) Exec(ctx context.Context) error
- func (bu *BlockUpdate) ExecX(ctx context.Context)
- func (bu *BlockUpdate) Mutation() *BlockMutation
- func (bu *BlockUpdate) Save(ctx context.Context) (int, error)
- func (bu *BlockUpdate) SaveX(ctx context.Context) int
- func (bu *BlockUpdate) SetAccount(a *Account) *BlockUpdate
- func (bu *BlockUpdate) SetAccountID(u uuid.UUID) *BlockUpdate
- func (bu *BlockUpdate) SetNillableAccountID(u *uuid.UUID) *BlockUpdate
- func (bu *BlockUpdate) SetSubtype(s string) *BlockUpdate
- func (bu *BlockUpdate) Where(ps ...predicate.Block) *BlockUpdate
- type BlockUpdateOne
- func (buo *BlockUpdateOne) ClearAccount() *BlockUpdateOne
- func (buo *BlockUpdateOne) ClearAccountID() *BlockUpdateOne
- func (buo *BlockUpdateOne) Exec(ctx context.Context) error
- func (buo *BlockUpdateOne) ExecX(ctx context.Context)
- func (buo *BlockUpdateOne) Mutation() *BlockMutation
- func (buo *BlockUpdateOne) Save(ctx context.Context) (*Block, error)
- func (buo *BlockUpdateOne) SaveX(ctx context.Context) *Block
- func (buo *BlockUpdateOne) Select(field string, fields ...string) *BlockUpdateOne
- func (buo *BlockUpdateOne) SetAccount(a *Account) *BlockUpdateOne
- func (buo *BlockUpdateOne) SetAccountID(u uuid.UUID) *BlockUpdateOne
- func (buo *BlockUpdateOne) SetNillableAccountID(u *uuid.UUID) *BlockUpdateOne
- func (buo *BlockUpdateOne) SetSubtype(s string) *BlockUpdateOne
- type Blocks
- type Client
- type CommitFunc
- type CommitHook
- type Committer
- type ConstraintError
- type Hook
- type MutateFunc
- type Mutation
- type Mutator
- type NotFoundError
- type NotLoadedError
- type NotSingularError
- type Op
- type Option
- type OrderFunc
- type Policy
- type Query
- type RollbackFunc
- type RollbackHook
- type Rollbacker
- type Tx
- type ValidationError
- type Value
- type Wallet
- type WalletClient
- func (c *WalletClient) Create() *WalletCreate
- func (c *WalletClient) CreateBulk(builders ...*WalletCreate) *WalletCreateBulk
- func (c *WalletClient) Delete() *WalletDelete
- func (c *WalletClient) DeleteOne(w *Wallet) *WalletDeleteOne
- func (c *WalletClient) DeleteOneID(id uuid.UUID) *WalletDeleteOne
- func (c *WalletClient) Get(ctx context.Context, id uuid.UUID) (*Wallet, error)
- func (c *WalletClient) GetX(ctx context.Context, id uuid.UUID) *Wallet
- func (c *WalletClient) Hooks() []Hook
- func (c *WalletClient) Query() *WalletQuery
- func (c *WalletClient) QueryAccounts(w *Wallet) *AccountQuery
- func (c *WalletClient) Update() *WalletUpdate
- func (c *WalletClient) UpdateOne(w *Wallet) *WalletUpdateOne
- func (c *WalletClient) UpdateOneID(id uuid.UUID) *WalletUpdateOne
- func (c *WalletClient) Use(hooks ...Hook)
- type WalletCreate
- func (wc *WalletCreate) AddAccountIDs(ids ...uuid.UUID) *WalletCreate
- func (wc *WalletCreate) AddAccounts(a ...*Account) *WalletCreate
- func (wc *WalletCreate) Exec(ctx context.Context) error
- func (wc *WalletCreate) ExecX(ctx context.Context)
- func (wc *WalletCreate) Mutation() *WalletMutation
- func (wc *WalletCreate) Save(ctx context.Context) (*Wallet, error)
- func (wc *WalletCreate) SaveX(ctx context.Context) *Wallet
- func (wc *WalletCreate) SetCreatedAt(t time.Time) *WalletCreate
- func (wc *WalletCreate) SetEncrypted(b bool) *WalletCreate
- func (wc *WalletCreate) SetID(u uuid.UUID) *WalletCreate
- func (wc *WalletCreate) SetNillableCreatedAt(t *time.Time) *WalletCreate
- func (wc *WalletCreate) SetNillableEncrypted(b *bool) *WalletCreate
- func (wc *WalletCreate) SetNillableID(u *uuid.UUID) *WalletCreate
- func (wc *WalletCreate) SetNillableRepresentative(s *string) *WalletCreate
- func (wc *WalletCreate) SetNillableWork(b *bool) *WalletCreate
- func (wc *WalletCreate) SetRepresentative(s string) *WalletCreate
- func (wc *WalletCreate) SetSeed(s string) *WalletCreate
- func (wc *WalletCreate) SetWork(b bool) *WalletCreate
- type WalletCreateBulk
- type WalletDelete
- type WalletDeleteOne
- type WalletEdges
- type WalletGroupBy
- func (wgb *WalletGroupBy) Aggregate(fns ...AggregateFunc) *WalletGroupBy
- func (s *WalletGroupBy) Bool(ctx context.Context) (_ bool, err error)
- func (s *WalletGroupBy) BoolX(ctx context.Context) bool
- func (s *WalletGroupBy) Bools(ctx context.Context) ([]bool, error)
- func (s *WalletGroupBy) BoolsX(ctx context.Context) []bool
- func (s *WalletGroupBy) Float64(ctx context.Context) (_ float64, err error)
- func (s *WalletGroupBy) Float64X(ctx context.Context) float64
- func (s *WalletGroupBy) Float64s(ctx context.Context) ([]float64, error)
- func (s *WalletGroupBy) Float64sX(ctx context.Context) []float64
- func (s *WalletGroupBy) Int(ctx context.Context) (_ int, err error)
- func (s *WalletGroupBy) IntX(ctx context.Context) int
- func (s *WalletGroupBy) Ints(ctx context.Context) ([]int, error)
- func (s *WalletGroupBy) IntsX(ctx context.Context) []int
- func (wgb *WalletGroupBy) Scan(ctx context.Context, v interface{}) error
- func (s *WalletGroupBy) ScanX(ctx context.Context, v interface{})
- func (s *WalletGroupBy) String(ctx context.Context) (_ string, err error)
- func (s *WalletGroupBy) StringX(ctx context.Context) string
- func (s *WalletGroupBy) Strings(ctx context.Context) ([]string, error)
- func (s *WalletGroupBy) StringsX(ctx context.Context) []string
- type WalletMutation
- func (m *WalletMutation) AccountsCleared() bool
- func (m *WalletMutation) AccountsIDs() (ids []uuid.UUID)
- func (m *WalletMutation) AddAccountIDs(ids ...uuid.UUID)
- func (m *WalletMutation) AddField(name string, value ent.Value) error
- func (m *WalletMutation) AddedEdges() []string
- func (m *WalletMutation) AddedField(name string) (ent.Value, bool)
- func (m *WalletMutation) AddedFields() []string
- func (m *WalletMutation) AddedIDs(name string) []ent.Value
- func (m *WalletMutation) ClearAccounts()
- func (m *WalletMutation) ClearEdge(name string) error
- func (m *WalletMutation) ClearField(name string) error
- func (m *WalletMutation) ClearRepresentative()
- func (m *WalletMutation) ClearedEdges() []string
- func (m *WalletMutation) ClearedFields() []string
- func (m WalletMutation) Client() *Client
- func (m *WalletMutation) CreatedAt() (r time.Time, exists bool)
- func (m *WalletMutation) EdgeCleared(name string) bool
- func (m *WalletMutation) Encrypted() (r bool, exists bool)
- func (m *WalletMutation) Field(name string) (ent.Value, bool)
- func (m *WalletMutation) FieldCleared(name string) bool
- func (m *WalletMutation) Fields() []string
- func (m *WalletMutation) ID() (id uuid.UUID, exists bool)
- func (m *WalletMutation) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (m *WalletMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)
- func (m *WalletMutation) OldEncrypted(ctx context.Context) (v bool, err error)
- func (m *WalletMutation) OldField(ctx context.Context, name string) (ent.Value, error)
- func (m *WalletMutation) OldRepresentative(ctx context.Context) (v *string, err error)
- func (m *WalletMutation) OldSeed(ctx context.Context) (v string, err error)
- func (m *WalletMutation) OldWork(ctx context.Context) (v bool, err error)
- func (m *WalletMutation) Op() Op
- func (m *WalletMutation) RemoveAccountIDs(ids ...uuid.UUID)
- func (m *WalletMutation) RemovedAccountsIDs() (ids []uuid.UUID)
- func (m *WalletMutation) RemovedEdges() []string
- func (m *WalletMutation) RemovedIDs(name string) []ent.Value
- func (m *WalletMutation) Representative() (r string, exists bool)
- func (m *WalletMutation) RepresentativeCleared() bool
- func (m *WalletMutation) ResetAccounts()
- func (m *WalletMutation) ResetCreatedAt()
- func (m *WalletMutation) ResetEdge(name string) error
- func (m *WalletMutation) ResetEncrypted()
- func (m *WalletMutation) ResetField(name string) error
- func (m *WalletMutation) ResetRepresentative()
- func (m *WalletMutation) ResetSeed()
- func (m *WalletMutation) ResetWork()
- func (m *WalletMutation) Seed() (r string, exists bool)
- func (m *WalletMutation) SetCreatedAt(t time.Time)
- func (m *WalletMutation) SetEncrypted(b bool)
- func (m *WalletMutation) SetField(name string, value ent.Value) error
- func (m *WalletMutation) SetID(id uuid.UUID)
- func (m *WalletMutation) SetRepresentative(s string)
- func (m *WalletMutation) SetSeed(s string)
- func (m *WalletMutation) SetWork(b bool)
- func (m WalletMutation) Tx() (*Tx, error)
- func (m *WalletMutation) Type() string
- func (m *WalletMutation) Where(ps ...predicate.Wallet)
- func (m *WalletMutation) Work() (r bool, exists bool)
- type WalletQuery
- func (wq *WalletQuery) All(ctx context.Context) ([]*Wallet, error)
- func (wq *WalletQuery) AllX(ctx context.Context) []*Wallet
- func (wq *WalletQuery) Clone() *WalletQuery
- func (wq *WalletQuery) Count(ctx context.Context) (int, error)
- func (wq *WalletQuery) CountX(ctx context.Context) int
- func (wq *WalletQuery) Exist(ctx context.Context) (bool, error)
- func (wq *WalletQuery) ExistX(ctx context.Context) bool
- func (wq *WalletQuery) First(ctx context.Context) (*Wallet, error)
- func (wq *WalletQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)
- func (wq *WalletQuery) FirstIDX(ctx context.Context) uuid.UUID
- func (wq *WalletQuery) FirstX(ctx context.Context) *Wallet
- func (wq *WalletQuery) GroupBy(field string, fields ...string) *WalletGroupBy
- func (wq *WalletQuery) IDs(ctx context.Context) ([]uuid.UUID, error)
- func (wq *WalletQuery) IDsX(ctx context.Context) []uuid.UUID
- func (wq *WalletQuery) Limit(limit int) *WalletQuery
- func (wq *WalletQuery) Offset(offset int) *WalletQuery
- func (wq *WalletQuery) Only(ctx context.Context) (*Wallet, error)
- func (wq *WalletQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)
- func (wq *WalletQuery) OnlyIDX(ctx context.Context) uuid.UUID
- func (wq *WalletQuery) OnlyX(ctx context.Context) *Wallet
- func (wq *WalletQuery) Order(o ...OrderFunc) *WalletQuery
- func (wq *WalletQuery) QueryAccounts() *AccountQuery
- func (wq *WalletQuery) Select(fields ...string) *WalletSelect
- func (wq *WalletQuery) Unique(unique bool) *WalletQuery
- func (wq *WalletQuery) Where(ps ...predicate.Wallet) *WalletQuery
- func (wq *WalletQuery) WithAccounts(opts ...func(*AccountQuery)) *WalletQuery
- type WalletSelect
- func (s *WalletSelect) Bool(ctx context.Context) (_ bool, err error)
- func (s *WalletSelect) BoolX(ctx context.Context) bool
- func (s *WalletSelect) Bools(ctx context.Context) ([]bool, error)
- func (s *WalletSelect) BoolsX(ctx context.Context) []bool
- func (s *WalletSelect) Float64(ctx context.Context) (_ float64, err error)
- func (s *WalletSelect) Float64X(ctx context.Context) float64
- func (s *WalletSelect) Float64s(ctx context.Context) ([]float64, error)
- func (s *WalletSelect) Float64sX(ctx context.Context) []float64
- func (s *WalletSelect) Int(ctx context.Context) (_ int, err error)
- func (s *WalletSelect) IntX(ctx context.Context) int
- func (s *WalletSelect) Ints(ctx context.Context) ([]int, error)
- func (s *WalletSelect) IntsX(ctx context.Context) []int
- func (ws *WalletSelect) Scan(ctx context.Context, v interface{}) error
- func (s *WalletSelect) ScanX(ctx context.Context, v interface{})
- func (s *WalletSelect) String(ctx context.Context) (_ string, err error)
- func (s *WalletSelect) StringX(ctx context.Context) string
- func (s *WalletSelect) Strings(ctx context.Context) ([]string, error)
- func (s *WalletSelect) StringsX(ctx context.Context) []string
- type WalletUpdate
- func (wu *WalletUpdate) AddAccountIDs(ids ...uuid.UUID) *WalletUpdate
- func (wu *WalletUpdate) AddAccounts(a ...*Account) *WalletUpdate
- func (wu *WalletUpdate) ClearAccounts() *WalletUpdate
- func (wu *WalletUpdate) ClearRepresentative() *WalletUpdate
- func (wu *WalletUpdate) Exec(ctx context.Context) error
- func (wu *WalletUpdate) ExecX(ctx context.Context)
- func (wu *WalletUpdate) Mutation() *WalletMutation
- func (wu *WalletUpdate) RemoveAccountIDs(ids ...uuid.UUID) *WalletUpdate
- func (wu *WalletUpdate) RemoveAccounts(a ...*Account) *WalletUpdate
- func (wu *WalletUpdate) Save(ctx context.Context) (int, error)
- func (wu *WalletUpdate) SaveX(ctx context.Context) int
- func (wu *WalletUpdate) SetEncrypted(b bool) *WalletUpdate
- func (wu *WalletUpdate) SetNillableEncrypted(b *bool) *WalletUpdate
- func (wu *WalletUpdate) SetNillableRepresentative(s *string) *WalletUpdate
- func (wu *WalletUpdate) SetNillableWork(b *bool) *WalletUpdate
- func (wu *WalletUpdate) SetRepresentative(s string) *WalletUpdate
- func (wu *WalletUpdate) SetSeed(s string) *WalletUpdate
- func (wu *WalletUpdate) SetWork(b bool) *WalletUpdate
- func (wu *WalletUpdate) Where(ps ...predicate.Wallet) *WalletUpdate
- type WalletUpdateOne
- func (wuo *WalletUpdateOne) AddAccountIDs(ids ...uuid.UUID) *WalletUpdateOne
- func (wuo *WalletUpdateOne) AddAccounts(a ...*Account) *WalletUpdateOne
- func (wuo *WalletUpdateOne) ClearAccounts() *WalletUpdateOne
- func (wuo *WalletUpdateOne) ClearRepresentative() *WalletUpdateOne
- func (wuo *WalletUpdateOne) Exec(ctx context.Context) error
- func (wuo *WalletUpdateOne) ExecX(ctx context.Context)
- func (wuo *WalletUpdateOne) Mutation() *WalletMutation
- func (wuo *WalletUpdateOne) RemoveAccountIDs(ids ...uuid.UUID) *WalletUpdateOne
- func (wuo *WalletUpdateOne) RemoveAccounts(a ...*Account) *WalletUpdateOne
- func (wuo *WalletUpdateOne) Save(ctx context.Context) (*Wallet, error)
- func (wuo *WalletUpdateOne) SaveX(ctx context.Context) *Wallet
- func (wuo *WalletUpdateOne) Select(field string, fields ...string) *WalletUpdateOne
- func (wuo *WalletUpdateOne) SetEncrypted(b bool) *WalletUpdateOne
- func (wuo *WalletUpdateOne) SetNillableEncrypted(b *bool) *WalletUpdateOne
- func (wuo *WalletUpdateOne) SetNillableRepresentative(s *string) *WalletUpdateOne
- func (wuo *WalletUpdateOne) SetNillableWork(b *bool) *WalletUpdateOne
- func (wuo *WalletUpdateOne) SetRepresentative(s string) *WalletUpdateOne
- func (wuo *WalletUpdateOne) SetSeed(s string) *WalletUpdateOne
- func (wuo *WalletUpdateOne) SetWork(b bool) *WalletUpdateOne
- type Wallets
Constants ¶
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 ¶
IsConstraintError returns a boolean indicating whether the error is a constraint failure.
func IsNotFound ¶
IsNotFound returns a boolean indicating whether the error is a not found error.
func IsNotLoaded ¶
IsNotLoaded returns a boolean indicating whether the error is a not loaded error.
func IsNotSingular ¶
IsNotSingular returns a boolean indicating whether the error is a not singular error.
func IsValidationError ¶
IsValidationError returns a boolean indicating whether the error is a validation error.
func NewContext ¶
NewContext returns a new context with the given Client 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) Unwrap ¶
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) 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.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccountGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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 ¶
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 ¶
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 ¶
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 ¶
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) 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 ¶
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) 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 ¶
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*AccountSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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 AggregateFunc ¶
AggregateFunc applies an aggregation step on the group-by traversal/selector.
func As ¶
func As(fn AggregateFunc, end string) AggregateFunc
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) Unwrap ¶
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) 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.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BlockGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BlockGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BlockGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BlockGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BlockGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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 ¶
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 ¶
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 ¶
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 ¶
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) 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 ¶
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) 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 ¶
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*BlockSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*BlockSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*BlockSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*BlockSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*BlockSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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 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 ¶
FromContext returns a Client stored inside a context, or nil if there isn't one.
func Open ¶
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) Debug ¶
Debug returns a new debug-client. It's used to get verbose logging on specific operations.
client.Debug(). Account. Query(). Count(ctx)
type CommitFunc ¶
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.
type CommitHook ¶
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 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 MutateFunc ¶
type MutateFunc = ent.MutateFunc
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 RollbackFunc ¶
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.
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 ¶
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 ¶
TxFromContext returns a Tx stored inside a context, or nil if there isn't one.
func (*Tx) OnRollback ¶
func (tx *Tx) OnRollback(f RollbackHook)
OnRollback adds a hook to call on rollback.
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 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) Unwrap ¶
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) 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.
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*WalletGroupBy) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*WalletGroupBy) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*WalletGroupBy) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*WalletGroupBy) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*WalletGroupBy) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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 ¶
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 ¶
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 ¶
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) 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 ¶
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) 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 ¶
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 ¶
Bool returns a single bool from a selector. It is only allowed when selecting one field.
func (*WalletSelect) Bools ¶
Bools returns list of bools from a selector. It is only allowed when selecting one field.
func (*WalletSelect) Float64 ¶
Float64 returns a single float64 from a selector. It is only allowed when selecting one field.
func (*WalletSelect) Float64s ¶
Float64s returns list of float64s from a selector. It is only allowed when selecting one field.
func (*WalletSelect) Int ¶
Int returns a single int from a selector. It is only allowed when selecting one field.
func (*WalletSelect) Ints ¶
Ints returns list of ints from a selector. It is only allowed when selecting one field.
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) String ¶
String returns a single string from a selector. It is only allowed when selecting one field.
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.
Source Files ¶
- account.go
- account_create.go
- account_delete.go
- account_query.go
- account_update.go
- block.go
- block_create.go
- block_delete.go
- block_query.go
- block_update.go
- client.go
- config.go
- context.go
- ent.go
- generate.go
- mutation.go
- runtime.go
- tx.go
- wallet.go
- wallet_create.go
- wallet_delete.go
- wallet_query.go
- wallet_update.go