ent

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeBlock           = "Block"
	TypeChain           = "Chain"
	TypeMsg             = "Msg"
	TypeReceipt         = "Receipt"
	TypeXProviderCursor = "XProviderCursor"
)

Variables

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

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

Functions

func Asc

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

Asc applies the given fields in ASC order.

func Desc

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

Desc applies the given fields in DESC order.

func IsConstraintError

func IsConstraintError(err error) bool

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

func IsNotFound

func IsNotFound(err error) bool

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

func IsNotLoaded

func IsNotLoaded(err error) bool

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

func IsNotSingular

func IsNotSingular(err error) bool

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

func IsValidationError

func IsValidationError(err error) bool

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

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

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

NewContext returns a new context with the given Client attached.

func NewTxContext

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

NewTxContext returns a new context with the given Tx attached.

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

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

func As

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

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

func Count

func Count() AggregateFunc

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

func Max

func Max(field string) AggregateFunc

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

func Mean

func Mean(field string) AggregateFunc

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

func Min

func Min(field string) AggregateFunc

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

func Sum

func Sum(field string) AggregateFunc

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

type Block

type Block struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Hash holds the value of the "hash" field.
	Hash []byte `json:"hash,omitempty"`
	// ChainID holds the value of the "chain_id" field.
	ChainID uint64 `json:"chain_id,omitempty"`
	// Height holds the value of the "height" field.
	Height uint64 `json:"height,omitempty"`
	// Offset holds the value of the "offset" field.
	Offset uint64 `json:"offset,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,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) QueryMsgs

func (b *Block) QueryMsgs() *MsgQuery

QueryMsgs queries the "msgs" edge of the Block entity.

func (*Block) QueryReceipts

func (b *Block) QueryReceipts() *ReceiptQuery

QueryReceipts queries the "receipts" edge of the Block entity.

func (*Block) String

func (b *Block) String() string

String implements the fmt.Stringer.

func (*Block) Unwrap

func (b *Block) Unwrap() *Block

Unwrap unwraps the Block entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Block) Update

func (b *Block) Update() *BlockUpdateOne

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

func (*Block) Value

func (b *Block) Value(name string) (ent.Value, error)

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

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 int) *BlockDeleteOne

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

func (*BlockClient) Get

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

Get returns a Block entity by its id.

func (*BlockClient) GetX

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

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

func (*BlockClient) Hooks

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

Hooks returns the client hooks.

func (*BlockClient) Intercept

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

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

func (*BlockClient) Interceptors

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

Interceptors returns the client interceptors.

func (*BlockClient) MapCreateBulk

func (c *BlockClient) MapCreateBulk(slice any, setFunc func(*BlockCreate, int)) *BlockCreateBulk

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

func (*BlockClient) Query

func (c *BlockClient) Query() *BlockQuery

Query returns a query builder for Block.

func (*BlockClient) QueryMsgs

func (c *BlockClient) QueryMsgs(b *Block) *MsgQuery

QueryMsgs queries the msgs edge of a Block.

func (*BlockClient) QueryReceipts

func (c *BlockClient) QueryReceipts(b *Block) *ReceiptQuery

QueryReceipts queries the receipts 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 int) *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) AddMsgIDs

func (bc *BlockCreate) AddMsgIDs(ids ...int) *BlockCreate

AddMsgIDs adds the "msgs" edge to the Msg entity by IDs.

func (*BlockCreate) AddMsgs

func (bc *BlockCreate) AddMsgs(m ...*Msg) *BlockCreate

AddMsgs adds the "msgs" edges to the Msg entity.

func (*BlockCreate) AddReceiptIDs

func (bc *BlockCreate) AddReceiptIDs(ids ...int) *BlockCreate

AddReceiptIDs adds the "receipts" edge to the Receipt entity by IDs.

func (*BlockCreate) AddReceipts

func (bc *BlockCreate) AddReceipts(r ...*Receipt) *BlockCreate

AddReceipts adds the "receipts" edges to the Receipt 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) SetChainID added in v0.1.7

func (bc *BlockCreate) SetChainID(u uint64) *BlockCreate

SetChainID sets the "chain_id" field.

func (*BlockCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*BlockCreate) SetHash added in v0.1.7

func (bc *BlockCreate) SetHash(b []byte) *BlockCreate

SetHash sets the "hash" field.

func (*BlockCreate) SetHeight added in v0.1.7

func (bc *BlockCreate) SetHeight(u uint64) *BlockCreate

SetHeight sets the "height" field.

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

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

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*BlockCreate) SetOffset added in v0.1.7

func (bc *BlockCreate) SetOffset(u uint64) *BlockCreate

SetOffset sets the "offset" field.

func (*BlockCreate) SetTimestamp

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

SetTimestamp sets the "timestamp" field.

type BlockCreateBulk

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

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

func (*BlockCreateBulk) Exec

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

Exec executes the query.

func (*BlockCreateBulk) ExecX

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

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

func (*BlockCreateBulk) Save

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

Save creates the Block entities in the database.

func (*BlockCreateBulk) SaveX

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

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

type BlockDelete

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

BlockDelete is the builder for deleting a Block entity.

func (*BlockDelete) Exec

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

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

func (*BlockDelete) ExecX

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

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

func (*BlockDelete) Where

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

Where appends a list predicates to the BlockDelete builder.

type BlockDeleteOne

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

BlockDeleteOne is the builder for deleting a single Block entity.

func (*BlockDeleteOne) Exec

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

Exec executes the deletion query.

func (*BlockDeleteOne) ExecX

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

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

func (*BlockDeleteOne) Where

func (bdo *BlockDeleteOne) Where(ps ...predicate.Block) *BlockDeleteOne

Where appends a list predicates to the BlockDelete builder.

type BlockEdges

type BlockEdges struct {
	// Msgs holds the value of the msgs edge.
	Msgs []*Msg `json:"msgs,omitempty"`
	// Receipts holds the value of the receipts edge.
	Receipts []*Receipt `json:"receipts,omitempty"`
	// contains filtered or unexported fields
}

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

func (BlockEdges) MsgsOrErr

func (e BlockEdges) MsgsOrErr() ([]*Msg, error)

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

func (BlockEdges) ReceiptsOrErr

func (e BlockEdges) ReceiptsOrErr() ([]*Receipt, error)

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

type BlockFilter

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

BlockFilter provides a generic filtering capability at runtime for BlockQuery.

func (*BlockFilter) Where

func (f *BlockFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*BlockFilter) WhereChainID added in v0.1.7

func (f *BlockFilter) WhereChainID(p entql.Uint64P)

WhereChainID applies the entql uint64 predicate on the chain_id field.

func (*BlockFilter) WhereCreatedAt

func (f *BlockFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*BlockFilter) WhereHasMsgs

func (f *BlockFilter) WhereHasMsgs()

WhereHasMsgs applies a predicate to check if query has an edge msgs.

func (*BlockFilter) WhereHasMsgsWith

func (f *BlockFilter) WhereHasMsgsWith(preds ...predicate.Msg)

WhereHasMsgsWith applies a predicate to check if query has an edge msgs with a given conditions (other predicates).

func (*BlockFilter) WhereHasReceipts

func (f *BlockFilter) WhereHasReceipts()

WhereHasReceipts applies a predicate to check if query has an edge receipts.

func (*BlockFilter) WhereHasReceiptsWith

func (f *BlockFilter) WhereHasReceiptsWith(preds ...predicate.Receipt)

WhereHasReceiptsWith applies a predicate to check if query has an edge receipts with a given conditions (other predicates).

func (*BlockFilter) WhereHash added in v0.1.7

func (f *BlockFilter) WhereHash(p entql.BytesP)

WhereHash applies the entql []byte predicate on the hash field.

func (*BlockFilter) WhereHeight added in v0.1.7

func (f *BlockFilter) WhereHeight(p entql.Uint64P)

WhereHeight applies the entql uint64 predicate on the height field.

func (*BlockFilter) WhereID

func (f *BlockFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*BlockFilter) WhereOffset added in v0.1.7

func (f *BlockFilter) WhereOffset(p entql.Uint64P)

WhereOffset applies the entql uint64 predicate on the offset field.

func (*BlockFilter) WhereTimestamp

func (f *BlockFilter) WhereTimestamp(p entql.TimeP)

WhereTimestamp applies the entql time.Time predicate on the timestamp field.

type BlockGroupBy

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

BlockGroupBy is the group-by builder for Block entities.

func (*BlockGroupBy) Aggregate

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

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

func (*BlockGroupBy) Bool

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

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

func (*BlockGroupBy) BoolX

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

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

func (*BlockGroupBy) Bools

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

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

func (*BlockGroupBy) BoolsX

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

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

func (*BlockGroupBy) Float64

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

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

func (*BlockGroupBy) Float64X

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

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

func (*BlockGroupBy) Float64s

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

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

func (*BlockGroupBy) Float64sX

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

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

func (*BlockGroupBy) Int

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

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

func (*BlockGroupBy) IntX

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

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

func (*BlockGroupBy) Ints

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

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

func (*BlockGroupBy) IntsX

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

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

func (*BlockGroupBy) Scan

func (bgb *BlockGroupBy) Scan(ctx context.Context, v any) error

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

func (*BlockGroupBy) ScanX

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

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

func (*BlockGroupBy) String

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

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

func (*BlockGroupBy) StringX

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

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

func (*BlockGroupBy) Strings

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

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

func (*BlockGroupBy) StringsX

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

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

type BlockMutation

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

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

func (*BlockMutation) AddChainID added in v0.1.7

func (m *BlockMutation) AddChainID(u int64)

AddChainID adds u to the "chain_id" field.

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) AddHeight added in v0.1.7

func (m *BlockMutation) AddHeight(u int64)

AddHeight adds u to the "height" field.

func (*BlockMutation) AddMsgIDs

func (m *BlockMutation) AddMsgIDs(ids ...int)

AddMsgIDs adds the "msgs" edge to the Msg entity by ids.

func (*BlockMutation) AddOffset added in v0.1.7

func (m *BlockMutation) AddOffset(u int64)

AddOffset adds u to the "offset" field.

func (*BlockMutation) AddReceiptIDs

func (m *BlockMutation) AddReceiptIDs(ids ...int)

AddReceiptIDs adds the "receipts" edge to the Receipt entity by ids.

func (*BlockMutation) AddedChainID added in v0.1.7

func (m *BlockMutation) AddedChainID() (r int64, exists bool)

AddedChainID returns the value that was added to the "chain_id" field in this mutation.

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) AddedHeight added in v0.1.7

func (m *BlockMutation) AddedHeight() (r int64, exists bool)

AddedHeight returns the value that was added to the "height" field in 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) AddedOffset added in v0.1.7

func (m *BlockMutation) AddedOffset() (r int64, exists bool)

AddedOffset returns the value that was added to the "offset" field in this mutation.

func (*BlockMutation) ChainID added in v0.1.7

func (m *BlockMutation) ChainID() (r uint64, exists bool)

ChainID returns the value of the "chain_id" field in the mutation.

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

func (m *BlockMutation) ClearMsgs()

ClearMsgs clears the "msgs" edge to the Msg entity.

func (*BlockMutation) ClearReceipts

func (m *BlockMutation) ClearReceipts()

ClearReceipts clears the "receipts" edge to the Receipt entity.

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

func (m *BlockMutation) Filter() *BlockFilter

Filter returns an entql.Where implementation to apply filters on the BlockMutation builder.

func (*BlockMutation) Hash added in v0.1.7

func (m *BlockMutation) Hash() (r []byte, exists bool)

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

func (*BlockMutation) Height added in v0.1.7

func (m *BlockMutation) Height() (r uint64, exists bool)

Height returns the value of the "height" field in the mutation.

func (*BlockMutation) ID

func (m *BlockMutation) ID() (id int, exists bool)

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

func (*BlockMutation) IDs

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

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

func (*BlockMutation) MsgsCleared

func (m *BlockMutation) MsgsCleared() bool

MsgsCleared reports if the "msgs" edge to the Msg entity was cleared.

func (*BlockMutation) MsgsIDs

func (m *BlockMutation) MsgsIDs() (ids []int)

MsgsIDs returns the "msgs" edge IDs in the mutation.

func (*BlockMutation) Offset added in v0.1.7

func (m *BlockMutation) Offset() (r uint64, exists bool)

Offset returns the value of the "offset" field in the mutation.

func (*BlockMutation) OldChainID added in v0.1.7

func (m *BlockMutation) OldChainID(ctx context.Context) (v uint64, err error)

OldChainID returns the old "chain_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) OldCreatedAt

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

OldCreatedAt returns the old "created_at" field's value of the Block entity. If the Block object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BlockMutation) OldField

func (m *BlockMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*BlockMutation) OldHash added in v0.1.7

func (m *BlockMutation) OldHash(ctx context.Context) (v []byte, err error)

OldHash returns the old "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) OldHeight added in v0.1.7

func (m *BlockMutation) OldHeight(ctx context.Context) (v uint64, err error)

OldHeight returns the old "height" 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) OldOffset added in v0.1.7

func (m *BlockMutation) OldOffset(ctx context.Context) (v uint64, err error)

OldOffset returns the old "offset" 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) OldTimestamp

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

OldTimestamp returns the old "timestamp" field's value of the Block entity. If the Block object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BlockMutation) Op

func (m *BlockMutation) Op() Op

Op returns the operation name.

func (*BlockMutation) ReceiptsCleared

func (m *BlockMutation) ReceiptsCleared() bool

ReceiptsCleared reports if the "receipts" edge to the Receipt entity was cleared.

func (*BlockMutation) ReceiptsIDs

func (m *BlockMutation) ReceiptsIDs() (ids []int)

ReceiptsIDs returns the "receipts" edge IDs in the mutation.

func (*BlockMutation) RemoveMsgIDs

func (m *BlockMutation) RemoveMsgIDs(ids ...int)

RemoveMsgIDs removes the "msgs" edge to the Msg entity by IDs.

func (*BlockMutation) RemoveReceiptIDs

func (m *BlockMutation) RemoveReceiptIDs(ids ...int)

RemoveReceiptIDs removes the "receipts" edge to the Receipt entity by IDs.

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

func (m *BlockMutation) RemovedMsgsIDs() (ids []int)

RemovedMsgs returns the removed IDs of the "msgs" edge to the Msg entity.

func (*BlockMutation) RemovedReceiptsIDs

func (m *BlockMutation) RemovedReceiptsIDs() (ids []int)

RemovedReceipts returns the removed IDs of the "receipts" edge to the Receipt entity.

func (*BlockMutation) ResetChainID added in v0.1.7

func (m *BlockMutation) ResetChainID()

ResetChainID resets all changes to the "chain_id" 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) ResetHash added in v0.1.7

func (m *BlockMutation) ResetHash()

ResetHash resets all changes to the "hash" field.

func (*BlockMutation) ResetHeight added in v0.1.7

func (m *BlockMutation) ResetHeight()

ResetHeight resets all changes to the "height" field.

func (*BlockMutation) ResetMsgs

func (m *BlockMutation) ResetMsgs()

ResetMsgs resets all changes to the "msgs" edge.

func (*BlockMutation) ResetOffset added in v0.1.7

func (m *BlockMutation) ResetOffset()

ResetOffset resets all changes to the "offset" field.

func (*BlockMutation) ResetReceipts

func (m *BlockMutation) ResetReceipts()

ResetReceipts resets all changes to the "receipts" edge.

func (*BlockMutation) ResetTimestamp

func (m *BlockMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*BlockMutation) SetChainID added in v0.1.7

func (m *BlockMutation) SetChainID(u uint64)

SetChainID sets the "chain_id" 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) SetHash added in v0.1.7

func (m *BlockMutation) SetHash(b []byte)

SetHash sets the "hash" field.

func (*BlockMutation) SetHeight added in v0.1.7

func (m *BlockMutation) SetHeight(u uint64)

SetHeight sets the "height" field.

func (*BlockMutation) SetOffset added in v0.1.7

func (m *BlockMutation) SetOffset(u uint64)

SetOffset sets the "offset" field.

func (*BlockMutation) SetOp

func (m *BlockMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*BlockMutation) SetTimestamp

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

SetTimestamp sets the "timestamp" field.

func (*BlockMutation) Timestamp

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

Timestamp returns the value of the "timestamp" 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.

func (*BlockMutation) WhereP

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

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

type BlockQuery

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

BlockQuery is the builder for querying Block entities.

func (*BlockQuery) Aggregate

func (bq *BlockQuery) Aggregate(fns ...AggregateFunc) *BlockSelect

Aggregate returns a BlockSelect configured with the given aggregations.

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

func (bq *BlockQuery) Filter() *BlockFilter

Filter returns a Filter implementation to apply filters on the BlockQuery builder.

func (*BlockQuery) First

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

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

func (*BlockQuery) FirstID

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

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

func (*BlockQuery) FirstIDX

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

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 {
	Hash []byte `json:"hash,omitempty"`
	Count int `json:"count,omitempty"`
}

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

func (*BlockQuery) IDs

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

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

func (*BlockQuery) IDsX

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

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

func (*BlockQuery) Limit

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

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

func (*BlockQuery) Offset

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

Offset to start from.

func (*BlockQuery) Only

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

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

func (*BlockQuery) OnlyID

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

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

func (*BlockQuery) OnlyIDX

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

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 ...block.OrderOption) *BlockQuery

Order specifies how the records should be ordered.

func (*BlockQuery) QueryMsgs

func (bq *BlockQuery) QueryMsgs() *MsgQuery

QueryMsgs chains the current query on the "msgs" edge.

func (*BlockQuery) QueryReceipts

func (bq *BlockQuery) QueryReceipts() *ReceiptQuery

QueryReceipts chains the current query on the "receipts" 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 {
	Hash []byte `json:"hash,omitempty"`
}

client.Block.Query().
	Select(block.FieldHash).
	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) WithMsgs

func (bq *BlockQuery) WithMsgs(opts ...func(*MsgQuery)) *BlockQuery

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

func (*BlockQuery) WithReceipts

func (bq *BlockQuery) WithReceipts(opts ...func(*ReceiptQuery)) *BlockQuery

WithReceipts tells the query-builder to eager-load the nodes that are connected to the "receipts" 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) Aggregate

func (bs *BlockSelect) Aggregate(fns ...AggregateFunc) *BlockSelect

Aggregate adds the given aggregation functions to the selector query.

func (*BlockSelect) Bool

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

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

func (*BlockSelect) BoolX

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

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

func (*BlockSelect) Bools

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

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

func (*BlockSelect) BoolsX

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

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

func (*BlockSelect) Float64

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

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

func (*BlockSelect) Float64X

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

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

func (*BlockSelect) Float64s

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

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

func (*BlockSelect) Float64sX

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

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

func (*BlockSelect) Int

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

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

func (*BlockSelect) IntX

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

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

func (*BlockSelect) Ints

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

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

func (*BlockSelect) IntsX

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

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

func (*BlockSelect) Scan

func (bs *BlockSelect) Scan(ctx context.Context, v any) error

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

func (*BlockSelect) ScanX

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

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

func (*BlockSelect) String

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

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

func (*BlockSelect) StringX

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

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

func (*BlockSelect) Strings

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

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

func (*BlockSelect) StringsX

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

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

type BlockUpdate

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

BlockUpdate is the builder for updating Block entities.

func (*BlockUpdate) AddChainID added in v0.1.7

func (bu *BlockUpdate) AddChainID(u int64) *BlockUpdate

AddChainID adds u to the "chain_id" field.

func (*BlockUpdate) AddHeight added in v0.1.7

func (bu *BlockUpdate) AddHeight(u int64) *BlockUpdate

AddHeight adds u to the "height" field.

func (*BlockUpdate) AddMsgIDs

func (bu *BlockUpdate) AddMsgIDs(ids ...int) *BlockUpdate

AddMsgIDs adds the "msgs" edge to the Msg entity by IDs.

func (*BlockUpdate) AddMsgs

func (bu *BlockUpdate) AddMsgs(m ...*Msg) *BlockUpdate

AddMsgs adds the "msgs" edges to the Msg entity.

func (*BlockUpdate) AddOffset added in v0.1.7

func (bu *BlockUpdate) AddOffset(u int64) *BlockUpdate

AddOffset adds u to the "offset" field.

func (*BlockUpdate) AddReceiptIDs

func (bu *BlockUpdate) AddReceiptIDs(ids ...int) *BlockUpdate

AddReceiptIDs adds the "receipts" edge to the Receipt entity by IDs.

func (*BlockUpdate) AddReceipts

func (bu *BlockUpdate) AddReceipts(r ...*Receipt) *BlockUpdate

AddReceipts adds the "receipts" edges to the Receipt entity.

func (*BlockUpdate) ClearMsgs

func (bu *BlockUpdate) ClearMsgs() *BlockUpdate

ClearMsgs clears all "msgs" edges to the Msg entity.

func (*BlockUpdate) ClearReceipts

func (bu *BlockUpdate) ClearReceipts() *BlockUpdate

ClearReceipts clears all "receipts" edges to the Receipt entity.

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

func (bu *BlockUpdate) RemoveMsgIDs(ids ...int) *BlockUpdate

RemoveMsgIDs removes the "msgs" edge to Msg entities by IDs.

func (*BlockUpdate) RemoveMsgs

func (bu *BlockUpdate) RemoveMsgs(m ...*Msg) *BlockUpdate

RemoveMsgs removes "msgs" edges to Msg entities.

func (*BlockUpdate) RemoveReceiptIDs

func (bu *BlockUpdate) RemoveReceiptIDs(ids ...int) *BlockUpdate

RemoveReceiptIDs removes the "receipts" edge to Receipt entities by IDs.

func (*BlockUpdate) RemoveReceipts

func (bu *BlockUpdate) RemoveReceipts(r ...*Receipt) *BlockUpdate

RemoveReceipts removes "receipts" edges to Receipt entities.

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) SetChainID added in v0.1.7

func (bu *BlockUpdate) SetChainID(u uint64) *BlockUpdate

SetChainID sets the "chain_id" field.

func (*BlockUpdate) SetCreatedAt

func (bu *BlockUpdate) SetCreatedAt(t time.Time) *BlockUpdate

SetCreatedAt sets the "created_at" field.

func (*BlockUpdate) SetHash added in v0.1.7

func (bu *BlockUpdate) SetHash(b []byte) *BlockUpdate

SetHash sets the "hash" field.

func (*BlockUpdate) SetHeight added in v0.1.7

func (bu *BlockUpdate) SetHeight(u uint64) *BlockUpdate

SetHeight sets the "height" field.

func (*BlockUpdate) SetNillableChainID added in v0.1.7

func (bu *BlockUpdate) SetNillableChainID(u *uint64) *BlockUpdate

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*BlockUpdate) SetNillableCreatedAt

func (bu *BlockUpdate) SetNillableCreatedAt(t *time.Time) *BlockUpdate

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

func (*BlockUpdate) SetNillableHeight added in v0.1.7

func (bu *BlockUpdate) SetNillableHeight(u *uint64) *BlockUpdate

SetNillableHeight sets the "height" field if the given value is not nil.

func (*BlockUpdate) SetNillableOffset added in v0.1.7

func (bu *BlockUpdate) SetNillableOffset(u *uint64) *BlockUpdate

SetNillableOffset sets the "offset" field if the given value is not nil.

func (*BlockUpdate) SetNillableTimestamp

func (bu *BlockUpdate) SetNillableTimestamp(t *time.Time) *BlockUpdate

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*BlockUpdate) SetOffset added in v0.1.7

func (bu *BlockUpdate) SetOffset(u uint64) *BlockUpdate

SetOffset sets the "offset" field.

func (*BlockUpdate) SetTimestamp

func (bu *BlockUpdate) SetTimestamp(t time.Time) *BlockUpdate

SetTimestamp sets the "timestamp" 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) AddChainID added in v0.1.7

func (buo *BlockUpdateOne) AddChainID(u int64) *BlockUpdateOne

AddChainID adds u to the "chain_id" field.

func (*BlockUpdateOne) AddHeight added in v0.1.7

func (buo *BlockUpdateOne) AddHeight(u int64) *BlockUpdateOne

AddHeight adds u to the "height" field.

func (*BlockUpdateOne) AddMsgIDs

func (buo *BlockUpdateOne) AddMsgIDs(ids ...int) *BlockUpdateOne

AddMsgIDs adds the "msgs" edge to the Msg entity by IDs.

func (*BlockUpdateOne) AddMsgs

func (buo *BlockUpdateOne) AddMsgs(m ...*Msg) *BlockUpdateOne

AddMsgs adds the "msgs" edges to the Msg entity.

func (*BlockUpdateOne) AddOffset added in v0.1.7

func (buo *BlockUpdateOne) AddOffset(u int64) *BlockUpdateOne

AddOffset adds u to the "offset" field.

func (*BlockUpdateOne) AddReceiptIDs

func (buo *BlockUpdateOne) AddReceiptIDs(ids ...int) *BlockUpdateOne

AddReceiptIDs adds the "receipts" edge to the Receipt entity by IDs.

func (*BlockUpdateOne) AddReceipts

func (buo *BlockUpdateOne) AddReceipts(r ...*Receipt) *BlockUpdateOne

AddReceipts adds the "receipts" edges to the Receipt entity.

func (*BlockUpdateOne) ClearMsgs

func (buo *BlockUpdateOne) ClearMsgs() *BlockUpdateOne

ClearMsgs clears all "msgs" edges to the Msg entity.

func (*BlockUpdateOne) ClearReceipts

func (buo *BlockUpdateOne) ClearReceipts() *BlockUpdateOne

ClearReceipts clears all "receipts" edges to the Receipt entity.

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

func (buo *BlockUpdateOne) RemoveMsgIDs(ids ...int) *BlockUpdateOne

RemoveMsgIDs removes the "msgs" edge to Msg entities by IDs.

func (*BlockUpdateOne) RemoveMsgs

func (buo *BlockUpdateOne) RemoveMsgs(m ...*Msg) *BlockUpdateOne

RemoveMsgs removes "msgs" edges to Msg entities.

func (*BlockUpdateOne) RemoveReceiptIDs

func (buo *BlockUpdateOne) RemoveReceiptIDs(ids ...int) *BlockUpdateOne

RemoveReceiptIDs removes the "receipts" edge to Receipt entities by IDs.

func (*BlockUpdateOne) RemoveReceipts

func (buo *BlockUpdateOne) RemoveReceipts(r ...*Receipt) *BlockUpdateOne

RemoveReceipts removes "receipts" edges to Receipt entities.

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) SetChainID added in v0.1.7

func (buo *BlockUpdateOne) SetChainID(u uint64) *BlockUpdateOne

SetChainID sets the "chain_id" field.

func (*BlockUpdateOne) SetCreatedAt

func (buo *BlockUpdateOne) SetCreatedAt(t time.Time) *BlockUpdateOne

SetCreatedAt sets the "created_at" field.

func (*BlockUpdateOne) SetHash added in v0.1.7

func (buo *BlockUpdateOne) SetHash(b []byte) *BlockUpdateOne

SetHash sets the "hash" field.

func (*BlockUpdateOne) SetHeight added in v0.1.7

func (buo *BlockUpdateOne) SetHeight(u uint64) *BlockUpdateOne

SetHeight sets the "height" field.

func (*BlockUpdateOne) SetNillableChainID added in v0.1.7

func (buo *BlockUpdateOne) SetNillableChainID(u *uint64) *BlockUpdateOne

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*BlockUpdateOne) SetNillableCreatedAt

func (buo *BlockUpdateOne) SetNillableCreatedAt(t *time.Time) *BlockUpdateOne

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

func (*BlockUpdateOne) SetNillableHeight added in v0.1.7

func (buo *BlockUpdateOne) SetNillableHeight(u *uint64) *BlockUpdateOne

SetNillableHeight sets the "height" field if the given value is not nil.

func (*BlockUpdateOne) SetNillableOffset added in v0.1.7

func (buo *BlockUpdateOne) SetNillableOffset(u *uint64) *BlockUpdateOne

SetNillableOffset sets the "offset" field if the given value is not nil.

func (*BlockUpdateOne) SetNillableTimestamp

func (buo *BlockUpdateOne) SetNillableTimestamp(t *time.Time) *BlockUpdateOne

SetNillableTimestamp sets the "timestamp" field if the given value is not nil.

func (*BlockUpdateOne) SetOffset added in v0.1.7

func (buo *BlockUpdateOne) SetOffset(u uint64) *BlockUpdateOne

SetOffset sets the "offset" field.

func (*BlockUpdateOne) SetTimestamp

func (buo *BlockUpdateOne) SetTimestamp(t time.Time) *BlockUpdateOne

SetTimestamp sets the "timestamp" field.

func (*BlockUpdateOne) Where

func (buo *BlockUpdateOne) Where(ps ...predicate.Block) *BlockUpdateOne

Where appends a list predicates to the BlockUpdate builder.

type Blocks

type Blocks []*Block

Blocks is a parsable slice of Block.

type Chain

type Chain struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// ChainID holds the value of the "chain_id" field.
	ChainID uint64 `json:"chain_id,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// Name holds the value of the "name" field.
	Name string `json:"name,omitempty"`
	// contains filtered or unexported fields
}

Chain is the model entity for the Chain schema.

func (*Chain) String

func (c *Chain) String() string

String implements the fmt.Stringer.

func (*Chain) Unwrap

func (c *Chain) Unwrap() *Chain

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

func (c *Chain) Update() *ChainUpdateOne

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

func (*Chain) Value

func (c *Chain) Value(name string) (ent.Value, error)

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

type ChainClient

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

ChainClient is a client for the Chain schema.

func NewChainClient

func NewChainClient(c config) *ChainClient

NewChainClient returns a client for the Chain from the given config.

func (*ChainClient) Create

func (c *ChainClient) Create() *ChainCreate

Create returns a builder for creating a Chain entity.

func (*ChainClient) CreateBulk

func (c *ChainClient) CreateBulk(builders ...*ChainCreate) *ChainCreateBulk

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

func (*ChainClient) Delete

func (c *ChainClient) Delete() *ChainDelete

Delete returns a delete builder for Chain.

func (*ChainClient) DeleteOne

func (c *ChainClient) DeleteOne(ch *Chain) *ChainDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ChainClient) DeleteOneID

func (c *ChainClient) DeleteOneID(id int) *ChainDeleteOne

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

func (*ChainClient) Get

func (c *ChainClient) Get(ctx context.Context, id int) (*Chain, error)

Get returns a Chain entity by its id.

func (*ChainClient) GetX

func (c *ChainClient) GetX(ctx context.Context, id int) *Chain

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

func (*ChainClient) Hooks

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

Hooks returns the client hooks.

func (*ChainClient) Intercept

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

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

func (*ChainClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ChainClient) MapCreateBulk

func (c *ChainClient) MapCreateBulk(slice any, setFunc func(*ChainCreate, int)) *ChainCreateBulk

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

func (*ChainClient) Query

func (c *ChainClient) Query() *ChainQuery

Query returns a query builder for Chain.

func (*ChainClient) Update

func (c *ChainClient) Update() *ChainUpdate

Update returns an update builder for Chain.

func (*ChainClient) UpdateOne

func (c *ChainClient) UpdateOne(ch *Chain) *ChainUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ChainClient) UpdateOneID

func (c *ChainClient) UpdateOneID(id int) *ChainUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ChainClient) Use

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

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

type ChainCreate

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

ChainCreate is the builder for creating a Chain entity.

func (*ChainCreate) Exec

func (cc *ChainCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChainCreate) ExecX

func (cc *ChainCreate) ExecX(ctx context.Context)

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

func (*ChainCreate) Mutation

func (cc *ChainCreate) Mutation() *ChainMutation

Mutation returns the ChainMutation object of the builder.

func (*ChainCreate) Save

func (cc *ChainCreate) Save(ctx context.Context) (*Chain, error)

Save creates the Chain in the database.

func (*ChainCreate) SaveX

func (cc *ChainCreate) SaveX(ctx context.Context) *Chain

SaveX calls Save and panics if Save returns an error.

func (*ChainCreate) SetChainID

func (cc *ChainCreate) SetChainID(u uint64) *ChainCreate

SetChainID sets the "chain_id" field.

func (*ChainCreate) SetCreatedAt

func (cc *ChainCreate) SetCreatedAt(t time.Time) *ChainCreate

SetCreatedAt sets the "created_at" field.

func (*ChainCreate) SetName

func (cc *ChainCreate) SetName(s string) *ChainCreate

SetName sets the "name" field.

func (*ChainCreate) SetNillableCreatedAt

func (cc *ChainCreate) SetNillableCreatedAt(t *time.Time) *ChainCreate

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

type ChainCreateBulk

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

ChainCreateBulk is the builder for creating many Chain entities in bulk.

func (*ChainCreateBulk) Exec

func (ccb *ChainCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ChainCreateBulk) ExecX

func (ccb *ChainCreateBulk) ExecX(ctx context.Context)

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

func (*ChainCreateBulk) Save

func (ccb *ChainCreateBulk) Save(ctx context.Context) ([]*Chain, error)

Save creates the Chain entities in the database.

func (*ChainCreateBulk) SaveX

func (ccb *ChainCreateBulk) SaveX(ctx context.Context) []*Chain

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

type ChainDelete

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

ChainDelete is the builder for deleting a Chain entity.

func (*ChainDelete) Exec

func (cd *ChainDelete) Exec(ctx context.Context) (int, error)

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

func (*ChainDelete) ExecX

func (cd *ChainDelete) ExecX(ctx context.Context) int

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

func (*ChainDelete) Where

func (cd *ChainDelete) Where(ps ...predicate.Chain) *ChainDelete

Where appends a list predicates to the ChainDelete builder.

type ChainDeleteOne

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

ChainDeleteOne is the builder for deleting a single Chain entity.

func (*ChainDeleteOne) Exec

func (cdo *ChainDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ChainDeleteOne) ExecX

func (cdo *ChainDeleteOne) ExecX(ctx context.Context)

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

func (*ChainDeleteOne) Where

func (cdo *ChainDeleteOne) Where(ps ...predicate.Chain) *ChainDeleteOne

Where appends a list predicates to the ChainDelete builder.

type ChainFilter

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

ChainFilter provides a generic filtering capability at runtime for ChainQuery.

func (*ChainFilter) Where

func (f *ChainFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*ChainFilter) WhereChainID

func (f *ChainFilter) WhereChainID(p entql.Uint64P)

WhereChainID applies the entql uint64 predicate on the chain_id field.

func (*ChainFilter) WhereCreatedAt

func (f *ChainFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*ChainFilter) WhereID

func (f *ChainFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*ChainFilter) WhereName

func (f *ChainFilter) WhereName(p entql.StringP)

WhereName applies the entql string predicate on the name field.

type ChainGroupBy

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

ChainGroupBy is the group-by builder for Chain entities.

func (*ChainGroupBy) Aggregate

func (cgb *ChainGroupBy) Aggregate(fns ...AggregateFunc) *ChainGroupBy

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

func (*ChainGroupBy) Bool

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

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

func (*ChainGroupBy) BoolX

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

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

func (*ChainGroupBy) Bools

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

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

func (*ChainGroupBy) BoolsX

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

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

func (*ChainGroupBy) Float64

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

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

func (*ChainGroupBy) Float64X

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

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

func (*ChainGroupBy) Float64s

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

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

func (*ChainGroupBy) Float64sX

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

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

func (*ChainGroupBy) Int

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

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

func (*ChainGroupBy) IntX

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

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

func (*ChainGroupBy) Ints

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

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

func (*ChainGroupBy) IntsX

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

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

func (*ChainGroupBy) Scan

func (cgb *ChainGroupBy) Scan(ctx context.Context, v any) error

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

func (*ChainGroupBy) ScanX

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

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

func (*ChainGroupBy) String

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

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

func (*ChainGroupBy) StringX

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

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

func (*ChainGroupBy) Strings

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

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

func (*ChainGroupBy) StringsX

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

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

type ChainMutation

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

ChainMutation represents an operation that mutates the Chain nodes in the graph.

func (*ChainMutation) AddChainID

func (m *ChainMutation) AddChainID(u int64)

AddChainID adds u to the "chain_id" field.

func (*ChainMutation) AddField

func (m *ChainMutation) 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 (*ChainMutation) AddedChainID

func (m *ChainMutation) AddedChainID() (r int64, exists bool)

AddedChainID returns the value that was added to the "chain_id" field in this mutation.

func (*ChainMutation) AddedEdges

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

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

func (*ChainMutation) AddedField

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

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

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

func (*ChainMutation) AddedIDs

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

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

func (*ChainMutation) ChainID

func (m *ChainMutation) ChainID() (r uint64, exists bool)

ChainID returns the value of the "chain_id" field in the mutation.

func (*ChainMutation) ClearEdge

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

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

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

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

func (*ChainMutation) ClearedFields

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

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

func (ChainMutation) Client

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

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

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

func (*ChainMutation) EdgeCleared

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

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

func (*ChainMutation) Field

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

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

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

func (*ChainMutation) Fields

func (m *ChainMutation) 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 (*ChainMutation) Filter

func (m *ChainMutation) Filter() *ChainFilter

Filter returns an entql.Where implementation to apply filters on the ChainMutation builder.

func (*ChainMutation) ID

func (m *ChainMutation) ID() (id int, exists bool)

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

func (*ChainMutation) IDs

func (m *ChainMutation) IDs(ctx context.Context) ([]int, error)

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

func (*ChainMutation) Name

func (m *ChainMutation) Name() (r string, exists bool)

Name returns the value of the "name" field in the mutation.

func (*ChainMutation) OldChainID

func (m *ChainMutation) OldChainID(ctx context.Context) (v uint64, err error)

OldChainID returns the old "chain_id" field's value of the Chain entity. If the Chain 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 (*ChainMutation) OldCreatedAt

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

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

func (m *ChainMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ChainMutation) OldName

func (m *ChainMutation) OldName(ctx context.Context) (v string, err error)

OldName returns the old "name" field's value of the Chain entity. If the Chain 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 (*ChainMutation) Op

func (m *ChainMutation) Op() Op

Op returns the operation name.

func (*ChainMutation) RemovedEdges

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

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

func (*ChainMutation) RemovedIDs

func (m *ChainMutation) 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 (*ChainMutation) ResetChainID

func (m *ChainMutation) ResetChainID()

ResetChainID resets all changes to the "chain_id" field.

func (*ChainMutation) ResetCreatedAt

func (m *ChainMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ChainMutation) ResetEdge

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

func (m *ChainMutation) 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 (*ChainMutation) ResetName

func (m *ChainMutation) ResetName()

ResetName resets all changes to the "name" field.

func (*ChainMutation) SetChainID

func (m *ChainMutation) SetChainID(u uint64)

SetChainID sets the "chain_id" field.

func (*ChainMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ChainMutation) SetField

func (m *ChainMutation) 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 (*ChainMutation) SetName

func (m *ChainMutation) SetName(s string)

SetName sets the "name" field.

func (*ChainMutation) SetOp

func (m *ChainMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (ChainMutation) Tx

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

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

func (*ChainMutation) Type

func (m *ChainMutation) Type() string

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

func (*ChainMutation) Where

func (m *ChainMutation) Where(ps ...predicate.Chain)

Where appends a list predicates to the ChainMutation builder.

func (*ChainMutation) WhereP

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

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

type ChainQuery

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

ChainQuery is the builder for querying Chain entities.

func (*ChainQuery) Aggregate

func (cq *ChainQuery) Aggregate(fns ...AggregateFunc) *ChainSelect

Aggregate returns a ChainSelect configured with the given aggregations.

func (*ChainQuery) All

func (cq *ChainQuery) All(ctx context.Context) ([]*Chain, error)

All executes the query and returns a list of Chains.

func (*ChainQuery) AllX

func (cq *ChainQuery) AllX(ctx context.Context) []*Chain

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

func (*ChainQuery) Clone

func (cq *ChainQuery) Clone() *ChainQuery

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

func (*ChainQuery) Count

func (cq *ChainQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ChainQuery) CountX

func (cq *ChainQuery) CountX(ctx context.Context) int

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

func (*ChainQuery) Exist

func (cq *ChainQuery) Exist(ctx context.Context) (bool, error)

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

func (*ChainQuery) ExistX

func (cq *ChainQuery) ExistX(ctx context.Context) bool

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

func (*ChainQuery) Filter

func (cq *ChainQuery) Filter() *ChainFilter

Filter returns a Filter implementation to apply filters on the ChainQuery builder.

func (*ChainQuery) First

func (cq *ChainQuery) First(ctx context.Context) (*Chain, error)

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

func (*ChainQuery) FirstID

func (cq *ChainQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ChainQuery) FirstIDX

func (cq *ChainQuery) FirstIDX(ctx context.Context) int

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

func (*ChainQuery) FirstX

func (cq *ChainQuery) FirstX(ctx context.Context) *Chain

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

func (*ChainQuery) GroupBy

func (cq *ChainQuery) GroupBy(field string, fields ...string) *ChainGroupBy

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 {
	ChainID uint64 `json:"chain_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Chain.Query().
	GroupBy(chain.FieldChainID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ChainQuery) IDs

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

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

func (*ChainQuery) IDsX

func (cq *ChainQuery) IDsX(ctx context.Context) []int

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

func (*ChainQuery) Limit

func (cq *ChainQuery) Limit(limit int) *ChainQuery

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

func (*ChainQuery) Offset

func (cq *ChainQuery) Offset(offset int) *ChainQuery

Offset to start from.

func (*ChainQuery) Only

func (cq *ChainQuery) Only(ctx context.Context) (*Chain, error)

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

func (*ChainQuery) OnlyID

func (cq *ChainQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ChainQuery) OnlyIDX

func (cq *ChainQuery) OnlyIDX(ctx context.Context) int

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

func (*ChainQuery) OnlyX

func (cq *ChainQuery) OnlyX(ctx context.Context) *Chain

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

func (*ChainQuery) Order

func (cq *ChainQuery) Order(o ...chain.OrderOption) *ChainQuery

Order specifies how the records should be ordered.

func (*ChainQuery) Select

func (cq *ChainQuery) Select(fields ...string) *ChainSelect

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 {
	ChainID uint64 `json:"chain_id,omitempty"`
}

client.Chain.Query().
	Select(chain.FieldChainID).
	Scan(ctx, &v)

func (*ChainQuery) Unique

func (cq *ChainQuery) Unique(unique bool) *ChainQuery

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

func (cq *ChainQuery) Where(ps ...predicate.Chain) *ChainQuery

Where adds a new predicate for the ChainQuery builder.

type ChainSelect

type ChainSelect struct {
	*ChainQuery
	// contains filtered or unexported fields
}

ChainSelect is the builder for selecting fields of Chain entities.

func (*ChainSelect) Aggregate

func (cs *ChainSelect) Aggregate(fns ...AggregateFunc) *ChainSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ChainSelect) Bool

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

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

func (*ChainSelect) BoolX

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

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

func (*ChainSelect) Bools

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

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

func (*ChainSelect) BoolsX

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

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

func (*ChainSelect) Float64

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

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

func (*ChainSelect) Float64X

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

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

func (*ChainSelect) Float64s

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

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

func (*ChainSelect) Float64sX

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

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

func (*ChainSelect) Int

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

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

func (*ChainSelect) IntX

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

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

func (*ChainSelect) Ints

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

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

func (*ChainSelect) IntsX

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

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

func (*ChainSelect) Scan

func (cs *ChainSelect) Scan(ctx context.Context, v any) error

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

func (*ChainSelect) ScanX

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

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

func (*ChainSelect) String

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

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

func (*ChainSelect) StringX

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

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

func (*ChainSelect) Strings

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

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

func (*ChainSelect) StringsX

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

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

type ChainUpdate

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

ChainUpdate is the builder for updating Chain entities.

func (*ChainUpdate) AddChainID

func (cu *ChainUpdate) AddChainID(u int64) *ChainUpdate

AddChainID adds u to the "chain_id" field.

func (*ChainUpdate) Exec

func (cu *ChainUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ChainUpdate) ExecX

func (cu *ChainUpdate) ExecX(ctx context.Context)

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

func (*ChainUpdate) Mutation

func (cu *ChainUpdate) Mutation() *ChainMutation

Mutation returns the ChainMutation object of the builder.

func (*ChainUpdate) Save

func (cu *ChainUpdate) Save(ctx context.Context) (int, error)

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

func (*ChainUpdate) SaveX

func (cu *ChainUpdate) SaveX(ctx context.Context) int

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

func (*ChainUpdate) SetChainID

func (cu *ChainUpdate) SetChainID(u uint64) *ChainUpdate

SetChainID sets the "chain_id" field.

func (*ChainUpdate) SetCreatedAt

func (cu *ChainUpdate) SetCreatedAt(t time.Time) *ChainUpdate

SetCreatedAt sets the "created_at" field.

func (*ChainUpdate) SetName

func (cu *ChainUpdate) SetName(s string) *ChainUpdate

SetName sets the "name" field.

func (*ChainUpdate) SetNillableChainID

func (cu *ChainUpdate) SetNillableChainID(u *uint64) *ChainUpdate

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*ChainUpdate) SetNillableCreatedAt

func (cu *ChainUpdate) SetNillableCreatedAt(t *time.Time) *ChainUpdate

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

func (*ChainUpdate) SetNillableName

func (cu *ChainUpdate) SetNillableName(s *string) *ChainUpdate

SetNillableName sets the "name" field if the given value is not nil.

func (*ChainUpdate) Where

func (cu *ChainUpdate) Where(ps ...predicate.Chain) *ChainUpdate

Where appends a list predicates to the ChainUpdate builder.

type ChainUpdateOne

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

ChainUpdateOne is the builder for updating a single Chain entity.

func (*ChainUpdateOne) AddChainID

func (cuo *ChainUpdateOne) AddChainID(u int64) *ChainUpdateOne

AddChainID adds u to the "chain_id" field.

func (*ChainUpdateOne) Exec

func (cuo *ChainUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ChainUpdateOne) ExecX

func (cuo *ChainUpdateOne) ExecX(ctx context.Context)

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

func (*ChainUpdateOne) Mutation

func (cuo *ChainUpdateOne) Mutation() *ChainMutation

Mutation returns the ChainMutation object of the builder.

func (*ChainUpdateOne) Save

func (cuo *ChainUpdateOne) Save(ctx context.Context) (*Chain, error)

Save executes the query and returns the updated Chain entity.

func (*ChainUpdateOne) SaveX

func (cuo *ChainUpdateOne) SaveX(ctx context.Context) *Chain

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

func (*ChainUpdateOne) Select

func (cuo *ChainUpdateOne) Select(field string, fields ...string) *ChainUpdateOne

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

func (*ChainUpdateOne) SetChainID

func (cuo *ChainUpdateOne) SetChainID(u uint64) *ChainUpdateOne

SetChainID sets the "chain_id" field.

func (*ChainUpdateOne) SetCreatedAt

func (cuo *ChainUpdateOne) SetCreatedAt(t time.Time) *ChainUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ChainUpdateOne) SetName

func (cuo *ChainUpdateOne) SetName(s string) *ChainUpdateOne

SetName sets the "name" field.

func (*ChainUpdateOne) SetNillableChainID

func (cuo *ChainUpdateOne) SetNillableChainID(u *uint64) *ChainUpdateOne

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*ChainUpdateOne) SetNillableCreatedAt

func (cuo *ChainUpdateOne) SetNillableCreatedAt(t *time.Time) *ChainUpdateOne

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

func (*ChainUpdateOne) SetNillableName

func (cuo *ChainUpdateOne) SetNillableName(s *string) *ChainUpdateOne

SetNillableName sets the "name" field if the given value is not nil.

func (*ChainUpdateOne) Where

func (cuo *ChainUpdateOne) Where(ps ...predicate.Chain) *ChainUpdateOne

Where appends a list predicates to the ChainUpdate builder.

type Chains

type Chains []*Chain

Chains is a parsable slice of Chain.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Block is the client for interacting with the Block builders.
	Block *BlockClient
	// Chain is the client for interacting with the Chain builders.
	Chain *ChainClient
	// Msg is the client for interacting with the Msg builders.
	Msg *MsgClient
	// Receipt is the client for interacting with the Receipt builders.
	Receipt *ReceiptClient
	// XProviderCursor is the client for interacting with the XProviderCursor builders.
	XProviderCursor *XProviderCursorClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) DB added in v0.1.7

func (c *Client) DB() *sql.DB

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Block.
	Query().
	Count(ctx)

func (*Client) Intercept

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

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

func (*Client) Mutate

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

Mutate implements the ent.Mutator interface.

func (*Client) Tx

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

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

func (*Client) Use

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

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

type CommitFunc

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

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

func (CommitFunc) Commit

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

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

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

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

type Committer

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

Committer is the interface that wraps the Commit method.

type ConstraintError

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

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

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Hook

type Hook = ent.Hook

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

type InterceptFunc

type InterceptFunc = ent.InterceptFunc

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

type Interceptor

type Interceptor = ent.Interceptor

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

type Msg

type Msg struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// Sender holds the value of the "sender" field.
	Sender []byte `json:"sender,omitempty"`
	// To holds the value of the "to" field.
	To []byte `json:"to,omitempty"`
	// Data holds the value of the "data" field.
	Data []byte `json:"data,omitempty"`
	// GasLimit holds the value of the "gas_limit" field.
	GasLimit uint64 `json:"gas_limit,omitempty"`
	// SourceChainID holds the value of the "source_chain_id" field.
	SourceChainID uint64 `json:"source_chain_id,omitempty"`
	// DestChainID holds the value of the "dest_chain_id" field.
	DestChainID uint64 `json:"dest_chain_id,omitempty"`
	// Offset holds the value of the "offset" field.
	Offset uint64 `json:"offset,omitempty"`
	// TxHash holds the value of the "tx_hash" field.
	TxHash []byte `json:"tx_hash,omitempty"`
	// ReceiptHash holds the value of the "receipt_hash" field.
	ReceiptHash []byte `json:"receipt_hash,omitempty"`
	// Status holds the value of the "status" field.
	Status string `json:"status,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 MsgQuery when eager-loading is set.
	Edges MsgEdges `json:"edges"`
	// contains filtered or unexported fields
}

Msg is the model entity for the Msg schema.

func (*Msg) QueryBlock

func (m *Msg) QueryBlock() *BlockQuery

QueryBlock queries the "block" edge of the Msg entity.

func (*Msg) QueryReceipts added in v0.1.3

func (m *Msg) QueryReceipts() *ReceiptQuery

QueryReceipts queries the "receipts" edge of the Msg entity.

func (*Msg) String

func (m *Msg) String() string

String implements the fmt.Stringer.

func (*Msg) Unwrap

func (m *Msg) Unwrap() *Msg

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

func (m *Msg) Update() *MsgUpdateOne

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

func (*Msg) Value

func (m *Msg) Value(name string) (ent.Value, error)

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

type MsgClient

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

MsgClient is a client for the Msg schema.

func NewMsgClient

func NewMsgClient(c config) *MsgClient

NewMsgClient returns a client for the Msg from the given config.

func (*MsgClient) Create

func (c *MsgClient) Create() *MsgCreate

Create returns a builder for creating a Msg entity.

func (*MsgClient) CreateBulk

func (c *MsgClient) CreateBulk(builders ...*MsgCreate) *MsgCreateBulk

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

func (*MsgClient) Delete

func (c *MsgClient) Delete() *MsgDelete

Delete returns a delete builder for Msg.

func (*MsgClient) DeleteOne

func (c *MsgClient) DeleteOne(m *Msg) *MsgDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*MsgClient) DeleteOneID

func (c *MsgClient) DeleteOneID(id int) *MsgDeleteOne

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

func (*MsgClient) Get

func (c *MsgClient) Get(ctx context.Context, id int) (*Msg, error)

Get returns a Msg entity by its id.

func (*MsgClient) GetX

func (c *MsgClient) GetX(ctx context.Context, id int) *Msg

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

func (*MsgClient) Hooks

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

Hooks returns the client hooks.

func (*MsgClient) Intercept

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

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

func (*MsgClient) Interceptors

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

Interceptors returns the client interceptors.

func (*MsgClient) MapCreateBulk

func (c *MsgClient) MapCreateBulk(slice any, setFunc func(*MsgCreate, int)) *MsgCreateBulk

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

func (*MsgClient) Query

func (c *MsgClient) Query() *MsgQuery

Query returns a query builder for Msg.

func (*MsgClient) QueryBlock

func (c *MsgClient) QueryBlock(m *Msg) *BlockQuery

QueryBlock queries the block edge of a Msg.

func (*MsgClient) QueryReceipts added in v0.1.3

func (c *MsgClient) QueryReceipts(m *Msg) *ReceiptQuery

QueryReceipts queries the receipts edge of a Msg.

func (*MsgClient) Update

func (c *MsgClient) Update() *MsgUpdate

Update returns an update builder for Msg.

func (*MsgClient) UpdateOne

func (c *MsgClient) UpdateOne(m *Msg) *MsgUpdateOne

UpdateOne returns an update builder for the given entity.

func (*MsgClient) UpdateOneID

func (c *MsgClient) UpdateOneID(id int) *MsgUpdateOne

UpdateOneID returns an update builder for the given id.

func (*MsgClient) Use

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

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

type MsgCreate

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

MsgCreate is the builder for creating a Msg entity.

func (*MsgCreate) AddBlock added in v0.1.7

func (mc *MsgCreate) AddBlock(b ...*Block) *MsgCreate

AddBlock adds the "block" edges to the Block entity.

func (*MsgCreate) AddBlockIDs added in v0.1.7

func (mc *MsgCreate) AddBlockIDs(ids ...int) *MsgCreate

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

func (*MsgCreate) AddReceiptIDs added in v0.1.3

func (mc *MsgCreate) AddReceiptIDs(ids ...int) *MsgCreate

AddReceiptIDs adds the "receipts" edge to the Receipt entity by IDs.

func (*MsgCreate) AddReceipts added in v0.1.3

func (mc *MsgCreate) AddReceipts(r ...*Receipt) *MsgCreate

AddReceipts adds the "receipts" edges to the Receipt entity.

func (*MsgCreate) Exec

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

Exec executes the query.

func (*MsgCreate) ExecX

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

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

func (*MsgCreate) Mutation

func (mc *MsgCreate) Mutation() *MsgMutation

Mutation returns the MsgMutation object of the builder.

func (*MsgCreate) Save

func (mc *MsgCreate) Save(ctx context.Context) (*Msg, error)

Save creates the Msg in the database.

func (*MsgCreate) SaveX

func (mc *MsgCreate) SaveX(ctx context.Context) *Msg

SaveX calls Save and panics if Save returns an error.

func (*MsgCreate) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MsgCreate) SetData

func (mc *MsgCreate) SetData(b []byte) *MsgCreate

SetData sets the "data" field.

func (*MsgCreate) SetDestChainID

func (mc *MsgCreate) SetDestChainID(u uint64) *MsgCreate

SetDestChainID sets the "dest_chain_id" field.

func (*MsgCreate) SetGasLimit added in v0.1.7

func (mc *MsgCreate) SetGasLimit(u uint64) *MsgCreate

SetGasLimit sets the "gas_limit" field.

func (*MsgCreate) SetNillableCreatedAt

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

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

func (*MsgCreate) SetNillableStatus added in v0.1.4

func (mc *MsgCreate) SetNillableStatus(s *string) *MsgCreate

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

func (*MsgCreate) SetOffset added in v0.1.7

func (mc *MsgCreate) SetOffset(u uint64) *MsgCreate

SetOffset sets the "offset" field.

func (*MsgCreate) SetReceiptHash added in v0.1.4

func (mc *MsgCreate) SetReceiptHash(b []byte) *MsgCreate

SetReceiptHash sets the "receipt_hash" field.

func (*MsgCreate) SetSender added in v0.1.7

func (mc *MsgCreate) SetSender(b []byte) *MsgCreate

SetSender sets the "sender" field.

func (*MsgCreate) SetSourceChainID

func (mc *MsgCreate) SetSourceChainID(u uint64) *MsgCreate

SetSourceChainID sets the "source_chain_id" field.

func (*MsgCreate) SetStatus added in v0.1.4

func (mc *MsgCreate) SetStatus(s string) *MsgCreate

SetStatus sets the "status" field.

func (*MsgCreate) SetTo added in v0.1.7

func (mc *MsgCreate) SetTo(b []byte) *MsgCreate

SetTo sets the "to" field.

func (*MsgCreate) SetTxHash

func (mc *MsgCreate) SetTxHash(b []byte) *MsgCreate

SetTxHash sets the "tx_hash" field.

type MsgCreateBulk

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

MsgCreateBulk is the builder for creating many Msg entities in bulk.

func (*MsgCreateBulk) Exec

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

Exec executes the query.

func (*MsgCreateBulk) ExecX

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

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

func (*MsgCreateBulk) Save

func (mcb *MsgCreateBulk) Save(ctx context.Context) ([]*Msg, error)

Save creates the Msg entities in the database.

func (*MsgCreateBulk) SaveX

func (mcb *MsgCreateBulk) SaveX(ctx context.Context) []*Msg

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

type MsgDelete

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

MsgDelete is the builder for deleting a Msg entity.

func (*MsgDelete) Exec

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

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

func (*MsgDelete) ExecX

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

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

func (*MsgDelete) Where

func (md *MsgDelete) Where(ps ...predicate.Msg) *MsgDelete

Where appends a list predicates to the MsgDelete builder.

type MsgDeleteOne

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

MsgDeleteOne is the builder for deleting a single Msg entity.

func (*MsgDeleteOne) Exec

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

Exec executes the deletion query.

func (*MsgDeleteOne) ExecX

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

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

func (*MsgDeleteOne) Where

func (mdo *MsgDeleteOne) Where(ps ...predicate.Msg) *MsgDeleteOne

Where appends a list predicates to the MsgDelete builder.

type MsgEdges

type MsgEdges struct {
	// Block holds the value of the block edge.
	Block []*Block `json:"block,omitempty"`
	// Receipts holds the value of the receipts edge.
	Receipts []*Receipt `json:"receipts,omitempty"`
	// contains filtered or unexported fields
}

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

func (MsgEdges) BlockOrErr

func (e MsgEdges) BlockOrErr() ([]*Block, error)

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

func (MsgEdges) ReceiptsOrErr added in v0.1.3

func (e MsgEdges) ReceiptsOrErr() ([]*Receipt, error)

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

type MsgFilter

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

MsgFilter provides a generic filtering capability at runtime for MsgQuery.

func (*MsgFilter) Where

func (f *MsgFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*MsgFilter) WhereCreatedAt

func (f *MsgFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*MsgFilter) WhereData

func (f *MsgFilter) WhereData(p entql.BytesP)

WhereData applies the entql []byte predicate on the data field.

func (*MsgFilter) WhereDestChainID

func (f *MsgFilter) WhereDestChainID(p entql.Uint64P)

WhereDestChainID applies the entql uint64 predicate on the dest_chain_id field.

func (*MsgFilter) WhereGasLimit added in v0.1.7

func (f *MsgFilter) WhereGasLimit(p entql.Uint64P)

WhereGasLimit applies the entql uint64 predicate on the gas_limit field.

func (*MsgFilter) WhereHasBlock

func (f *MsgFilter) WhereHasBlock()

WhereHasBlock applies a predicate to check if query has an edge block.

func (*MsgFilter) WhereHasBlockWith

func (f *MsgFilter) WhereHasBlockWith(preds ...predicate.Block)

WhereHasBlockWith applies a predicate to check if query has an edge block with a given conditions (other predicates).

func (*MsgFilter) WhereHasReceipts added in v0.1.3

func (f *MsgFilter) WhereHasReceipts()

WhereHasReceipts applies a predicate to check if query has an edge receipts.

func (*MsgFilter) WhereHasReceiptsWith added in v0.1.3

func (f *MsgFilter) WhereHasReceiptsWith(preds ...predicate.Receipt)

WhereHasReceiptsWith applies a predicate to check if query has an edge receipts with a given conditions (other predicates).

func (*MsgFilter) WhereID

func (f *MsgFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*MsgFilter) WhereOffset added in v0.1.7

func (f *MsgFilter) WhereOffset(p entql.Uint64P)

WhereOffset applies the entql uint64 predicate on the offset field.

func (*MsgFilter) WhereReceiptHash added in v0.1.4

func (f *MsgFilter) WhereReceiptHash(p entql.BytesP)

WhereReceiptHash applies the entql []byte predicate on the receipt_hash field.

func (*MsgFilter) WhereSender added in v0.1.7

func (f *MsgFilter) WhereSender(p entql.BytesP)

WhereSender applies the entql []byte predicate on the sender field.

func (*MsgFilter) WhereSourceChainID

func (f *MsgFilter) WhereSourceChainID(p entql.Uint64P)

WhereSourceChainID applies the entql uint64 predicate on the source_chain_id field.

func (*MsgFilter) WhereStatus added in v0.1.4

func (f *MsgFilter) WhereStatus(p entql.StringP)

WhereStatus applies the entql string predicate on the status field.

func (*MsgFilter) WhereTo added in v0.1.7

func (f *MsgFilter) WhereTo(p entql.BytesP)

WhereTo applies the entql []byte predicate on the to field.

func (*MsgFilter) WhereTxHash

func (f *MsgFilter) WhereTxHash(p entql.BytesP)

WhereTxHash applies the entql []byte predicate on the tx_hash field.

type MsgGroupBy

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

MsgGroupBy is the group-by builder for Msg entities.

func (*MsgGroupBy) Aggregate

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

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

func (*MsgGroupBy) Bool

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

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

func (*MsgGroupBy) BoolX

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

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

func (*MsgGroupBy) Bools

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

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

func (*MsgGroupBy) BoolsX

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

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

func (*MsgGroupBy) Float64

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

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

func (*MsgGroupBy) Float64X

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

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

func (*MsgGroupBy) Float64s

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

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

func (*MsgGroupBy) Float64sX

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

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

func (*MsgGroupBy) Int

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

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

func (*MsgGroupBy) IntX

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

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

func (*MsgGroupBy) Ints

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

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

func (*MsgGroupBy) IntsX

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

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

func (*MsgGroupBy) Scan

func (mgb *MsgGroupBy) Scan(ctx context.Context, v any) error

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

func (*MsgGroupBy) ScanX

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

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

func (*MsgGroupBy) String

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

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

func (*MsgGroupBy) StringX

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

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

func (*MsgGroupBy) Strings

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

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

func (*MsgGroupBy) StringsX

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

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

type MsgMutation

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

MsgMutation represents an operation that mutates the Msg nodes in the graph.

func (*MsgMutation) AddBlockIDs added in v0.1.7

func (m *MsgMutation) AddBlockIDs(ids ...int)

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

func (*MsgMutation) AddDestChainID

func (m *MsgMutation) AddDestChainID(u int64)

AddDestChainID adds u to the "dest_chain_id" field.

func (*MsgMutation) AddField

func (m *MsgMutation) 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 (*MsgMutation) AddGasLimit added in v0.1.7

func (m *MsgMutation) AddGasLimit(u int64)

AddGasLimit adds u to the "gas_limit" field.

func (*MsgMutation) AddOffset added in v0.1.7

func (m *MsgMutation) AddOffset(u int64)

AddOffset adds u to the "offset" field.

func (*MsgMutation) AddReceiptIDs added in v0.1.3

func (m *MsgMutation) AddReceiptIDs(ids ...int)

AddReceiptIDs adds the "receipts" edge to the Receipt entity by ids.

func (*MsgMutation) AddSourceChainID

func (m *MsgMutation) AddSourceChainID(u int64)

AddSourceChainID adds u to the "source_chain_id" field.

func (*MsgMutation) AddedDestChainID

func (m *MsgMutation) AddedDestChainID() (r int64, exists bool)

AddedDestChainID returns the value that was added to the "dest_chain_id" field in this mutation.

func (*MsgMutation) AddedEdges

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

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

func (*MsgMutation) AddedField

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

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

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

func (*MsgMutation) AddedGasLimit added in v0.1.7

func (m *MsgMutation) AddedGasLimit() (r int64, exists bool)

AddedGasLimit returns the value that was added to the "gas_limit" field in this mutation.

func (*MsgMutation) AddedIDs

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

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

func (*MsgMutation) AddedOffset added in v0.1.7

func (m *MsgMutation) AddedOffset() (r int64, exists bool)

AddedOffset returns the value that was added to the "offset" field in this mutation.

func (*MsgMutation) AddedSourceChainID

func (m *MsgMutation) AddedSourceChainID() (r int64, exists bool)

AddedSourceChainID returns the value that was added to the "source_chain_id" field in this mutation.

func (*MsgMutation) BlockCleared

func (m *MsgMutation) BlockCleared() bool

BlockCleared reports if the "block" edge to the Block entity was cleared.

func (*MsgMutation) BlockIDs

func (m *MsgMutation) BlockIDs() (ids []int)

BlockIDs returns the "block" edge IDs in the mutation.

func (*MsgMutation) ClearBlock

func (m *MsgMutation) ClearBlock()

ClearBlock clears the "block" edge to the Block entity.

func (*MsgMutation) ClearEdge

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

func (m *MsgMutation) 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 (*MsgMutation) ClearReceiptHash added in v0.1.4

func (m *MsgMutation) ClearReceiptHash()

ClearReceiptHash clears the value of the "receipt_hash" field.

func (*MsgMutation) ClearReceipts added in v0.1.3

func (m *MsgMutation) ClearReceipts()

ClearReceipts clears the "receipts" edge to the Receipt entity.

func (*MsgMutation) ClearStatus added in v0.1.4

func (m *MsgMutation) ClearStatus()

ClearStatus clears the value of the "status" field.

func (*MsgMutation) ClearedEdges

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

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

func (*MsgMutation) ClearedFields

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

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

func (MsgMutation) Client

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

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

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

func (*MsgMutation) Data

func (m *MsgMutation) Data() (r []byte, exists bool)

Data returns the value of the "data" field in the mutation.

func (*MsgMutation) DestChainID

func (m *MsgMutation) DestChainID() (r uint64, exists bool)

DestChainID returns the value of the "dest_chain_id" field in the mutation.

func (*MsgMutation) EdgeCleared

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

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

func (*MsgMutation) Field

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

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

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

func (*MsgMutation) Fields

func (m *MsgMutation) 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 (*MsgMutation) Filter

func (m *MsgMutation) Filter() *MsgFilter

Filter returns an entql.Where implementation to apply filters on the MsgMutation builder.

func (*MsgMutation) GasLimit added in v0.1.7

func (m *MsgMutation) GasLimit() (r uint64, exists bool)

GasLimit returns the value of the "gas_limit" field in the mutation.

func (*MsgMutation) ID

func (m *MsgMutation) ID() (id int, exists bool)

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

func (*MsgMutation) IDs

func (m *MsgMutation) IDs(ctx context.Context) ([]int, error)

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

func (*MsgMutation) Offset added in v0.1.7

func (m *MsgMutation) Offset() (r uint64, exists bool)

Offset returns the value of the "offset" field in the mutation.

func (*MsgMutation) OldCreatedAt

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

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

func (m *MsgMutation) OldData(ctx context.Context) (v []byte, err error)

OldData returns the old "data" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldDestChainID

func (m *MsgMutation) OldDestChainID(ctx context.Context) (v uint64, err error)

OldDestChainID returns the old "dest_chain_id" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldField

func (m *MsgMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*MsgMutation) OldGasLimit added in v0.1.7

func (m *MsgMutation) OldGasLimit(ctx context.Context) (v uint64, err error)

OldGasLimit returns the old "gas_limit" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldOffset added in v0.1.7

func (m *MsgMutation) OldOffset(ctx context.Context) (v uint64, err error)

OldOffset returns the old "offset" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldReceiptHash added in v0.1.4

func (m *MsgMutation) OldReceiptHash(ctx context.Context) (v []byte, err error)

OldReceiptHash returns the old "receipt_hash" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldSender added in v0.1.7

func (m *MsgMutation) OldSender(ctx context.Context) (v []byte, err error)

OldSender returns the old "sender" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldSourceChainID

func (m *MsgMutation) OldSourceChainID(ctx context.Context) (v uint64, err error)

OldSourceChainID returns the old "source_chain_id" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldStatus added in v0.1.4

func (m *MsgMutation) OldStatus(ctx context.Context) (v string, err error)

OldStatus returns the old "status" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldTo added in v0.1.7

func (m *MsgMutation) OldTo(ctx context.Context) (v []byte, err error)

OldTo returns the old "to" field's value of the Msg entity. If the Msg 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 (*MsgMutation) OldTxHash

func (m *MsgMutation) OldTxHash(ctx context.Context) (v []byte, err error)

OldTxHash returns the old "tx_hash" field's value of the Msg entity. If the Msg 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 (*MsgMutation) Op

func (m *MsgMutation) Op() Op

Op returns the operation name.

func (*MsgMutation) ReceiptHash added in v0.1.4

func (m *MsgMutation) ReceiptHash() (r []byte, exists bool)

ReceiptHash returns the value of the "receipt_hash" field in the mutation.

func (*MsgMutation) ReceiptHashCleared added in v0.1.4

func (m *MsgMutation) ReceiptHashCleared() bool

ReceiptHashCleared returns if the "receipt_hash" field was cleared in this mutation.

func (*MsgMutation) ReceiptsCleared added in v0.1.3

func (m *MsgMutation) ReceiptsCleared() bool

ReceiptsCleared reports if the "receipts" edge to the Receipt entity was cleared.

func (*MsgMutation) ReceiptsIDs added in v0.1.3

func (m *MsgMutation) ReceiptsIDs() (ids []int)

ReceiptsIDs returns the "receipts" edge IDs in the mutation.

func (*MsgMutation) RemoveBlockIDs added in v0.1.7

func (m *MsgMutation) RemoveBlockIDs(ids ...int)

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

func (*MsgMutation) RemoveReceiptIDs added in v0.1.3

func (m *MsgMutation) RemoveReceiptIDs(ids ...int)

RemoveReceiptIDs removes the "receipts" edge to the Receipt entity by IDs.

func (*MsgMutation) RemovedBlockIDs added in v0.1.7

func (m *MsgMutation) RemovedBlockIDs() (ids []int)

RemovedBlock returns the removed IDs of the "block" edge to the Block entity.

func (*MsgMutation) RemovedEdges

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

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

func (*MsgMutation) RemovedIDs

func (m *MsgMutation) 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 (*MsgMutation) RemovedReceiptsIDs added in v0.1.3

func (m *MsgMutation) RemovedReceiptsIDs() (ids []int)

RemovedReceipts returns the removed IDs of the "receipts" edge to the Receipt entity.

func (*MsgMutation) ResetBlock

func (m *MsgMutation) ResetBlock()

ResetBlock resets all changes to the "block" edge.

func (*MsgMutation) ResetCreatedAt

func (m *MsgMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*MsgMutation) ResetData

func (m *MsgMutation) ResetData()

ResetData resets all changes to the "data" field.

func (*MsgMutation) ResetDestChainID

func (m *MsgMutation) ResetDestChainID()

ResetDestChainID resets all changes to the "dest_chain_id" field.

func (*MsgMutation) ResetEdge

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

func (m *MsgMutation) 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 (*MsgMutation) ResetGasLimit added in v0.1.7

func (m *MsgMutation) ResetGasLimit()

ResetGasLimit resets all changes to the "gas_limit" field.

func (*MsgMutation) ResetOffset added in v0.1.7

func (m *MsgMutation) ResetOffset()

ResetOffset resets all changes to the "offset" field.

func (*MsgMutation) ResetReceiptHash added in v0.1.4

func (m *MsgMutation) ResetReceiptHash()

ResetReceiptHash resets all changes to the "receipt_hash" field.

func (*MsgMutation) ResetReceipts added in v0.1.3

func (m *MsgMutation) ResetReceipts()

ResetReceipts resets all changes to the "receipts" edge.

func (*MsgMutation) ResetSender added in v0.1.7

func (m *MsgMutation) ResetSender()

ResetSender resets all changes to the "sender" field.

func (*MsgMutation) ResetSourceChainID

func (m *MsgMutation) ResetSourceChainID()

ResetSourceChainID resets all changes to the "source_chain_id" field.

func (*MsgMutation) ResetStatus added in v0.1.4

func (m *MsgMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*MsgMutation) ResetTo added in v0.1.7

func (m *MsgMutation) ResetTo()

ResetTo resets all changes to the "to" field.

func (*MsgMutation) ResetTxHash

func (m *MsgMutation) ResetTxHash()

ResetTxHash resets all changes to the "tx_hash" field.

func (*MsgMutation) Sender added in v0.1.7

func (m *MsgMutation) Sender() (r []byte, exists bool)

Sender returns the value of the "sender" field in the mutation.

func (*MsgMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*MsgMutation) SetData

func (m *MsgMutation) SetData(b []byte)

SetData sets the "data" field.

func (*MsgMutation) SetDestChainID

func (m *MsgMutation) SetDestChainID(u uint64)

SetDestChainID sets the "dest_chain_id" field.

func (*MsgMutation) SetField

func (m *MsgMutation) 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 (*MsgMutation) SetGasLimit added in v0.1.7

func (m *MsgMutation) SetGasLimit(u uint64)

SetGasLimit sets the "gas_limit" field.

func (*MsgMutation) SetOffset added in v0.1.7

func (m *MsgMutation) SetOffset(u uint64)

SetOffset sets the "offset" field.

func (*MsgMutation) SetOp

func (m *MsgMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*MsgMutation) SetReceiptHash added in v0.1.4

func (m *MsgMutation) SetReceiptHash(b []byte)

SetReceiptHash sets the "receipt_hash" field.

func (*MsgMutation) SetSender added in v0.1.7

func (m *MsgMutation) SetSender(b []byte)

SetSender sets the "sender" field.

func (*MsgMutation) SetSourceChainID

func (m *MsgMutation) SetSourceChainID(u uint64)

SetSourceChainID sets the "source_chain_id" field.

func (*MsgMutation) SetStatus added in v0.1.4

func (m *MsgMutation) SetStatus(s string)

SetStatus sets the "status" field.

func (*MsgMutation) SetTo added in v0.1.7

func (m *MsgMutation) SetTo(b []byte)

SetTo sets the "to" field.

func (*MsgMutation) SetTxHash

func (m *MsgMutation) SetTxHash(b []byte)

SetTxHash sets the "tx_hash" field.

func (*MsgMutation) SourceChainID

func (m *MsgMutation) SourceChainID() (r uint64, exists bool)

SourceChainID returns the value of the "source_chain_id" field in the mutation.

func (*MsgMutation) Status added in v0.1.4

func (m *MsgMutation) Status() (r string, exists bool)

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

func (*MsgMutation) StatusCleared added in v0.1.4

func (m *MsgMutation) StatusCleared() bool

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

func (*MsgMutation) To added in v0.1.7

func (m *MsgMutation) To() (r []byte, exists bool)

To returns the value of the "to" field in the mutation.

func (MsgMutation) Tx

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

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

func (*MsgMutation) TxHash

func (m *MsgMutation) TxHash() (r []byte, exists bool)

TxHash returns the value of the "tx_hash" field in the mutation.

func (*MsgMutation) Type

func (m *MsgMutation) Type() string

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

func (*MsgMutation) Where

func (m *MsgMutation) Where(ps ...predicate.Msg)

Where appends a list predicates to the MsgMutation builder.

func (*MsgMutation) WhereP

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

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

type MsgQuery

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

MsgQuery is the builder for querying Msg entities.

func (*MsgQuery) Aggregate

func (mq *MsgQuery) Aggregate(fns ...AggregateFunc) *MsgSelect

Aggregate returns a MsgSelect configured with the given aggregations.

func (*MsgQuery) All

func (mq *MsgQuery) All(ctx context.Context) ([]*Msg, error)

All executes the query and returns a list of Msgs.

func (*MsgQuery) AllX

func (mq *MsgQuery) AllX(ctx context.Context) []*Msg

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

func (*MsgQuery) Clone

func (mq *MsgQuery) Clone() *MsgQuery

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

func (*MsgQuery) Count

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

Count returns the count of the given query.

func (*MsgQuery) CountX

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

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

func (*MsgQuery) Exist

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

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

func (*MsgQuery) ExistX

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

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

func (*MsgQuery) Filter

func (mq *MsgQuery) Filter() *MsgFilter

Filter returns a Filter implementation to apply filters on the MsgQuery builder.

func (*MsgQuery) First

func (mq *MsgQuery) First(ctx context.Context) (*Msg, error)

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

func (*MsgQuery) FirstID

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

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

func (*MsgQuery) FirstIDX

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

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

func (*MsgQuery) FirstX

func (mq *MsgQuery) FirstX(ctx context.Context) *Msg

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

func (*MsgQuery) GroupBy

func (mq *MsgQuery) GroupBy(field string, fields ...string) *MsgGroupBy

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 {
	Sender []byte `json:"sender,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Msg.Query().
	GroupBy(msg.FieldSender).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*MsgQuery) IDs

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

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

func (*MsgQuery) IDsX

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

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

func (*MsgQuery) Limit

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

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

func (*MsgQuery) Offset

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

Offset to start from.

func (*MsgQuery) Only

func (mq *MsgQuery) Only(ctx context.Context) (*Msg, error)

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

func (*MsgQuery) OnlyID

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

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

func (*MsgQuery) OnlyIDX

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

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

func (*MsgQuery) OnlyX

func (mq *MsgQuery) OnlyX(ctx context.Context) *Msg

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

func (*MsgQuery) Order

func (mq *MsgQuery) Order(o ...msg.OrderOption) *MsgQuery

Order specifies how the records should be ordered.

func (*MsgQuery) QueryBlock

func (mq *MsgQuery) QueryBlock() *BlockQuery

QueryBlock chains the current query on the "block" edge.

func (*MsgQuery) QueryReceipts added in v0.1.3

func (mq *MsgQuery) QueryReceipts() *ReceiptQuery

QueryReceipts chains the current query on the "receipts" edge.

func (*MsgQuery) Select

func (mq *MsgQuery) Select(fields ...string) *MsgSelect

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 {
	Sender []byte `json:"sender,omitempty"`
}

client.Msg.Query().
	Select(msg.FieldSender).
	Scan(ctx, &v)

func (*MsgQuery) Unique

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

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

func (mq *MsgQuery) Where(ps ...predicate.Msg) *MsgQuery

Where adds a new predicate for the MsgQuery builder.

func (*MsgQuery) WithBlock

func (mq *MsgQuery) WithBlock(opts ...func(*BlockQuery)) *MsgQuery

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

func (*MsgQuery) WithReceipts added in v0.1.3

func (mq *MsgQuery) WithReceipts(opts ...func(*ReceiptQuery)) *MsgQuery

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

type MsgSelect

type MsgSelect struct {
	*MsgQuery
	// contains filtered or unexported fields
}

MsgSelect is the builder for selecting fields of Msg entities.

func (*MsgSelect) Aggregate

func (ms *MsgSelect) Aggregate(fns ...AggregateFunc) *MsgSelect

Aggregate adds the given aggregation functions to the selector query.

func (*MsgSelect) Bool

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

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

func (*MsgSelect) BoolX

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

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

func (*MsgSelect) Bools

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

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

func (*MsgSelect) BoolsX

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

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

func (*MsgSelect) Float64

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

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

func (*MsgSelect) Float64X

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

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

func (*MsgSelect) Float64s

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

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

func (*MsgSelect) Float64sX

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

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

func (*MsgSelect) Int

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

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

func (*MsgSelect) IntX

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

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

func (*MsgSelect) Ints

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

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

func (*MsgSelect) IntsX

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

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

func (*MsgSelect) Scan

func (ms *MsgSelect) Scan(ctx context.Context, v any) error

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

func (*MsgSelect) ScanX

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

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

func (*MsgSelect) String

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

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

func (*MsgSelect) StringX

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

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

func (*MsgSelect) Strings

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

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

func (*MsgSelect) StringsX

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

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

type MsgUpdate

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

MsgUpdate is the builder for updating Msg entities.

func (*MsgUpdate) AddBlock added in v0.1.7

func (mu *MsgUpdate) AddBlock(b ...*Block) *MsgUpdate

AddBlock adds the "block" edges to the Block entity.

func (*MsgUpdate) AddBlockIDs added in v0.1.7

func (mu *MsgUpdate) AddBlockIDs(ids ...int) *MsgUpdate

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

func (*MsgUpdate) AddDestChainID

func (mu *MsgUpdate) AddDestChainID(u int64) *MsgUpdate

AddDestChainID adds u to the "dest_chain_id" field.

func (*MsgUpdate) AddGasLimit added in v0.1.7

func (mu *MsgUpdate) AddGasLimit(u int64) *MsgUpdate

AddGasLimit adds u to the "gas_limit" field.

func (*MsgUpdate) AddOffset added in v0.1.7

func (mu *MsgUpdate) AddOffset(u int64) *MsgUpdate

AddOffset adds u to the "offset" field.

func (*MsgUpdate) AddReceiptIDs added in v0.1.3

func (mu *MsgUpdate) AddReceiptIDs(ids ...int) *MsgUpdate

AddReceiptIDs adds the "receipts" edge to the Receipt entity by IDs.

func (*MsgUpdate) AddReceipts added in v0.1.3

func (mu *MsgUpdate) AddReceipts(r ...*Receipt) *MsgUpdate

AddReceipts adds the "receipts" edges to the Receipt entity.

func (*MsgUpdate) AddSourceChainID

func (mu *MsgUpdate) AddSourceChainID(u int64) *MsgUpdate

AddSourceChainID adds u to the "source_chain_id" field.

func (*MsgUpdate) ClearBlock

func (mu *MsgUpdate) ClearBlock() *MsgUpdate

ClearBlock clears all "block" edges to the Block entity.

func (*MsgUpdate) ClearReceiptHash added in v0.1.4

func (mu *MsgUpdate) ClearReceiptHash() *MsgUpdate

ClearReceiptHash clears the value of the "receipt_hash" field.

func (*MsgUpdate) ClearReceipts added in v0.1.3

func (mu *MsgUpdate) ClearReceipts() *MsgUpdate

ClearReceipts clears all "receipts" edges to the Receipt entity.

func (*MsgUpdate) ClearStatus added in v0.1.4

func (mu *MsgUpdate) ClearStatus() *MsgUpdate

ClearStatus clears the value of the "status" field.

func (*MsgUpdate) Exec

func (mu *MsgUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*MsgUpdate) ExecX

func (mu *MsgUpdate) ExecX(ctx context.Context)

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

func (*MsgUpdate) Mutation

func (mu *MsgUpdate) Mutation() *MsgMutation

Mutation returns the MsgMutation object of the builder.

func (*MsgUpdate) RemoveBlock added in v0.1.7

func (mu *MsgUpdate) RemoveBlock(b ...*Block) *MsgUpdate

RemoveBlock removes "block" edges to Block entities.

func (*MsgUpdate) RemoveBlockIDs added in v0.1.7

func (mu *MsgUpdate) RemoveBlockIDs(ids ...int) *MsgUpdate

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

func (*MsgUpdate) RemoveReceiptIDs added in v0.1.3

func (mu *MsgUpdate) RemoveReceiptIDs(ids ...int) *MsgUpdate

RemoveReceiptIDs removes the "receipts" edge to Receipt entities by IDs.

func (*MsgUpdate) RemoveReceipts added in v0.1.3

func (mu *MsgUpdate) RemoveReceipts(r ...*Receipt) *MsgUpdate

RemoveReceipts removes "receipts" edges to Receipt entities.

func (*MsgUpdate) Save

func (mu *MsgUpdate) Save(ctx context.Context) (int, error)

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

func (*MsgUpdate) SaveX

func (mu *MsgUpdate) SaveX(ctx context.Context) int

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

func (*MsgUpdate) SetCreatedAt

func (mu *MsgUpdate) SetCreatedAt(t time.Time) *MsgUpdate

SetCreatedAt sets the "created_at" field.

func (*MsgUpdate) SetData

func (mu *MsgUpdate) SetData(b []byte) *MsgUpdate

SetData sets the "data" field.

func (*MsgUpdate) SetDestChainID

func (mu *MsgUpdate) SetDestChainID(u uint64) *MsgUpdate

SetDestChainID sets the "dest_chain_id" field.

func (*MsgUpdate) SetGasLimit added in v0.1.7

func (mu *MsgUpdate) SetGasLimit(u uint64) *MsgUpdate

SetGasLimit sets the "gas_limit" field.

func (*MsgUpdate) SetNillableCreatedAt

func (mu *MsgUpdate) SetNillableCreatedAt(t *time.Time) *MsgUpdate

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

func (*MsgUpdate) SetNillableDestChainID

func (mu *MsgUpdate) SetNillableDestChainID(u *uint64) *MsgUpdate

SetNillableDestChainID sets the "dest_chain_id" field if the given value is not nil.

func (*MsgUpdate) SetNillableGasLimit added in v0.1.7

func (mu *MsgUpdate) SetNillableGasLimit(u *uint64) *MsgUpdate

SetNillableGasLimit sets the "gas_limit" field if the given value is not nil.

func (*MsgUpdate) SetNillableOffset added in v0.1.7

func (mu *MsgUpdate) SetNillableOffset(u *uint64) *MsgUpdate

SetNillableOffset sets the "offset" field if the given value is not nil.

func (*MsgUpdate) SetNillableSourceChainID

func (mu *MsgUpdate) SetNillableSourceChainID(u *uint64) *MsgUpdate

SetNillableSourceChainID sets the "source_chain_id" field if the given value is not nil.

func (*MsgUpdate) SetNillableStatus added in v0.1.4

func (mu *MsgUpdate) SetNillableStatus(s *string) *MsgUpdate

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

func (*MsgUpdate) SetOffset added in v0.1.7

func (mu *MsgUpdate) SetOffset(u uint64) *MsgUpdate

SetOffset sets the "offset" field.

func (*MsgUpdate) SetReceiptHash added in v0.1.4

func (mu *MsgUpdate) SetReceiptHash(b []byte) *MsgUpdate

SetReceiptHash sets the "receipt_hash" field.

func (*MsgUpdate) SetSender added in v0.1.7

func (mu *MsgUpdate) SetSender(b []byte) *MsgUpdate

SetSender sets the "sender" field.

func (*MsgUpdate) SetSourceChainID

func (mu *MsgUpdate) SetSourceChainID(u uint64) *MsgUpdate

SetSourceChainID sets the "source_chain_id" field.

func (*MsgUpdate) SetStatus added in v0.1.4

func (mu *MsgUpdate) SetStatus(s string) *MsgUpdate

SetStatus sets the "status" field.

func (*MsgUpdate) SetTo added in v0.1.7

func (mu *MsgUpdate) SetTo(b []byte) *MsgUpdate

SetTo sets the "to" field.

func (*MsgUpdate) SetTxHash

func (mu *MsgUpdate) SetTxHash(b []byte) *MsgUpdate

SetTxHash sets the "tx_hash" field.

func (*MsgUpdate) Where

func (mu *MsgUpdate) Where(ps ...predicate.Msg) *MsgUpdate

Where appends a list predicates to the MsgUpdate builder.

type MsgUpdateOne

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

MsgUpdateOne is the builder for updating a single Msg entity.

func (*MsgUpdateOne) AddBlock added in v0.1.7

func (muo *MsgUpdateOne) AddBlock(b ...*Block) *MsgUpdateOne

AddBlock adds the "block" edges to the Block entity.

func (*MsgUpdateOne) AddBlockIDs added in v0.1.7

func (muo *MsgUpdateOne) AddBlockIDs(ids ...int) *MsgUpdateOne

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

func (*MsgUpdateOne) AddDestChainID

func (muo *MsgUpdateOne) AddDestChainID(u int64) *MsgUpdateOne

AddDestChainID adds u to the "dest_chain_id" field.

func (*MsgUpdateOne) AddGasLimit added in v0.1.7

func (muo *MsgUpdateOne) AddGasLimit(u int64) *MsgUpdateOne

AddGasLimit adds u to the "gas_limit" field.

func (*MsgUpdateOne) AddOffset added in v0.1.7

func (muo *MsgUpdateOne) AddOffset(u int64) *MsgUpdateOne

AddOffset adds u to the "offset" field.

func (*MsgUpdateOne) AddReceiptIDs added in v0.1.3

func (muo *MsgUpdateOne) AddReceiptIDs(ids ...int) *MsgUpdateOne

AddReceiptIDs adds the "receipts" edge to the Receipt entity by IDs.

func (*MsgUpdateOne) AddReceipts added in v0.1.3

func (muo *MsgUpdateOne) AddReceipts(r ...*Receipt) *MsgUpdateOne

AddReceipts adds the "receipts" edges to the Receipt entity.

func (*MsgUpdateOne) AddSourceChainID

func (muo *MsgUpdateOne) AddSourceChainID(u int64) *MsgUpdateOne

AddSourceChainID adds u to the "source_chain_id" field.

func (*MsgUpdateOne) ClearBlock

func (muo *MsgUpdateOne) ClearBlock() *MsgUpdateOne

ClearBlock clears all "block" edges to the Block entity.

func (*MsgUpdateOne) ClearReceiptHash added in v0.1.4

func (muo *MsgUpdateOne) ClearReceiptHash() *MsgUpdateOne

ClearReceiptHash clears the value of the "receipt_hash" field.

func (*MsgUpdateOne) ClearReceipts added in v0.1.3

func (muo *MsgUpdateOne) ClearReceipts() *MsgUpdateOne

ClearReceipts clears all "receipts" edges to the Receipt entity.

func (*MsgUpdateOne) ClearStatus added in v0.1.4

func (muo *MsgUpdateOne) ClearStatus() *MsgUpdateOne

ClearStatus clears the value of the "status" field.

func (*MsgUpdateOne) Exec

func (muo *MsgUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*MsgUpdateOne) ExecX

func (muo *MsgUpdateOne) ExecX(ctx context.Context)

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

func (*MsgUpdateOne) Mutation

func (muo *MsgUpdateOne) Mutation() *MsgMutation

Mutation returns the MsgMutation object of the builder.

func (*MsgUpdateOne) RemoveBlock added in v0.1.7

func (muo *MsgUpdateOne) RemoveBlock(b ...*Block) *MsgUpdateOne

RemoveBlock removes "block" edges to Block entities.

func (*MsgUpdateOne) RemoveBlockIDs added in v0.1.7

func (muo *MsgUpdateOne) RemoveBlockIDs(ids ...int) *MsgUpdateOne

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

func (*MsgUpdateOne) RemoveReceiptIDs added in v0.1.3

func (muo *MsgUpdateOne) RemoveReceiptIDs(ids ...int) *MsgUpdateOne

RemoveReceiptIDs removes the "receipts" edge to Receipt entities by IDs.

func (*MsgUpdateOne) RemoveReceipts added in v0.1.3

func (muo *MsgUpdateOne) RemoveReceipts(r ...*Receipt) *MsgUpdateOne

RemoveReceipts removes "receipts" edges to Receipt entities.

func (*MsgUpdateOne) Save

func (muo *MsgUpdateOne) Save(ctx context.Context) (*Msg, error)

Save executes the query and returns the updated Msg entity.

func (*MsgUpdateOne) SaveX

func (muo *MsgUpdateOne) SaveX(ctx context.Context) *Msg

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

func (*MsgUpdateOne) Select

func (muo *MsgUpdateOne) Select(field string, fields ...string) *MsgUpdateOne

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

func (*MsgUpdateOne) SetCreatedAt

func (muo *MsgUpdateOne) SetCreatedAt(t time.Time) *MsgUpdateOne

SetCreatedAt sets the "created_at" field.

func (*MsgUpdateOne) SetData

func (muo *MsgUpdateOne) SetData(b []byte) *MsgUpdateOne

SetData sets the "data" field.

func (*MsgUpdateOne) SetDestChainID

func (muo *MsgUpdateOne) SetDestChainID(u uint64) *MsgUpdateOne

SetDestChainID sets the "dest_chain_id" field.

func (*MsgUpdateOne) SetGasLimit added in v0.1.7

func (muo *MsgUpdateOne) SetGasLimit(u uint64) *MsgUpdateOne

SetGasLimit sets the "gas_limit" field.

func (*MsgUpdateOne) SetNillableCreatedAt

func (muo *MsgUpdateOne) SetNillableCreatedAt(t *time.Time) *MsgUpdateOne

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

func (*MsgUpdateOne) SetNillableDestChainID

func (muo *MsgUpdateOne) SetNillableDestChainID(u *uint64) *MsgUpdateOne

SetNillableDestChainID sets the "dest_chain_id" field if the given value is not nil.

func (*MsgUpdateOne) SetNillableGasLimit added in v0.1.7

func (muo *MsgUpdateOne) SetNillableGasLimit(u *uint64) *MsgUpdateOne

SetNillableGasLimit sets the "gas_limit" field if the given value is not nil.

func (*MsgUpdateOne) SetNillableOffset added in v0.1.7

func (muo *MsgUpdateOne) SetNillableOffset(u *uint64) *MsgUpdateOne

SetNillableOffset sets the "offset" field if the given value is not nil.

func (*MsgUpdateOne) SetNillableSourceChainID

func (muo *MsgUpdateOne) SetNillableSourceChainID(u *uint64) *MsgUpdateOne

SetNillableSourceChainID sets the "source_chain_id" field if the given value is not nil.

func (*MsgUpdateOne) SetNillableStatus added in v0.1.4

func (muo *MsgUpdateOne) SetNillableStatus(s *string) *MsgUpdateOne

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

func (*MsgUpdateOne) SetOffset added in v0.1.7

func (muo *MsgUpdateOne) SetOffset(u uint64) *MsgUpdateOne

SetOffset sets the "offset" field.

func (*MsgUpdateOne) SetReceiptHash added in v0.1.4

func (muo *MsgUpdateOne) SetReceiptHash(b []byte) *MsgUpdateOne

SetReceiptHash sets the "receipt_hash" field.

func (*MsgUpdateOne) SetSender added in v0.1.7

func (muo *MsgUpdateOne) SetSender(b []byte) *MsgUpdateOne

SetSender sets the "sender" field.

func (*MsgUpdateOne) SetSourceChainID

func (muo *MsgUpdateOne) SetSourceChainID(u uint64) *MsgUpdateOne

SetSourceChainID sets the "source_chain_id" field.

func (*MsgUpdateOne) SetStatus added in v0.1.4

func (muo *MsgUpdateOne) SetStatus(s string) *MsgUpdateOne

SetStatus sets the "status" field.

func (*MsgUpdateOne) SetTo added in v0.1.7

func (muo *MsgUpdateOne) SetTo(b []byte) *MsgUpdateOne

SetTo sets the "to" field.

func (*MsgUpdateOne) SetTxHash

func (muo *MsgUpdateOne) SetTxHash(b []byte) *MsgUpdateOne

SetTxHash sets the "tx_hash" field.

func (*MsgUpdateOne) Where

func (muo *MsgUpdateOne) Where(ps ...predicate.Msg) *MsgUpdateOne

Where appends a list predicates to the MsgUpdate builder.

type Msgs

type Msgs []*Msg

Msgs is a parsable slice of Msg.

type MutateFunc

type MutateFunc = ent.MutateFunc

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

type Mutation

type Mutation = ent.Mutation

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

type Mutator

type Mutator = ent.Mutator

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

type NotFoundError

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

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

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

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

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

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

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

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

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

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

Log sets the logging function for debug mode.

type OrderFunc

type OrderFunc func(*sql.Selector)

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

type Policy

type Policy = ent.Policy

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

type Querier

type Querier = ent.Querier

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

type QuerierFunc

type QuerierFunc = ent.QuerierFunc

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

type Query

type Query = ent.Query

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

type QueryContext

type QueryContext = ent.QueryContext

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

type Receipt

type Receipt struct {

	// ID of the ent.
	ID int `json:"id,omitempty"`
	// BlockHash holds the value of the "block_hash" field.
	BlockHash []byte `json:"block_hash,omitempty"`
	// GasUsed holds the value of the "gas_used" field.
	GasUsed uint64 `json:"gas_used,omitempty"`
	// Success holds the value of the "success" field.
	Success bool `json:"success,omitempty"`
	// RelayerAddress holds the value of the "relayer_address" field.
	RelayerAddress []byte `json:"relayer_address,omitempty"`
	// SourceChainID holds the value of the "source_chain_id" field.
	SourceChainID uint64 `json:"source_chain_id,omitempty"`
	// DestChainID holds the value of the "dest_chain_id" field.
	DestChainID uint64 `json:"dest_chain_id,omitempty"`
	// Offset holds the value of the "offset" field.
	Offset uint64 `json:"offset,omitempty"`
	// TxHash holds the value of the "tx_hash" field.
	TxHash []byte `json:"tx_hash,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// RevertReason holds the value of the "revert_reason" field.
	RevertReason string `json:"revert_reason,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ReceiptQuery when eager-loading is set.
	Edges ReceiptEdges `json:"edges"`
	// contains filtered or unexported fields
}

Receipt is the model entity for the Receipt schema.

func (*Receipt) QueryBlock

func (r *Receipt) QueryBlock() *BlockQuery

QueryBlock queries the "block" edge of the Receipt entity.

func (*Receipt) QueryMsgs added in v0.1.3

func (r *Receipt) QueryMsgs() *MsgQuery

QueryMsgs queries the "msgs" edge of the Receipt entity.

func (*Receipt) String

func (r *Receipt) String() string

String implements the fmt.Stringer.

func (*Receipt) Unwrap

func (r *Receipt) Unwrap() *Receipt

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

func (r *Receipt) Update() *ReceiptUpdateOne

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

func (*Receipt) Value

func (r *Receipt) Value(name string) (ent.Value, error)

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

type ReceiptClient

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

ReceiptClient is a client for the Receipt schema.

func NewReceiptClient

func NewReceiptClient(c config) *ReceiptClient

NewReceiptClient returns a client for the Receipt from the given config.

func (*ReceiptClient) Create

func (c *ReceiptClient) Create() *ReceiptCreate

Create returns a builder for creating a Receipt entity.

func (*ReceiptClient) CreateBulk

func (c *ReceiptClient) CreateBulk(builders ...*ReceiptCreate) *ReceiptCreateBulk

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

func (*ReceiptClient) Delete

func (c *ReceiptClient) Delete() *ReceiptDelete

Delete returns a delete builder for Receipt.

func (*ReceiptClient) DeleteOne

func (c *ReceiptClient) DeleteOne(r *Receipt) *ReceiptDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ReceiptClient) DeleteOneID

func (c *ReceiptClient) DeleteOneID(id int) *ReceiptDeleteOne

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

func (*ReceiptClient) Get

func (c *ReceiptClient) Get(ctx context.Context, id int) (*Receipt, error)

Get returns a Receipt entity by its id.

func (*ReceiptClient) GetX

func (c *ReceiptClient) GetX(ctx context.Context, id int) *Receipt

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

func (*ReceiptClient) Hooks

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

Hooks returns the client hooks.

func (*ReceiptClient) Intercept

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

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

func (*ReceiptClient) Interceptors

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

Interceptors returns the client interceptors.

func (*ReceiptClient) MapCreateBulk

func (c *ReceiptClient) MapCreateBulk(slice any, setFunc func(*ReceiptCreate, int)) *ReceiptCreateBulk

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

func (*ReceiptClient) Query

func (c *ReceiptClient) Query() *ReceiptQuery

Query returns a query builder for Receipt.

func (*ReceiptClient) QueryBlock

func (c *ReceiptClient) QueryBlock(r *Receipt) *BlockQuery

QueryBlock queries the block edge of a Receipt.

func (*ReceiptClient) QueryMsgs added in v0.1.3

func (c *ReceiptClient) QueryMsgs(r *Receipt) *MsgQuery

QueryMsgs queries the msgs edge of a Receipt.

func (*ReceiptClient) Update

func (c *ReceiptClient) Update() *ReceiptUpdate

Update returns an update builder for Receipt.

func (*ReceiptClient) UpdateOne

func (c *ReceiptClient) UpdateOne(r *Receipt) *ReceiptUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ReceiptClient) UpdateOneID

func (c *ReceiptClient) UpdateOneID(id int) *ReceiptUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ReceiptClient) Use

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

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

type ReceiptCreate

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

ReceiptCreate is the builder for creating a Receipt entity.

func (*ReceiptCreate) AddBlock added in v0.1.7

func (rc *ReceiptCreate) AddBlock(b ...*Block) *ReceiptCreate

AddBlock adds the "block" edges to the Block entity.

func (*ReceiptCreate) AddBlockIDs added in v0.1.7

func (rc *ReceiptCreate) AddBlockIDs(ids ...int) *ReceiptCreate

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

func (*ReceiptCreate) AddMsgIDs added in v0.1.3

func (rc *ReceiptCreate) AddMsgIDs(ids ...int) *ReceiptCreate

AddMsgIDs adds the "msgs" edge to the Msg entity by IDs.

func (*ReceiptCreate) AddMsgs added in v0.1.3

func (rc *ReceiptCreate) AddMsgs(m ...*Msg) *ReceiptCreate

AddMsgs adds the "msgs" edges to the Msg entity.

func (*ReceiptCreate) Exec

func (rc *ReceiptCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReceiptCreate) ExecX

func (rc *ReceiptCreate) ExecX(ctx context.Context)

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

func (*ReceiptCreate) Mutation

func (rc *ReceiptCreate) Mutation() *ReceiptMutation

Mutation returns the ReceiptMutation object of the builder.

func (*ReceiptCreate) Save

func (rc *ReceiptCreate) Save(ctx context.Context) (*Receipt, error)

Save creates the Receipt in the database.

func (*ReceiptCreate) SaveX

func (rc *ReceiptCreate) SaveX(ctx context.Context) *Receipt

SaveX calls Save and panics if Save returns an error.

func (*ReceiptCreate) SetBlockHash added in v0.1.7

func (rc *ReceiptCreate) SetBlockHash(b []byte) *ReceiptCreate

SetBlockHash sets the "block_hash" field.

func (*ReceiptCreate) SetCreatedAt

func (rc *ReceiptCreate) SetCreatedAt(t time.Time) *ReceiptCreate

SetCreatedAt sets the "created_at" field.

func (*ReceiptCreate) SetDestChainID

func (rc *ReceiptCreate) SetDestChainID(u uint64) *ReceiptCreate

SetDestChainID sets the "dest_chain_id" field.

func (*ReceiptCreate) SetGasUsed

func (rc *ReceiptCreate) SetGasUsed(u uint64) *ReceiptCreate

SetGasUsed sets the "gas_used" field.

func (*ReceiptCreate) SetNillableCreatedAt

func (rc *ReceiptCreate) SetNillableCreatedAt(t *time.Time) *ReceiptCreate

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

func (*ReceiptCreate) SetNillableRevertReason added in v0.1.9

func (rc *ReceiptCreate) SetNillableRevertReason(s *string) *ReceiptCreate

SetNillableRevertReason sets the "revert_reason" field if the given value is not nil.

func (*ReceiptCreate) SetOffset added in v0.1.7

func (rc *ReceiptCreate) SetOffset(u uint64) *ReceiptCreate

SetOffset sets the "offset" field.

func (*ReceiptCreate) SetRelayerAddress

func (rc *ReceiptCreate) SetRelayerAddress(b []byte) *ReceiptCreate

SetRelayerAddress sets the "relayer_address" field.

func (*ReceiptCreate) SetRevertReason added in v0.1.9

func (rc *ReceiptCreate) SetRevertReason(s string) *ReceiptCreate

SetRevertReason sets the "revert_reason" field.

func (*ReceiptCreate) SetSourceChainID

func (rc *ReceiptCreate) SetSourceChainID(u uint64) *ReceiptCreate

SetSourceChainID sets the "source_chain_id" field.

func (*ReceiptCreate) SetSuccess

func (rc *ReceiptCreate) SetSuccess(b bool) *ReceiptCreate

SetSuccess sets the "success" field.

func (*ReceiptCreate) SetTxHash

func (rc *ReceiptCreate) SetTxHash(b []byte) *ReceiptCreate

SetTxHash sets the "tx_hash" field.

type ReceiptCreateBulk

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

ReceiptCreateBulk is the builder for creating many Receipt entities in bulk.

func (*ReceiptCreateBulk) Exec

func (rcb *ReceiptCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ReceiptCreateBulk) ExecX

func (rcb *ReceiptCreateBulk) ExecX(ctx context.Context)

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

func (*ReceiptCreateBulk) Save

func (rcb *ReceiptCreateBulk) Save(ctx context.Context) ([]*Receipt, error)

Save creates the Receipt entities in the database.

func (*ReceiptCreateBulk) SaveX

func (rcb *ReceiptCreateBulk) SaveX(ctx context.Context) []*Receipt

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

type ReceiptDelete

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

ReceiptDelete is the builder for deleting a Receipt entity.

func (*ReceiptDelete) Exec

func (rd *ReceiptDelete) Exec(ctx context.Context) (int, error)

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

func (*ReceiptDelete) ExecX

func (rd *ReceiptDelete) ExecX(ctx context.Context) int

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

func (*ReceiptDelete) Where

func (rd *ReceiptDelete) Where(ps ...predicate.Receipt) *ReceiptDelete

Where appends a list predicates to the ReceiptDelete builder.

type ReceiptDeleteOne

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

ReceiptDeleteOne is the builder for deleting a single Receipt entity.

func (*ReceiptDeleteOne) Exec

func (rdo *ReceiptDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ReceiptDeleteOne) ExecX

func (rdo *ReceiptDeleteOne) ExecX(ctx context.Context)

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

func (*ReceiptDeleteOne) Where

Where appends a list predicates to the ReceiptDelete builder.

type ReceiptEdges

type ReceiptEdges struct {
	// Block holds the value of the block edge.
	Block []*Block `json:"block,omitempty"`
	// Msgs holds the value of the msgs edge.
	Msgs []*Msg `json:"msgs,omitempty"`
	// contains filtered or unexported fields
}

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

func (ReceiptEdges) BlockOrErr

func (e ReceiptEdges) BlockOrErr() ([]*Block, error)

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

func (ReceiptEdges) MsgsOrErr added in v0.1.3

func (e ReceiptEdges) MsgsOrErr() ([]*Msg, error)

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

type ReceiptFilter

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

ReceiptFilter provides a generic filtering capability at runtime for ReceiptQuery.

func (*ReceiptFilter) Where

func (f *ReceiptFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*ReceiptFilter) WhereBlockHash added in v0.1.7

func (f *ReceiptFilter) WhereBlockHash(p entql.BytesP)

WhereBlockHash applies the entql []byte predicate on the block_hash field.

func (*ReceiptFilter) WhereCreatedAt

func (f *ReceiptFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*ReceiptFilter) WhereDestChainID

func (f *ReceiptFilter) WhereDestChainID(p entql.Uint64P)

WhereDestChainID applies the entql uint64 predicate on the dest_chain_id field.

func (*ReceiptFilter) WhereGasUsed

func (f *ReceiptFilter) WhereGasUsed(p entql.Uint64P)

WhereGasUsed applies the entql uint64 predicate on the gas_used field.

func (*ReceiptFilter) WhereHasBlock

func (f *ReceiptFilter) WhereHasBlock()

WhereHasBlock applies a predicate to check if query has an edge block.

func (*ReceiptFilter) WhereHasBlockWith

func (f *ReceiptFilter) WhereHasBlockWith(preds ...predicate.Block)

WhereHasBlockWith applies a predicate to check if query has an edge block with a given conditions (other predicates).

func (*ReceiptFilter) WhereHasMsgs added in v0.1.3

func (f *ReceiptFilter) WhereHasMsgs()

WhereHasMsgs applies a predicate to check if query has an edge msgs.

func (*ReceiptFilter) WhereHasMsgsWith added in v0.1.3

func (f *ReceiptFilter) WhereHasMsgsWith(preds ...predicate.Msg)

WhereHasMsgsWith applies a predicate to check if query has an edge msgs with a given conditions (other predicates).

func (*ReceiptFilter) WhereID

func (f *ReceiptFilter) WhereID(p entql.IntP)

WhereID applies the entql int predicate on the id field.

func (*ReceiptFilter) WhereOffset added in v0.1.7

func (f *ReceiptFilter) WhereOffset(p entql.Uint64P)

WhereOffset applies the entql uint64 predicate on the offset field.

func (*ReceiptFilter) WhereRelayerAddress

func (f *ReceiptFilter) WhereRelayerAddress(p entql.BytesP)

WhereRelayerAddress applies the entql []byte predicate on the relayer_address field.

func (*ReceiptFilter) WhereRevertReason added in v0.1.9

func (f *ReceiptFilter) WhereRevertReason(p entql.StringP)

WhereRevertReason applies the entql string predicate on the revert_reason field.

func (*ReceiptFilter) WhereSourceChainID

func (f *ReceiptFilter) WhereSourceChainID(p entql.Uint64P)

WhereSourceChainID applies the entql uint64 predicate on the source_chain_id field.

func (*ReceiptFilter) WhereSuccess

func (f *ReceiptFilter) WhereSuccess(p entql.BoolP)

WhereSuccess applies the entql bool predicate on the success field.

func (*ReceiptFilter) WhereTxHash

func (f *ReceiptFilter) WhereTxHash(p entql.BytesP)

WhereTxHash applies the entql []byte predicate on the tx_hash field.

type ReceiptGroupBy

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

ReceiptGroupBy is the group-by builder for Receipt entities.

func (*ReceiptGroupBy) Aggregate

func (rgb *ReceiptGroupBy) Aggregate(fns ...AggregateFunc) *ReceiptGroupBy

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

func (*ReceiptGroupBy) Bool

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

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

func (*ReceiptGroupBy) BoolX

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

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

func (*ReceiptGroupBy) Bools

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

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

func (*ReceiptGroupBy) BoolsX

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

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

func (*ReceiptGroupBy) Float64

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

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

func (*ReceiptGroupBy) Float64X

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

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

func (*ReceiptGroupBy) Float64s

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

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

func (*ReceiptGroupBy) Float64sX

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

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

func (*ReceiptGroupBy) Int

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

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

func (*ReceiptGroupBy) IntX

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

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

func (*ReceiptGroupBy) Ints

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

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

func (*ReceiptGroupBy) IntsX

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

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

func (*ReceiptGroupBy) Scan

func (rgb *ReceiptGroupBy) Scan(ctx context.Context, v any) error

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

func (*ReceiptGroupBy) ScanX

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

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

func (*ReceiptGroupBy) String

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

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

func (*ReceiptGroupBy) StringX

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

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

func (*ReceiptGroupBy) Strings

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

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

func (*ReceiptGroupBy) StringsX

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

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

type ReceiptMutation

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

ReceiptMutation represents an operation that mutates the Receipt nodes in the graph.

func (*ReceiptMutation) AddBlockIDs added in v0.1.7

func (m *ReceiptMutation) AddBlockIDs(ids ...int)

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

func (*ReceiptMutation) AddDestChainID

func (m *ReceiptMutation) AddDestChainID(u int64)

AddDestChainID adds u to the "dest_chain_id" field.

func (*ReceiptMutation) AddField

func (m *ReceiptMutation) 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 (*ReceiptMutation) AddGasUsed

func (m *ReceiptMutation) AddGasUsed(u int64)

AddGasUsed adds u to the "gas_used" field.

func (*ReceiptMutation) AddMsgIDs added in v0.1.3

func (m *ReceiptMutation) AddMsgIDs(ids ...int)

AddMsgIDs adds the "msgs" edge to the Msg entity by ids.

func (*ReceiptMutation) AddOffset added in v0.1.7

func (m *ReceiptMutation) AddOffset(u int64)

AddOffset adds u to the "offset" field.

func (*ReceiptMutation) AddSourceChainID

func (m *ReceiptMutation) AddSourceChainID(u int64)

AddSourceChainID adds u to the "source_chain_id" field.

func (*ReceiptMutation) AddedDestChainID

func (m *ReceiptMutation) AddedDestChainID() (r int64, exists bool)

AddedDestChainID returns the value that was added to the "dest_chain_id" field in this mutation.

func (*ReceiptMutation) AddedEdges

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

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

func (*ReceiptMutation) AddedField

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

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

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

func (*ReceiptMutation) AddedGasUsed

func (m *ReceiptMutation) AddedGasUsed() (r int64, exists bool)

AddedGasUsed returns the value that was added to the "gas_used" field in this mutation.

func (*ReceiptMutation) AddedIDs

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

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

func (*ReceiptMutation) AddedOffset added in v0.1.7

func (m *ReceiptMutation) AddedOffset() (r int64, exists bool)

AddedOffset returns the value that was added to the "offset" field in this mutation.

func (*ReceiptMutation) AddedSourceChainID

func (m *ReceiptMutation) AddedSourceChainID() (r int64, exists bool)

AddedSourceChainID returns the value that was added to the "source_chain_id" field in this mutation.

func (*ReceiptMutation) BlockCleared

func (m *ReceiptMutation) BlockCleared() bool

BlockCleared reports if the "block" edge to the Block entity was cleared.

func (*ReceiptMutation) BlockHash added in v0.1.7

func (m *ReceiptMutation) BlockHash() (r []byte, exists bool)

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

func (*ReceiptMutation) BlockIDs

func (m *ReceiptMutation) BlockIDs() (ids []int)

BlockIDs returns the "block" edge IDs in the mutation.

func (*ReceiptMutation) ClearBlock

func (m *ReceiptMutation) ClearBlock()

ClearBlock clears the "block" edge to the Block entity.

func (*ReceiptMutation) ClearEdge

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

func (m *ReceiptMutation) 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 (*ReceiptMutation) ClearMsgs added in v0.1.3

func (m *ReceiptMutation) ClearMsgs()

ClearMsgs clears the "msgs" edge to the Msg entity.

func (*ReceiptMutation) ClearRevertReason added in v0.1.9

func (m *ReceiptMutation) ClearRevertReason()

ClearRevertReason clears the value of the "revert_reason" field.

func (*ReceiptMutation) ClearedEdges

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

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

func (*ReceiptMutation) ClearedFields

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

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

func (ReceiptMutation) Client

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

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

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

func (*ReceiptMutation) DestChainID

func (m *ReceiptMutation) DestChainID() (r uint64, exists bool)

DestChainID returns the value of the "dest_chain_id" field in the mutation.

func (*ReceiptMutation) EdgeCleared

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

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

func (*ReceiptMutation) Field

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

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

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

func (*ReceiptMutation) Fields

func (m *ReceiptMutation) 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 (*ReceiptMutation) Filter

func (m *ReceiptMutation) Filter() *ReceiptFilter

Filter returns an entql.Where implementation to apply filters on the ReceiptMutation builder.

func (*ReceiptMutation) GasUsed

func (m *ReceiptMutation) GasUsed() (r uint64, exists bool)

GasUsed returns the value of the "gas_used" field in the mutation.

func (*ReceiptMutation) ID

func (m *ReceiptMutation) ID() (id int, exists bool)

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

func (*ReceiptMutation) IDs

func (m *ReceiptMutation) IDs(ctx context.Context) ([]int, error)

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

func (*ReceiptMutation) MsgsCleared added in v0.1.3

func (m *ReceiptMutation) MsgsCleared() bool

MsgsCleared reports if the "msgs" edge to the Msg entity was cleared.

func (*ReceiptMutation) MsgsIDs added in v0.1.3

func (m *ReceiptMutation) MsgsIDs() (ids []int)

MsgsIDs returns the "msgs" edge IDs in the mutation.

func (*ReceiptMutation) Offset added in v0.1.7

func (m *ReceiptMutation) Offset() (r uint64, exists bool)

Offset returns the value of the "offset" field in the mutation.

func (*ReceiptMutation) OldBlockHash added in v0.1.7

func (m *ReceiptMutation) OldBlockHash(ctx context.Context) (v []byte, err error)

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

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

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

func (m *ReceiptMutation) OldDestChainID(ctx context.Context) (v uint64, err error)

OldDestChainID returns the old "dest_chain_id" field's value of the Receipt entity. If the Receipt 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 (*ReceiptMutation) OldField

func (m *ReceiptMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ReceiptMutation) OldGasUsed

func (m *ReceiptMutation) OldGasUsed(ctx context.Context) (v uint64, err error)

OldGasUsed returns the old "gas_used" field's value of the Receipt entity. If the Receipt 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 (*ReceiptMutation) OldOffset added in v0.1.7

func (m *ReceiptMutation) OldOffset(ctx context.Context) (v uint64, err error)

OldOffset returns the old "offset" field's value of the Receipt entity. If the Receipt 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 (*ReceiptMutation) OldRelayerAddress

func (m *ReceiptMutation) OldRelayerAddress(ctx context.Context) (v []byte, err error)

OldRelayerAddress returns the old "relayer_address" field's value of the Receipt entity. If the Receipt 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 (*ReceiptMutation) OldRevertReason added in v0.1.9

func (m *ReceiptMutation) OldRevertReason(ctx context.Context) (v string, err error)

OldRevertReason returns the old "revert_reason" field's value of the Receipt entity. If the Receipt 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 (*ReceiptMutation) OldSourceChainID

func (m *ReceiptMutation) OldSourceChainID(ctx context.Context) (v uint64, err error)

OldSourceChainID returns the old "source_chain_id" field's value of the Receipt entity. If the Receipt 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 (*ReceiptMutation) OldSuccess

func (m *ReceiptMutation) OldSuccess(ctx context.Context) (v bool, err error)

OldSuccess returns the old "success" field's value of the Receipt entity. If the Receipt 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 (*ReceiptMutation) OldTxHash

func (m *ReceiptMutation) OldTxHash(ctx context.Context) (v []byte, err error)

OldTxHash returns the old "tx_hash" field's value of the Receipt entity. If the Receipt 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 (*ReceiptMutation) Op

func (m *ReceiptMutation) Op() Op

Op returns the operation name.

func (*ReceiptMutation) RelayerAddress

func (m *ReceiptMutation) RelayerAddress() (r []byte, exists bool)

RelayerAddress returns the value of the "relayer_address" field in the mutation.

func (*ReceiptMutation) RemoveBlockIDs added in v0.1.7

func (m *ReceiptMutation) RemoveBlockIDs(ids ...int)

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

func (*ReceiptMutation) RemoveMsgIDs added in v0.1.3

func (m *ReceiptMutation) RemoveMsgIDs(ids ...int)

RemoveMsgIDs removes the "msgs" edge to the Msg entity by IDs.

func (*ReceiptMutation) RemovedBlockIDs added in v0.1.7

func (m *ReceiptMutation) RemovedBlockIDs() (ids []int)

RemovedBlock returns the removed IDs of the "block" edge to the Block entity.

func (*ReceiptMutation) RemovedEdges

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

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

func (*ReceiptMutation) RemovedIDs

func (m *ReceiptMutation) 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 (*ReceiptMutation) RemovedMsgsIDs added in v0.1.3

func (m *ReceiptMutation) RemovedMsgsIDs() (ids []int)

RemovedMsgs returns the removed IDs of the "msgs" edge to the Msg entity.

func (*ReceiptMutation) ResetBlock

func (m *ReceiptMutation) ResetBlock()

ResetBlock resets all changes to the "block" edge.

func (*ReceiptMutation) ResetBlockHash added in v0.1.7

func (m *ReceiptMutation) ResetBlockHash()

ResetBlockHash resets all changes to the "block_hash" field.

func (*ReceiptMutation) ResetCreatedAt

func (m *ReceiptMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ReceiptMutation) ResetDestChainID

func (m *ReceiptMutation) ResetDestChainID()

ResetDestChainID resets all changes to the "dest_chain_id" field.

func (*ReceiptMutation) ResetEdge

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

func (m *ReceiptMutation) 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 (*ReceiptMutation) ResetGasUsed

func (m *ReceiptMutation) ResetGasUsed()

ResetGasUsed resets all changes to the "gas_used" field.

func (*ReceiptMutation) ResetMsgs added in v0.1.3

func (m *ReceiptMutation) ResetMsgs()

ResetMsgs resets all changes to the "msgs" edge.

func (*ReceiptMutation) ResetOffset added in v0.1.7

func (m *ReceiptMutation) ResetOffset()

ResetOffset resets all changes to the "offset" field.

func (*ReceiptMutation) ResetRelayerAddress

func (m *ReceiptMutation) ResetRelayerAddress()

ResetRelayerAddress resets all changes to the "relayer_address" field.

func (*ReceiptMutation) ResetRevertReason added in v0.1.9

func (m *ReceiptMutation) ResetRevertReason()

ResetRevertReason resets all changes to the "revert_reason" field.

func (*ReceiptMutation) ResetSourceChainID

func (m *ReceiptMutation) ResetSourceChainID()

ResetSourceChainID resets all changes to the "source_chain_id" field.

func (*ReceiptMutation) ResetSuccess

func (m *ReceiptMutation) ResetSuccess()

ResetSuccess resets all changes to the "success" field.

func (*ReceiptMutation) ResetTxHash

func (m *ReceiptMutation) ResetTxHash()

ResetTxHash resets all changes to the "tx_hash" field.

func (*ReceiptMutation) RevertReason added in v0.1.9

func (m *ReceiptMutation) RevertReason() (r string, exists bool)

RevertReason returns the value of the "revert_reason" field in the mutation.

func (*ReceiptMutation) RevertReasonCleared added in v0.1.9

func (m *ReceiptMutation) RevertReasonCleared() bool

RevertReasonCleared returns if the "revert_reason" field was cleared in this mutation.

func (*ReceiptMutation) SetBlockHash added in v0.1.7

func (m *ReceiptMutation) SetBlockHash(b []byte)

SetBlockHash sets the "block_hash" field.

func (*ReceiptMutation) SetCreatedAt

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

SetCreatedAt sets the "created_at" field.

func (*ReceiptMutation) SetDestChainID

func (m *ReceiptMutation) SetDestChainID(u uint64)

SetDestChainID sets the "dest_chain_id" field.

func (*ReceiptMutation) SetField

func (m *ReceiptMutation) 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 (*ReceiptMutation) SetGasUsed

func (m *ReceiptMutation) SetGasUsed(u uint64)

SetGasUsed sets the "gas_used" field.

func (*ReceiptMutation) SetOffset added in v0.1.7

func (m *ReceiptMutation) SetOffset(u uint64)

SetOffset sets the "offset" field.

func (*ReceiptMutation) SetOp

func (m *ReceiptMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*ReceiptMutation) SetRelayerAddress

func (m *ReceiptMutation) SetRelayerAddress(b []byte)

SetRelayerAddress sets the "relayer_address" field.

func (*ReceiptMutation) SetRevertReason added in v0.1.9

func (m *ReceiptMutation) SetRevertReason(s string)

SetRevertReason sets the "revert_reason" field.

func (*ReceiptMutation) SetSourceChainID

func (m *ReceiptMutation) SetSourceChainID(u uint64)

SetSourceChainID sets the "source_chain_id" field.

func (*ReceiptMutation) SetSuccess

func (m *ReceiptMutation) SetSuccess(b bool)

SetSuccess sets the "success" field.

func (*ReceiptMutation) SetTxHash

func (m *ReceiptMutation) SetTxHash(b []byte)

SetTxHash sets the "tx_hash" field.

func (*ReceiptMutation) SourceChainID

func (m *ReceiptMutation) SourceChainID() (r uint64, exists bool)

SourceChainID returns the value of the "source_chain_id" field in the mutation.

func (*ReceiptMutation) Success

func (m *ReceiptMutation) Success() (r bool, exists bool)

Success returns the value of the "success" field in the mutation.

func (ReceiptMutation) Tx

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

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

func (*ReceiptMutation) TxHash

func (m *ReceiptMutation) TxHash() (r []byte, exists bool)

TxHash returns the value of the "tx_hash" field in the mutation.

func (*ReceiptMutation) Type

func (m *ReceiptMutation) Type() string

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

func (*ReceiptMutation) Where

func (m *ReceiptMutation) Where(ps ...predicate.Receipt)

Where appends a list predicates to the ReceiptMutation builder.

func (*ReceiptMutation) WhereP

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

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

type ReceiptQuery

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

ReceiptQuery is the builder for querying Receipt entities.

func (*ReceiptQuery) Aggregate

func (rq *ReceiptQuery) Aggregate(fns ...AggregateFunc) *ReceiptSelect

Aggregate returns a ReceiptSelect configured with the given aggregations.

func (*ReceiptQuery) All

func (rq *ReceiptQuery) All(ctx context.Context) ([]*Receipt, error)

All executes the query and returns a list of Receipts.

func (*ReceiptQuery) AllX

func (rq *ReceiptQuery) AllX(ctx context.Context) []*Receipt

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

func (*ReceiptQuery) Clone

func (rq *ReceiptQuery) Clone() *ReceiptQuery

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

func (*ReceiptQuery) Count

func (rq *ReceiptQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ReceiptQuery) CountX

func (rq *ReceiptQuery) CountX(ctx context.Context) int

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

func (*ReceiptQuery) Exist

func (rq *ReceiptQuery) Exist(ctx context.Context) (bool, error)

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

func (*ReceiptQuery) ExistX

func (rq *ReceiptQuery) ExistX(ctx context.Context) bool

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

func (*ReceiptQuery) Filter

func (rq *ReceiptQuery) Filter() *ReceiptFilter

Filter returns a Filter implementation to apply filters on the ReceiptQuery builder.

func (*ReceiptQuery) First

func (rq *ReceiptQuery) First(ctx context.Context) (*Receipt, error)

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

func (*ReceiptQuery) FirstID

func (rq *ReceiptQuery) FirstID(ctx context.Context) (id int, err error)

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

func (*ReceiptQuery) FirstIDX

func (rq *ReceiptQuery) FirstIDX(ctx context.Context) int

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

func (*ReceiptQuery) FirstX

func (rq *ReceiptQuery) FirstX(ctx context.Context) *Receipt

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

func (*ReceiptQuery) GroupBy

func (rq *ReceiptQuery) GroupBy(field string, fields ...string) *ReceiptGroupBy

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 {
	BlockHash []byte `json:"block_hash,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Receipt.Query().
	GroupBy(receipt.FieldBlockHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ReceiptQuery) IDs

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

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

func (*ReceiptQuery) IDsX

func (rq *ReceiptQuery) IDsX(ctx context.Context) []int

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

func (*ReceiptQuery) Limit

func (rq *ReceiptQuery) Limit(limit int) *ReceiptQuery

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

func (*ReceiptQuery) Offset

func (rq *ReceiptQuery) Offset(offset int) *ReceiptQuery

Offset to start from.

func (*ReceiptQuery) Only

func (rq *ReceiptQuery) Only(ctx context.Context) (*Receipt, error)

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

func (*ReceiptQuery) OnlyID

func (rq *ReceiptQuery) OnlyID(ctx context.Context) (id int, err error)

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

func (*ReceiptQuery) OnlyIDX

func (rq *ReceiptQuery) OnlyIDX(ctx context.Context) int

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

func (*ReceiptQuery) OnlyX

func (rq *ReceiptQuery) OnlyX(ctx context.Context) *Receipt

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

func (*ReceiptQuery) Order

func (rq *ReceiptQuery) Order(o ...receipt.OrderOption) *ReceiptQuery

Order specifies how the records should be ordered.

func (*ReceiptQuery) QueryBlock

func (rq *ReceiptQuery) QueryBlock() *BlockQuery

QueryBlock chains the current query on the "block" edge.

func (*ReceiptQuery) QueryMsgs added in v0.1.3

func (rq *ReceiptQuery) QueryMsgs() *MsgQuery

QueryMsgs chains the current query on the "msgs" edge.

func (*ReceiptQuery) Select

func (rq *ReceiptQuery) Select(fields ...string) *ReceiptSelect

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 {
	BlockHash []byte `json:"block_hash,omitempty"`
}

client.Receipt.Query().
	Select(receipt.FieldBlockHash).
	Scan(ctx, &v)

func (*ReceiptQuery) Unique

func (rq *ReceiptQuery) Unique(unique bool) *ReceiptQuery

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

func (rq *ReceiptQuery) Where(ps ...predicate.Receipt) *ReceiptQuery

Where adds a new predicate for the ReceiptQuery builder.

func (*ReceiptQuery) WithBlock

func (rq *ReceiptQuery) WithBlock(opts ...func(*BlockQuery)) *ReceiptQuery

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

func (*ReceiptQuery) WithMsgs added in v0.1.3

func (rq *ReceiptQuery) WithMsgs(opts ...func(*MsgQuery)) *ReceiptQuery

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

type ReceiptSelect

type ReceiptSelect struct {
	*ReceiptQuery
	// contains filtered or unexported fields
}

ReceiptSelect is the builder for selecting fields of Receipt entities.

func (*ReceiptSelect) Aggregate

func (rs *ReceiptSelect) Aggregate(fns ...AggregateFunc) *ReceiptSelect

Aggregate adds the given aggregation functions to the selector query.

func (*ReceiptSelect) Bool

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

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

func (*ReceiptSelect) BoolX

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

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

func (*ReceiptSelect) Bools

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

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

func (*ReceiptSelect) BoolsX

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

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

func (*ReceiptSelect) Float64

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

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

func (*ReceiptSelect) Float64X

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

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

func (*ReceiptSelect) Float64s

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

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

func (*ReceiptSelect) Float64sX

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

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

func (*ReceiptSelect) Int

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

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

func (*ReceiptSelect) IntX

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

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

func (*ReceiptSelect) Ints

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

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

func (*ReceiptSelect) IntsX

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

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

func (*ReceiptSelect) Scan

func (rs *ReceiptSelect) Scan(ctx context.Context, v any) error

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

func (*ReceiptSelect) ScanX

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

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

func (*ReceiptSelect) String

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

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

func (*ReceiptSelect) StringX

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

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

func (*ReceiptSelect) Strings

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

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

func (*ReceiptSelect) StringsX

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

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

type ReceiptUpdate

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

ReceiptUpdate is the builder for updating Receipt entities.

func (*ReceiptUpdate) AddBlock added in v0.1.7

func (ru *ReceiptUpdate) AddBlock(b ...*Block) *ReceiptUpdate

AddBlock adds the "block" edges to the Block entity.

func (*ReceiptUpdate) AddBlockIDs added in v0.1.7

func (ru *ReceiptUpdate) AddBlockIDs(ids ...int) *ReceiptUpdate

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

func (*ReceiptUpdate) AddDestChainID

func (ru *ReceiptUpdate) AddDestChainID(u int64) *ReceiptUpdate

AddDestChainID adds u to the "dest_chain_id" field.

func (*ReceiptUpdate) AddGasUsed

func (ru *ReceiptUpdate) AddGasUsed(u int64) *ReceiptUpdate

AddGasUsed adds u to the "gas_used" field.

func (*ReceiptUpdate) AddMsgIDs added in v0.1.3

func (ru *ReceiptUpdate) AddMsgIDs(ids ...int) *ReceiptUpdate

AddMsgIDs adds the "msgs" edge to the Msg entity by IDs.

func (*ReceiptUpdate) AddMsgs added in v0.1.3

func (ru *ReceiptUpdate) AddMsgs(m ...*Msg) *ReceiptUpdate

AddMsgs adds the "msgs" edges to the Msg entity.

func (*ReceiptUpdate) AddOffset added in v0.1.7

func (ru *ReceiptUpdate) AddOffset(u int64) *ReceiptUpdate

AddOffset adds u to the "offset" field.

func (*ReceiptUpdate) AddSourceChainID

func (ru *ReceiptUpdate) AddSourceChainID(u int64) *ReceiptUpdate

AddSourceChainID adds u to the "source_chain_id" field.

func (*ReceiptUpdate) ClearBlock

func (ru *ReceiptUpdate) ClearBlock() *ReceiptUpdate

ClearBlock clears all "block" edges to the Block entity.

func (*ReceiptUpdate) ClearMsgs added in v0.1.3

func (ru *ReceiptUpdate) ClearMsgs() *ReceiptUpdate

ClearMsgs clears all "msgs" edges to the Msg entity.

func (*ReceiptUpdate) ClearRevertReason added in v0.1.9

func (ru *ReceiptUpdate) ClearRevertReason() *ReceiptUpdate

ClearRevertReason clears the value of the "revert_reason" field.

func (*ReceiptUpdate) Exec

func (ru *ReceiptUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ReceiptUpdate) ExecX

func (ru *ReceiptUpdate) ExecX(ctx context.Context)

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

func (*ReceiptUpdate) Mutation

func (ru *ReceiptUpdate) Mutation() *ReceiptMutation

Mutation returns the ReceiptMutation object of the builder.

func (*ReceiptUpdate) RemoveBlock added in v0.1.7

func (ru *ReceiptUpdate) RemoveBlock(b ...*Block) *ReceiptUpdate

RemoveBlock removes "block" edges to Block entities.

func (*ReceiptUpdate) RemoveBlockIDs added in v0.1.7

func (ru *ReceiptUpdate) RemoveBlockIDs(ids ...int) *ReceiptUpdate

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

func (*ReceiptUpdate) RemoveMsgIDs added in v0.1.3

func (ru *ReceiptUpdate) RemoveMsgIDs(ids ...int) *ReceiptUpdate

RemoveMsgIDs removes the "msgs" edge to Msg entities by IDs.

func (*ReceiptUpdate) RemoveMsgs added in v0.1.3

func (ru *ReceiptUpdate) RemoveMsgs(m ...*Msg) *ReceiptUpdate

RemoveMsgs removes "msgs" edges to Msg entities.

func (*ReceiptUpdate) Save

func (ru *ReceiptUpdate) Save(ctx context.Context) (int, error)

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

func (*ReceiptUpdate) SaveX

func (ru *ReceiptUpdate) SaveX(ctx context.Context) int

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

func (*ReceiptUpdate) SetBlockHash added in v0.1.7

func (ru *ReceiptUpdate) SetBlockHash(b []byte) *ReceiptUpdate

SetBlockHash sets the "block_hash" field.

func (*ReceiptUpdate) SetCreatedAt

func (ru *ReceiptUpdate) SetCreatedAt(t time.Time) *ReceiptUpdate

SetCreatedAt sets the "created_at" field.

func (*ReceiptUpdate) SetDestChainID

func (ru *ReceiptUpdate) SetDestChainID(u uint64) *ReceiptUpdate

SetDestChainID sets the "dest_chain_id" field.

func (*ReceiptUpdate) SetGasUsed

func (ru *ReceiptUpdate) SetGasUsed(u uint64) *ReceiptUpdate

SetGasUsed sets the "gas_used" field.

func (*ReceiptUpdate) SetNillableCreatedAt

func (ru *ReceiptUpdate) SetNillableCreatedAt(t *time.Time) *ReceiptUpdate

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

func (*ReceiptUpdate) SetNillableDestChainID

func (ru *ReceiptUpdate) SetNillableDestChainID(u *uint64) *ReceiptUpdate

SetNillableDestChainID sets the "dest_chain_id" field if the given value is not nil.

func (*ReceiptUpdate) SetNillableGasUsed

func (ru *ReceiptUpdate) SetNillableGasUsed(u *uint64) *ReceiptUpdate

SetNillableGasUsed sets the "gas_used" field if the given value is not nil.

func (*ReceiptUpdate) SetNillableOffset added in v0.1.7

func (ru *ReceiptUpdate) SetNillableOffset(u *uint64) *ReceiptUpdate

SetNillableOffset sets the "offset" field if the given value is not nil.

func (*ReceiptUpdate) SetNillableRevertReason added in v0.1.9

func (ru *ReceiptUpdate) SetNillableRevertReason(s *string) *ReceiptUpdate

SetNillableRevertReason sets the "revert_reason" field if the given value is not nil.

func (*ReceiptUpdate) SetNillableSourceChainID

func (ru *ReceiptUpdate) SetNillableSourceChainID(u *uint64) *ReceiptUpdate

SetNillableSourceChainID sets the "source_chain_id" field if the given value is not nil.

func (*ReceiptUpdate) SetNillableSuccess

func (ru *ReceiptUpdate) SetNillableSuccess(b *bool) *ReceiptUpdate

SetNillableSuccess sets the "success" field if the given value is not nil.

func (*ReceiptUpdate) SetOffset added in v0.1.7

func (ru *ReceiptUpdate) SetOffset(u uint64) *ReceiptUpdate

SetOffset sets the "offset" field.

func (*ReceiptUpdate) SetRelayerAddress

func (ru *ReceiptUpdate) SetRelayerAddress(b []byte) *ReceiptUpdate

SetRelayerAddress sets the "relayer_address" field.

func (*ReceiptUpdate) SetRevertReason added in v0.1.9

func (ru *ReceiptUpdate) SetRevertReason(s string) *ReceiptUpdate

SetRevertReason sets the "revert_reason" field.

func (*ReceiptUpdate) SetSourceChainID

func (ru *ReceiptUpdate) SetSourceChainID(u uint64) *ReceiptUpdate

SetSourceChainID sets the "source_chain_id" field.

func (*ReceiptUpdate) SetSuccess

func (ru *ReceiptUpdate) SetSuccess(b bool) *ReceiptUpdate

SetSuccess sets the "success" field.

func (*ReceiptUpdate) SetTxHash

func (ru *ReceiptUpdate) SetTxHash(b []byte) *ReceiptUpdate

SetTxHash sets the "tx_hash" field.

func (*ReceiptUpdate) Where

func (ru *ReceiptUpdate) Where(ps ...predicate.Receipt) *ReceiptUpdate

Where appends a list predicates to the ReceiptUpdate builder.

type ReceiptUpdateOne

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

ReceiptUpdateOne is the builder for updating a single Receipt entity.

func (*ReceiptUpdateOne) AddBlock added in v0.1.7

func (ruo *ReceiptUpdateOne) AddBlock(b ...*Block) *ReceiptUpdateOne

AddBlock adds the "block" edges to the Block entity.

func (*ReceiptUpdateOne) AddBlockIDs added in v0.1.7

func (ruo *ReceiptUpdateOne) AddBlockIDs(ids ...int) *ReceiptUpdateOne

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

func (*ReceiptUpdateOne) AddDestChainID

func (ruo *ReceiptUpdateOne) AddDestChainID(u int64) *ReceiptUpdateOne

AddDestChainID adds u to the "dest_chain_id" field.

func (*ReceiptUpdateOne) AddGasUsed

func (ruo *ReceiptUpdateOne) AddGasUsed(u int64) *ReceiptUpdateOne

AddGasUsed adds u to the "gas_used" field.

func (*ReceiptUpdateOne) AddMsgIDs added in v0.1.3

func (ruo *ReceiptUpdateOne) AddMsgIDs(ids ...int) *ReceiptUpdateOne

AddMsgIDs adds the "msgs" edge to the Msg entity by IDs.

func (*ReceiptUpdateOne) AddMsgs added in v0.1.3

func (ruo *ReceiptUpdateOne) AddMsgs(m ...*Msg) *ReceiptUpdateOne

AddMsgs adds the "msgs" edges to the Msg entity.

func (*ReceiptUpdateOne) AddOffset added in v0.1.7

func (ruo *ReceiptUpdateOne) AddOffset(u int64) *ReceiptUpdateOne

AddOffset adds u to the "offset" field.

func (*ReceiptUpdateOne) AddSourceChainID

func (ruo *ReceiptUpdateOne) AddSourceChainID(u int64) *ReceiptUpdateOne

AddSourceChainID adds u to the "source_chain_id" field.

func (*ReceiptUpdateOne) ClearBlock

func (ruo *ReceiptUpdateOne) ClearBlock() *ReceiptUpdateOne

ClearBlock clears all "block" edges to the Block entity.

func (*ReceiptUpdateOne) ClearMsgs added in v0.1.3

func (ruo *ReceiptUpdateOne) ClearMsgs() *ReceiptUpdateOne

ClearMsgs clears all "msgs" edges to the Msg entity.

func (*ReceiptUpdateOne) ClearRevertReason added in v0.1.9

func (ruo *ReceiptUpdateOne) ClearRevertReason() *ReceiptUpdateOne

ClearRevertReason clears the value of the "revert_reason" field.

func (*ReceiptUpdateOne) Exec

func (ruo *ReceiptUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ReceiptUpdateOne) ExecX

func (ruo *ReceiptUpdateOne) ExecX(ctx context.Context)

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

func (*ReceiptUpdateOne) Mutation

func (ruo *ReceiptUpdateOne) Mutation() *ReceiptMutation

Mutation returns the ReceiptMutation object of the builder.

func (*ReceiptUpdateOne) RemoveBlock added in v0.1.7

func (ruo *ReceiptUpdateOne) RemoveBlock(b ...*Block) *ReceiptUpdateOne

RemoveBlock removes "block" edges to Block entities.

func (*ReceiptUpdateOne) RemoveBlockIDs added in v0.1.7

func (ruo *ReceiptUpdateOne) RemoveBlockIDs(ids ...int) *ReceiptUpdateOne

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

func (*ReceiptUpdateOne) RemoveMsgIDs added in v0.1.3

func (ruo *ReceiptUpdateOne) RemoveMsgIDs(ids ...int) *ReceiptUpdateOne

RemoveMsgIDs removes the "msgs" edge to Msg entities by IDs.

func (*ReceiptUpdateOne) RemoveMsgs added in v0.1.3

func (ruo *ReceiptUpdateOne) RemoveMsgs(m ...*Msg) *ReceiptUpdateOne

RemoveMsgs removes "msgs" edges to Msg entities.

func (*ReceiptUpdateOne) Save

func (ruo *ReceiptUpdateOne) Save(ctx context.Context) (*Receipt, error)

Save executes the query and returns the updated Receipt entity.

func (*ReceiptUpdateOne) SaveX

func (ruo *ReceiptUpdateOne) SaveX(ctx context.Context) *Receipt

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

func (*ReceiptUpdateOne) Select

func (ruo *ReceiptUpdateOne) Select(field string, fields ...string) *ReceiptUpdateOne

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

func (*ReceiptUpdateOne) SetBlockHash added in v0.1.7

func (ruo *ReceiptUpdateOne) SetBlockHash(b []byte) *ReceiptUpdateOne

SetBlockHash sets the "block_hash" field.

func (*ReceiptUpdateOne) SetCreatedAt

func (ruo *ReceiptUpdateOne) SetCreatedAt(t time.Time) *ReceiptUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ReceiptUpdateOne) SetDestChainID

func (ruo *ReceiptUpdateOne) SetDestChainID(u uint64) *ReceiptUpdateOne

SetDestChainID sets the "dest_chain_id" field.

func (*ReceiptUpdateOne) SetGasUsed

func (ruo *ReceiptUpdateOne) SetGasUsed(u uint64) *ReceiptUpdateOne

SetGasUsed sets the "gas_used" field.

func (*ReceiptUpdateOne) SetNillableCreatedAt

func (ruo *ReceiptUpdateOne) SetNillableCreatedAt(t *time.Time) *ReceiptUpdateOne

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

func (*ReceiptUpdateOne) SetNillableDestChainID

func (ruo *ReceiptUpdateOne) SetNillableDestChainID(u *uint64) *ReceiptUpdateOne

SetNillableDestChainID sets the "dest_chain_id" field if the given value is not nil.

func (*ReceiptUpdateOne) SetNillableGasUsed

func (ruo *ReceiptUpdateOne) SetNillableGasUsed(u *uint64) *ReceiptUpdateOne

SetNillableGasUsed sets the "gas_used" field if the given value is not nil.

func (*ReceiptUpdateOne) SetNillableOffset added in v0.1.7

func (ruo *ReceiptUpdateOne) SetNillableOffset(u *uint64) *ReceiptUpdateOne

SetNillableOffset sets the "offset" field if the given value is not nil.

func (*ReceiptUpdateOne) SetNillableRevertReason added in v0.1.9

func (ruo *ReceiptUpdateOne) SetNillableRevertReason(s *string) *ReceiptUpdateOne

SetNillableRevertReason sets the "revert_reason" field if the given value is not nil.

func (*ReceiptUpdateOne) SetNillableSourceChainID

func (ruo *ReceiptUpdateOne) SetNillableSourceChainID(u *uint64) *ReceiptUpdateOne

SetNillableSourceChainID sets the "source_chain_id" field if the given value is not nil.

func (*ReceiptUpdateOne) SetNillableSuccess

func (ruo *ReceiptUpdateOne) SetNillableSuccess(b *bool) *ReceiptUpdateOne

SetNillableSuccess sets the "success" field if the given value is not nil.

func (*ReceiptUpdateOne) SetOffset added in v0.1.7

func (ruo *ReceiptUpdateOne) SetOffset(u uint64) *ReceiptUpdateOne

SetOffset sets the "offset" field.

func (*ReceiptUpdateOne) SetRelayerAddress

func (ruo *ReceiptUpdateOne) SetRelayerAddress(b []byte) *ReceiptUpdateOne

SetRelayerAddress sets the "relayer_address" field.

func (*ReceiptUpdateOne) SetRevertReason added in v0.1.9

func (ruo *ReceiptUpdateOne) SetRevertReason(s string) *ReceiptUpdateOne

SetRevertReason sets the "revert_reason" field.

func (*ReceiptUpdateOne) SetSourceChainID

func (ruo *ReceiptUpdateOne) SetSourceChainID(u uint64) *ReceiptUpdateOne

SetSourceChainID sets the "source_chain_id" field.

func (*ReceiptUpdateOne) SetSuccess

func (ruo *ReceiptUpdateOne) SetSuccess(b bool) *ReceiptUpdateOne

SetSuccess sets the "success" field.

func (*ReceiptUpdateOne) SetTxHash

func (ruo *ReceiptUpdateOne) SetTxHash(b []byte) *ReceiptUpdateOne

SetTxHash sets the "tx_hash" field.

func (*ReceiptUpdateOne) Where

Where appends a list predicates to the ReceiptUpdate builder.

type Receipts

type Receipts []*Receipt

Receipts is a parsable slice of Receipt.

type RollbackFunc

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

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

func (RollbackFunc) Rollback

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

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

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

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

type Rollbacker

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

Rollbacker is the interface that wraps the Rollback method.

type TraverseFunc

type TraverseFunc = ent.TraverseFunc

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

type Traverser

type Traverser = ent.Traverser

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

type Tx

type Tx struct {

	// Block is the client for interacting with the Block builders.
	Block *BlockClient
	// Chain is the client for interacting with the Chain builders.
	Chain *ChainClient
	// Msg is the client for interacting with the Msg builders.
	Msg *MsgClient
	// Receipt is the client for interacting with the Receipt builders.
	Receipt *ReceiptClient
	// XProviderCursor is the client for interacting with the XProviderCursor builders.
	XProviderCursor *XProviderCursorClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

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

type XProviderCursor

type XProviderCursor struct {

	// ID of the ent.
	ID uuid.UUID `json:"id,omitempty"`
	// ChainID holds the value of the "chain_id" field.
	ChainID uint64 `json:"chain_id,omitempty"`
	// Height holds the value of the "height" field.
	Height uint64 `json:"height,omitempty"`
	// Offset holds the value of the "offset" field.
	Offset uint64 `json:"offset,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// contains filtered or unexported fields
}

XProviderCursor is the model entity for the XProviderCursor schema.

func (*XProviderCursor) String

func (xc *XProviderCursor) String() string

String implements the fmt.Stringer.

func (*XProviderCursor) Unwrap

func (xc *XProviderCursor) Unwrap() *XProviderCursor

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

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

func (*XProviderCursor) Value

func (xc *XProviderCursor) Value(name string) (ent.Value, error)

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

type XProviderCursorClient

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

XProviderCursorClient is a client for the XProviderCursor schema.

func NewXProviderCursorClient

func NewXProviderCursorClient(c config) *XProviderCursorClient

NewXProviderCursorClient returns a client for the XProviderCursor from the given config.

func (*XProviderCursorClient) Create

Create returns a builder for creating a XProviderCursor entity.

func (*XProviderCursorClient) CreateBulk

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

func (*XProviderCursorClient) Delete

Delete returns a delete builder for XProviderCursor.

func (*XProviderCursorClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*XProviderCursorClient) DeleteOneID

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

func (*XProviderCursorClient) Get

Get returns a XProviderCursor entity by its id.

func (*XProviderCursorClient) GetX

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

func (*XProviderCursorClient) Hooks

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

Hooks returns the client hooks.

func (*XProviderCursorClient) Intercept

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

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

func (*XProviderCursorClient) Interceptors

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

Interceptors returns the client interceptors.

func (*XProviderCursorClient) MapCreateBulk

func (c *XProviderCursorClient) MapCreateBulk(slice any, setFunc func(*XProviderCursorCreate, int)) *XProviderCursorCreateBulk

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

func (*XProviderCursorClient) Query

Query returns a query builder for XProviderCursor.

func (*XProviderCursorClient) Update

Update returns an update builder for XProviderCursor.

func (*XProviderCursorClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*XProviderCursorClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*XProviderCursorClient) Use

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

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

type XProviderCursorCreate

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

XProviderCursorCreate is the builder for creating a XProviderCursor entity.

func (*XProviderCursorCreate) Exec

func (xcc *XProviderCursorCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*XProviderCursorCreate) ExecX

func (xcc *XProviderCursorCreate) ExecX(ctx context.Context)

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

func (*XProviderCursorCreate) Mutation

Mutation returns the XProviderCursorMutation object of the builder.

func (*XProviderCursorCreate) Save

Save creates the XProviderCursor in the database.

func (*XProviderCursorCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*XProviderCursorCreate) SetChainID

SetChainID sets the "chain_id" field.

func (*XProviderCursorCreate) SetCreatedAt

func (xcc *XProviderCursorCreate) SetCreatedAt(t time.Time) *XProviderCursorCreate

SetCreatedAt sets the "created_at" field.

func (*XProviderCursorCreate) SetHeight

SetHeight sets the "height" field.

func (*XProviderCursorCreate) SetID added in v0.1.7

SetID sets the "id" field.

func (*XProviderCursorCreate) SetNillableCreatedAt

func (xcc *XProviderCursorCreate) SetNillableCreatedAt(t *time.Time) *XProviderCursorCreate

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

func (*XProviderCursorCreate) SetNillableID added in v0.1.7

func (xcc *XProviderCursorCreate) SetNillableID(u *uuid.UUID) *XProviderCursorCreate

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

func (*XProviderCursorCreate) SetNillableUpdatedAt

func (xcc *XProviderCursorCreate) SetNillableUpdatedAt(t *time.Time) *XProviderCursorCreate

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

func (*XProviderCursorCreate) SetOffset added in v0.1.7

SetOffset sets the "offset" field.

func (*XProviderCursorCreate) SetUpdatedAt

func (xcc *XProviderCursorCreate) SetUpdatedAt(t time.Time) *XProviderCursorCreate

SetUpdatedAt sets the "updated_at" field.

type XProviderCursorCreateBulk

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

XProviderCursorCreateBulk is the builder for creating many XProviderCursor entities in bulk.

func (*XProviderCursorCreateBulk) Exec

Exec executes the query.

func (*XProviderCursorCreateBulk) ExecX

func (xccb *XProviderCursorCreateBulk) ExecX(ctx context.Context)

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

func (*XProviderCursorCreateBulk) Save

Save creates the XProviderCursor entities in the database.

func (*XProviderCursorCreateBulk) SaveX

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

type XProviderCursorDelete

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

XProviderCursorDelete is the builder for deleting a XProviderCursor entity.

func (*XProviderCursorDelete) Exec

func (xcd *XProviderCursorDelete) Exec(ctx context.Context) (int, error)

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

func (*XProviderCursorDelete) ExecX

func (xcd *XProviderCursorDelete) ExecX(ctx context.Context) int

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

func (*XProviderCursorDelete) Where

Where appends a list predicates to the XProviderCursorDelete builder.

type XProviderCursorDeleteOne

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

XProviderCursorDeleteOne is the builder for deleting a single XProviderCursor entity.

func (*XProviderCursorDeleteOne) Exec

Exec executes the deletion query.

func (*XProviderCursorDeleteOne) ExecX

func (xcdo *XProviderCursorDeleteOne) ExecX(ctx context.Context)

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

func (*XProviderCursorDeleteOne) Where

Where appends a list predicates to the XProviderCursorDelete builder.

type XProviderCursorFilter

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

XProviderCursorFilter provides a generic filtering capability at runtime for XProviderCursorQuery.

func (*XProviderCursorFilter) Where

func (f *XProviderCursorFilter) Where(p entql.P)

Where applies the entql predicate on the query filter.

func (*XProviderCursorFilter) WhereChainID

func (f *XProviderCursorFilter) WhereChainID(p entql.Uint64P)

WhereChainID applies the entql uint64 predicate on the chain_id field.

func (*XProviderCursorFilter) WhereCreatedAt

func (f *XProviderCursorFilter) WhereCreatedAt(p entql.TimeP)

WhereCreatedAt applies the entql time.Time predicate on the created_at field.

func (*XProviderCursorFilter) WhereHeight

func (f *XProviderCursorFilter) WhereHeight(p entql.Uint64P)

WhereHeight applies the entql uint64 predicate on the height field.

func (*XProviderCursorFilter) WhereID

func (f *XProviderCursorFilter) WhereID(p entql.ValueP)

WhereID applies the entql [16]byte predicate on the id field.

func (*XProviderCursorFilter) WhereOffset added in v0.1.7

func (f *XProviderCursorFilter) WhereOffset(p entql.Uint64P)

WhereOffset applies the entql uint64 predicate on the offset field.

func (*XProviderCursorFilter) WhereUpdatedAt

func (f *XProviderCursorFilter) WhereUpdatedAt(p entql.TimeP)

WhereUpdatedAt applies the entql time.Time predicate on the updated_at field.

type XProviderCursorGroupBy

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

XProviderCursorGroupBy is the group-by builder for XProviderCursor entities.

func (*XProviderCursorGroupBy) Aggregate

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

func (*XProviderCursorGroupBy) Bool

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

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

func (*XProviderCursorGroupBy) BoolX

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

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

func (*XProviderCursorGroupBy) Bools

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

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

func (*XProviderCursorGroupBy) BoolsX

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

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

func (*XProviderCursorGroupBy) Float64

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

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

func (*XProviderCursorGroupBy) Float64X

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

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

func (*XProviderCursorGroupBy) Float64s

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

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

func (*XProviderCursorGroupBy) Float64sX

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

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

func (*XProviderCursorGroupBy) Int

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

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*XProviderCursorGroupBy) IntX

func (s *XProviderCursorGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*XProviderCursorGroupBy) Ints

func (s *XProviderCursorGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*XProviderCursorGroupBy) IntsX

func (s *XProviderCursorGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*XProviderCursorGroupBy) Scan

func (xcgb *XProviderCursorGroupBy) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*XProviderCursorGroupBy) ScanX

func (s *XProviderCursorGroupBy) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*XProviderCursorGroupBy) String

func (s *XProviderCursorGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*XProviderCursorGroupBy) StringX

func (s *XProviderCursorGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*XProviderCursorGroupBy) Strings

func (s *XProviderCursorGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*XProviderCursorGroupBy) StringsX

func (s *XProviderCursorGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type XProviderCursorMutation

type XProviderCursorMutation struct {
	// contains filtered or unexported fields
}

XProviderCursorMutation represents an operation that mutates the XProviderCursor nodes in the graph.

func (*XProviderCursorMutation) AddChainID

func (m *XProviderCursorMutation) AddChainID(u int64)

AddChainID adds u to the "chain_id" field.

func (*XProviderCursorMutation) AddField

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) AddHeight

func (m *XProviderCursorMutation) AddHeight(u int64)

AddHeight adds u to the "height" field.

func (*XProviderCursorMutation) AddOffset added in v0.1.7

func (m *XProviderCursorMutation) AddOffset(u int64)

AddOffset adds u to the "offset" field.

func (*XProviderCursorMutation) AddedChainID

func (m *XProviderCursorMutation) AddedChainID() (r int64, exists bool)

AddedChainID returns the value that was added to the "chain_id" field in this mutation.

func (*XProviderCursorMutation) AddedEdges

func (m *XProviderCursorMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*XProviderCursorMutation) AddedField

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) AddedFields

func (m *XProviderCursorMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*XProviderCursorMutation) AddedHeight

func (m *XProviderCursorMutation) AddedHeight() (r int64, exists bool)

AddedHeight returns the value that was added to the "height" field in this mutation.

func (*XProviderCursorMutation) AddedIDs

func (m *XProviderCursorMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*XProviderCursorMutation) AddedOffset added in v0.1.7

func (m *XProviderCursorMutation) AddedOffset() (r int64, exists bool)

AddedOffset returns the value that was added to the "offset" field in this mutation.

func (*XProviderCursorMutation) ChainID

func (m *XProviderCursorMutation) ChainID() (r uint64, exists bool)

ChainID returns the value of the "chain_id" field in the mutation.

func (*XProviderCursorMutation) ClearEdge

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) ClearField

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) ClearedEdges

func (m *XProviderCursorMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*XProviderCursorMutation) ClearedFields

func (m *XProviderCursorMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (XProviderCursorMutation) Client

func (m XProviderCursorMutation) 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 (*XProviderCursorMutation) CreatedAt

func (m *XProviderCursorMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*XProviderCursorMutation) EdgeCleared

func (m *XProviderCursorMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*XProviderCursorMutation) Field

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) FieldCleared

func (m *XProviderCursorMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*XProviderCursorMutation) Fields

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) Filter

Filter returns an entql.Where implementation to apply filters on the XProviderCursorMutation builder.

func (*XProviderCursorMutation) Height

func (m *XProviderCursorMutation) Height() (r uint64, exists bool)

Height returns the value of the "height" field in the mutation.

func (*XProviderCursorMutation) ID

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) 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 (*XProviderCursorMutation) Offset added in v0.1.7

func (m *XProviderCursorMutation) Offset() (r uint64, exists bool)

Offset returns the value of the "offset" field in the mutation.

func (*XProviderCursorMutation) OldChainID

func (m *XProviderCursorMutation) OldChainID(ctx context.Context) (v uint64, err error)

OldChainID returns the old "chain_id" field's value of the XProviderCursor entity. If the XProviderCursor 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 (*XProviderCursorMutation) OldCreatedAt

func (m *XProviderCursorMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the XProviderCursor entity. If the XProviderCursor 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 (*XProviderCursorMutation) OldField

func (m *XProviderCursorMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*XProviderCursorMutation) OldHeight

func (m *XProviderCursorMutation) OldHeight(ctx context.Context) (v uint64, err error)

OldHeight returns the old "height" field's value of the XProviderCursor entity. If the XProviderCursor 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 (*XProviderCursorMutation) OldOffset added in v0.1.7

func (m *XProviderCursorMutation) OldOffset(ctx context.Context) (v uint64, err error)

OldOffset returns the old "offset" field's value of the XProviderCursor entity. If the XProviderCursor 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 (*XProviderCursorMutation) OldUpdatedAt

func (m *XProviderCursorMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the XProviderCursor entity. If the XProviderCursor 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 (*XProviderCursorMutation) Op

func (m *XProviderCursorMutation) Op() Op

Op returns the operation name.

func (*XProviderCursorMutation) RemovedEdges

func (m *XProviderCursorMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*XProviderCursorMutation) RemovedIDs

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) ResetChainID

func (m *XProviderCursorMutation) ResetChainID()

ResetChainID resets all changes to the "chain_id" field.

func (*XProviderCursorMutation) ResetCreatedAt

func (m *XProviderCursorMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*XProviderCursorMutation) ResetEdge

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) ResetField

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) ResetHeight

func (m *XProviderCursorMutation) ResetHeight()

ResetHeight resets all changes to the "height" field.

func (*XProviderCursorMutation) ResetOffset added in v0.1.7

func (m *XProviderCursorMutation) ResetOffset()

ResetOffset resets all changes to the "offset" field.

func (*XProviderCursorMutation) ResetUpdatedAt

func (m *XProviderCursorMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*XProviderCursorMutation) SetChainID

func (m *XProviderCursorMutation) SetChainID(u uint64)

SetChainID sets the "chain_id" field.

func (*XProviderCursorMutation) SetCreatedAt

func (m *XProviderCursorMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*XProviderCursorMutation) SetField

func (m *XProviderCursorMutation) 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 (*XProviderCursorMutation) SetHeight

func (m *XProviderCursorMutation) SetHeight(u uint64)

SetHeight sets the "height" field.

func (*XProviderCursorMutation) SetID added in v0.1.7

func (m *XProviderCursorMutation) SetID(id uuid.UUID)

SetID sets the value of the id field. Note that this operation is only accepted on creation of XProviderCursor entities.

func (*XProviderCursorMutation) SetOffset added in v0.1.7

func (m *XProviderCursorMutation) SetOffset(u uint64)

SetOffset sets the "offset" field.

func (*XProviderCursorMutation) SetOp

func (m *XProviderCursorMutation) SetOp(op Op)

SetOp allows setting the mutation operation.

func (*XProviderCursorMutation) SetUpdatedAt

func (m *XProviderCursorMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (XProviderCursorMutation) Tx

func (m XProviderCursorMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*XProviderCursorMutation) Type

func (m *XProviderCursorMutation) Type() string

Type returns the node type of this mutation (XProviderCursor).

func (*XProviderCursorMutation) UpdatedAt

func (m *XProviderCursorMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*XProviderCursorMutation) Where

Where appends a list predicates to the XProviderCursorMutation builder.

func (*XProviderCursorMutation) WhereP

func (m *XProviderCursorMutation) WhereP(ps ...func(*sql.Selector))

WhereP appends storage-level predicates to the XProviderCursorMutation builder. Using this method, users can use type-assertion to append predicates that do not depend on any generated package.

type XProviderCursorQuery

type XProviderCursorQuery struct {
	// contains filtered or unexported fields
}

XProviderCursorQuery is the builder for querying XProviderCursor entities.

func (*XProviderCursorQuery) Aggregate

Aggregate returns a XProviderCursorSelect configured with the given aggregations.

func (*XProviderCursorQuery) All

All executes the query and returns a list of XProviderCursors.

func (*XProviderCursorQuery) AllX

AllX is like All, but panics if an error occurs.

func (*XProviderCursorQuery) Clone

Clone returns a duplicate of the XProviderCursorQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*XProviderCursorQuery) Count

func (xcq *XProviderCursorQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*XProviderCursorQuery) CountX

func (xcq *XProviderCursorQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*XProviderCursorQuery) Exist

func (xcq *XProviderCursorQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*XProviderCursorQuery) ExistX

func (xcq *XProviderCursorQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*XProviderCursorQuery) Filter

Filter returns a Filter implementation to apply filters on the XProviderCursorQuery builder.

func (*XProviderCursorQuery) First

First returns the first XProviderCursor entity from the query. Returns a *NotFoundError when no XProviderCursor was found.

func (*XProviderCursorQuery) FirstID

func (xcq *XProviderCursorQuery) FirstID(ctx context.Context) (id uuid.UUID, err error)

FirstID returns the first XProviderCursor ID from the query. Returns a *NotFoundError when no XProviderCursor ID was found.

func (*XProviderCursorQuery) FirstIDX

func (xcq *XProviderCursorQuery) FirstIDX(ctx context.Context) uuid.UUID

FirstIDX is like FirstID, but panics if an error occurs.

func (*XProviderCursorQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*XProviderCursorQuery) GroupBy

func (xcq *XProviderCursorQuery) GroupBy(field string, fields ...string) *XProviderCursorGroupBy

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 {
	ChainID uint64 `json:"chain_id,omitempty"`
	Count int `json:"count,omitempty"`
}

client.XProviderCursor.Query().
	GroupBy(xprovidercursor.FieldChainID).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*XProviderCursorQuery) IDs

func (xcq *XProviderCursorQuery) IDs(ctx context.Context) (ids []uuid.UUID, err error)

IDs executes the query and returns a list of XProviderCursor IDs.

func (*XProviderCursorQuery) IDsX

func (xcq *XProviderCursorQuery) IDsX(ctx context.Context) []uuid.UUID

IDsX is like IDs, but panics if an error occurs.

func (*XProviderCursorQuery) Limit

func (xcq *XProviderCursorQuery) Limit(limit int) *XProviderCursorQuery

Limit the number of records to be returned by this query.

func (*XProviderCursorQuery) Offset

func (xcq *XProviderCursorQuery) Offset(offset int) *XProviderCursorQuery

Offset to start from.

func (*XProviderCursorQuery) Only

Only returns a single XProviderCursor entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one XProviderCursor entity is found. Returns a *NotFoundError when no XProviderCursor entities are found.

func (*XProviderCursorQuery) OnlyID

func (xcq *XProviderCursorQuery) OnlyID(ctx context.Context) (id uuid.UUID, err error)

OnlyID is like Only, but returns the only XProviderCursor ID in the query. Returns a *NotSingularError when more than one XProviderCursor ID is found. Returns a *NotFoundError when no entities are found.

func (*XProviderCursorQuery) OnlyIDX

func (xcq *XProviderCursorQuery) OnlyIDX(ctx context.Context) uuid.UUID

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*XProviderCursorQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*XProviderCursorQuery) Order

Order specifies how the records should be ordered.

func (*XProviderCursorQuery) Select

func (xcq *XProviderCursorQuery) Select(fields ...string) *XProviderCursorSelect

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 {
	ChainID uint64 `json:"chain_id,omitempty"`
}

client.XProviderCursor.Query().
	Select(xprovidercursor.FieldChainID).
	Scan(ctx, &v)

func (*XProviderCursorQuery) Unique

func (xcq *XProviderCursorQuery) Unique(unique bool) *XProviderCursorQuery

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 (*XProviderCursorQuery) Where

Where adds a new predicate for the XProviderCursorQuery builder.

type XProviderCursorSelect

type XProviderCursorSelect struct {
	*XProviderCursorQuery
	// contains filtered or unexported fields
}

XProviderCursorSelect is the builder for selecting fields of XProviderCursor entities.

func (*XProviderCursorSelect) Aggregate

Aggregate adds the given aggregation functions to the selector query.

func (*XProviderCursorSelect) Bool

func (s *XProviderCursorSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*XProviderCursorSelect) BoolX

func (s *XProviderCursorSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*XProviderCursorSelect) Bools

func (s *XProviderCursorSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*XProviderCursorSelect) BoolsX

func (s *XProviderCursorSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*XProviderCursorSelect) Float64

func (s *XProviderCursorSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*XProviderCursorSelect) Float64X

func (s *XProviderCursorSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*XProviderCursorSelect) Float64s

func (s *XProviderCursorSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*XProviderCursorSelect) Float64sX

func (s *XProviderCursorSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*XProviderCursorSelect) Int

func (s *XProviderCursorSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*XProviderCursorSelect) IntX

func (s *XProviderCursorSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*XProviderCursorSelect) Ints

func (s *XProviderCursorSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*XProviderCursorSelect) IntsX

func (s *XProviderCursorSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*XProviderCursorSelect) Scan

func (xcs *XProviderCursorSelect) Scan(ctx context.Context, v any) error

Scan applies the selector query and scans the result into the given value.

func (*XProviderCursorSelect) ScanX

func (s *XProviderCursorSelect) ScanX(ctx context.Context, v any)

ScanX is like Scan, but panics if an error occurs.

func (*XProviderCursorSelect) String

func (s *XProviderCursorSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*XProviderCursorSelect) StringX

func (s *XProviderCursorSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*XProviderCursorSelect) Strings

func (s *XProviderCursorSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*XProviderCursorSelect) StringsX

func (s *XProviderCursorSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type XProviderCursorUpdate

type XProviderCursorUpdate struct {
	// contains filtered or unexported fields
}

XProviderCursorUpdate is the builder for updating XProviderCursor entities.

func (*XProviderCursorUpdate) AddChainID

AddChainID adds u to the "chain_id" field.

func (*XProviderCursorUpdate) AddHeight

AddHeight adds u to the "height" field.

func (*XProviderCursorUpdate) AddOffset added in v0.1.7

AddOffset adds u to the "offset" field.

func (*XProviderCursorUpdate) Exec

func (xcu *XProviderCursorUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*XProviderCursorUpdate) ExecX

func (xcu *XProviderCursorUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*XProviderCursorUpdate) Mutation

Mutation returns the XProviderCursorMutation object of the builder.

func (*XProviderCursorUpdate) Save

func (xcu *XProviderCursorUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*XProviderCursorUpdate) SaveX

func (xcu *XProviderCursorUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*XProviderCursorUpdate) SetChainID

SetChainID sets the "chain_id" field.

func (*XProviderCursorUpdate) SetCreatedAt

func (xcu *XProviderCursorUpdate) SetCreatedAt(t time.Time) *XProviderCursorUpdate

SetCreatedAt sets the "created_at" field.

func (*XProviderCursorUpdate) SetHeight

SetHeight sets the "height" field.

func (*XProviderCursorUpdate) SetNillableChainID

func (xcu *XProviderCursorUpdate) SetNillableChainID(u *uint64) *XProviderCursorUpdate

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*XProviderCursorUpdate) SetNillableCreatedAt

func (xcu *XProviderCursorUpdate) SetNillableCreatedAt(t *time.Time) *XProviderCursorUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*XProviderCursorUpdate) SetNillableHeight

func (xcu *XProviderCursorUpdate) SetNillableHeight(u *uint64) *XProviderCursorUpdate

SetNillableHeight sets the "height" field if the given value is not nil.

func (*XProviderCursorUpdate) SetNillableOffset added in v0.1.7

func (xcu *XProviderCursorUpdate) SetNillableOffset(u *uint64) *XProviderCursorUpdate

SetNillableOffset sets the "offset" field if the given value is not nil.

func (*XProviderCursorUpdate) SetNillableUpdatedAt

func (xcu *XProviderCursorUpdate) SetNillableUpdatedAt(t *time.Time) *XProviderCursorUpdate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*XProviderCursorUpdate) SetOffset added in v0.1.7

SetOffset sets the "offset" field.

func (*XProviderCursorUpdate) SetUpdatedAt

func (xcu *XProviderCursorUpdate) SetUpdatedAt(t time.Time) *XProviderCursorUpdate

SetUpdatedAt sets the "updated_at" field.

func (*XProviderCursorUpdate) Where

Where appends a list predicates to the XProviderCursorUpdate builder.

type XProviderCursorUpdateOne

type XProviderCursorUpdateOne struct {
	// contains filtered or unexported fields
}

XProviderCursorUpdateOne is the builder for updating a single XProviderCursor entity.

func (*XProviderCursorUpdateOne) AddChainID

AddChainID adds u to the "chain_id" field.

func (*XProviderCursorUpdateOne) AddHeight

AddHeight adds u to the "height" field.

func (*XProviderCursorUpdateOne) AddOffset added in v0.1.7

AddOffset adds u to the "offset" field.

func (*XProviderCursorUpdateOne) Exec

Exec executes the query on the entity.

func (*XProviderCursorUpdateOne) ExecX

func (xcuo *XProviderCursorUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*XProviderCursorUpdateOne) Mutation

Mutation returns the XProviderCursorMutation object of the builder.

func (*XProviderCursorUpdateOne) Save

Save executes the query and returns the updated XProviderCursor entity.

func (*XProviderCursorUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*XProviderCursorUpdateOne) Select

func (xcuo *XProviderCursorUpdateOne) Select(field string, fields ...string) *XProviderCursorUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*XProviderCursorUpdateOne) SetChainID

SetChainID sets the "chain_id" field.

func (*XProviderCursorUpdateOne) SetCreatedAt

SetCreatedAt sets the "created_at" field.

func (*XProviderCursorUpdateOne) SetHeight

SetHeight sets the "height" field.

func (*XProviderCursorUpdateOne) SetNillableChainID

func (xcuo *XProviderCursorUpdateOne) SetNillableChainID(u *uint64) *XProviderCursorUpdateOne

SetNillableChainID sets the "chain_id" field if the given value is not nil.

func (*XProviderCursorUpdateOne) SetNillableCreatedAt

func (xcuo *XProviderCursorUpdateOne) SetNillableCreatedAt(t *time.Time) *XProviderCursorUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*XProviderCursorUpdateOne) SetNillableHeight

func (xcuo *XProviderCursorUpdateOne) SetNillableHeight(u *uint64) *XProviderCursorUpdateOne

SetNillableHeight sets the "height" field if the given value is not nil.

func (*XProviderCursorUpdateOne) SetNillableOffset added in v0.1.7

func (xcuo *XProviderCursorUpdateOne) SetNillableOffset(u *uint64) *XProviderCursorUpdateOne

SetNillableOffset sets the "offset" field if the given value is not nil.

func (*XProviderCursorUpdateOne) SetNillableUpdatedAt

func (xcuo *XProviderCursorUpdateOne) SetNillableUpdatedAt(t *time.Time) *XProviderCursorUpdateOne

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*XProviderCursorUpdateOne) SetOffset added in v0.1.7

SetOffset sets the "offset" field.

func (*XProviderCursorUpdateOne) SetUpdatedAt

SetUpdatedAt sets the "updated_at" field.

func (*XProviderCursorUpdateOne) Where

Where appends a list predicates to the XProviderCursorUpdate builder.

type XProviderCursors

type XProviderCursors []*XProviderCursor

XProviderCursors is a parsable slice of XProviderCursor.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL