block

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Label holds the string label denoting the block type in the database.
	Label = "block"
	// FieldID holds the string denoting the id field in the database.
	FieldID = "id"
	// FieldHash holds the string denoting the hash field in the database.
	FieldHash = "hash"
	// FieldChainID holds the string denoting the chain_id field in the database.
	FieldChainID = "chain_id"
	// FieldHeight holds the string denoting the height field in the database.
	FieldHeight = "height"
	// FieldOffset holds the string denoting the offset field in the database.
	FieldOffset = "offset"
	// FieldTimestamp holds the string denoting the timestamp field in the database.
	FieldTimestamp = "timestamp"
	// FieldCreatedAt holds the string denoting the created_at field in the database.
	FieldCreatedAt = "created_at"
	// EdgeMsgs holds the string denoting the msgs edge name in mutations.
	EdgeMsgs = "msgs"
	// EdgeReceipts holds the string denoting the receipts edge name in mutations.
	EdgeReceipts = "receipts"
	// Table holds the table name of the block in the database.
	Table = "blocks"
	// MsgsTable is the table that holds the msgs relation/edge. The primary key declared below.
	MsgsTable = "block_msgs"
	// MsgsInverseTable is the table name for the Msg entity.
	// It exists in this package in order to avoid circular dependency with the "msg" package.
	MsgsInverseTable = "msgs"
	// ReceiptsTable is the table that holds the receipts relation/edge. The primary key declared below.
	ReceiptsTable = "block_receipts"
	// ReceiptsInverseTable is the table name for the Receipt entity.
	// It exists in this package in order to avoid circular dependency with the "receipt" package.
	ReceiptsInverseTable = "receipts"
)

Variables

View Source
var (
	// MsgsPrimaryKey and MsgsColumn2 are the table columns denoting the
	// primary key for the msgs relation (M2M).
	MsgsPrimaryKey = []string{"block_id", "msg_id"}
	// ReceiptsPrimaryKey and ReceiptsColumn2 are the table columns denoting the
	// primary key for the receipts relation (M2M).
	ReceiptsPrimaryKey = []string{"block_id", "receipt_id"}
)
View Source
var (
	// HashValidator is a validator for the "hash" field. It is called by the builders before save.
	HashValidator func([]byte) error
	// DefaultTimestamp holds the default value on creation for the "timestamp" field.
	DefaultTimestamp time.Time
	// DefaultCreatedAt holds the default value on creation for the "created_at" field.
	DefaultCreatedAt time.Time
)

Columns holds all SQL columns for block fields.

Functions

func And

func And(predicates ...predicate.Block) predicate.Block

And groups predicates with the AND operator between them.

func ChainID added in v0.1.7

func ChainID(v uint64) predicate.Block

ChainID applies equality check predicate on the "chain_id" field. It's identical to ChainIDEQ.

func ChainIDEQ added in v0.1.7

func ChainIDEQ(v uint64) predicate.Block

ChainIDEQ applies the EQ predicate on the "chain_id" field.

func ChainIDGT added in v0.1.7

func ChainIDGT(v uint64) predicate.Block

ChainIDGT applies the GT predicate on the "chain_id" field.

func ChainIDGTE added in v0.1.7

func ChainIDGTE(v uint64) predicate.Block

ChainIDGTE applies the GTE predicate on the "chain_id" field.

func ChainIDIn added in v0.1.7

func ChainIDIn(vs ...uint64) predicate.Block

ChainIDIn applies the In predicate on the "chain_id" field.

func ChainIDLT added in v0.1.7

func ChainIDLT(v uint64) predicate.Block

ChainIDLT applies the LT predicate on the "chain_id" field.

func ChainIDLTE added in v0.1.7

func ChainIDLTE(v uint64) predicate.Block

ChainIDLTE applies the LTE predicate on the "chain_id" field.

func ChainIDNEQ added in v0.1.7

func ChainIDNEQ(v uint64) predicate.Block

ChainIDNEQ applies the NEQ predicate on the "chain_id" field.

func ChainIDNotIn added in v0.1.7

func ChainIDNotIn(vs ...uint64) predicate.Block

ChainIDNotIn applies the NotIn predicate on the "chain_id" field.

func CreatedAt

func CreatedAt(v time.Time) predicate.Block

CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.

func CreatedAtEQ

func CreatedAtEQ(v time.Time) predicate.Block

CreatedAtEQ applies the EQ predicate on the "created_at" field.

func CreatedAtGT

func CreatedAtGT(v time.Time) predicate.Block

CreatedAtGT applies the GT predicate on the "created_at" field.

func CreatedAtGTE

func CreatedAtGTE(v time.Time) predicate.Block

CreatedAtGTE applies the GTE predicate on the "created_at" field.

func CreatedAtIn

func CreatedAtIn(vs ...time.Time) predicate.Block

CreatedAtIn applies the In predicate on the "created_at" field.

func CreatedAtLT

func CreatedAtLT(v time.Time) predicate.Block

CreatedAtLT applies the LT predicate on the "created_at" field.

func CreatedAtLTE

func CreatedAtLTE(v time.Time) predicate.Block

CreatedAtLTE applies the LTE predicate on the "created_at" field.

func CreatedAtNEQ

func CreatedAtNEQ(v time.Time) predicate.Block

CreatedAtNEQ applies the NEQ predicate on the "created_at" field.

func CreatedAtNotIn

func CreatedAtNotIn(vs ...time.Time) predicate.Block

CreatedAtNotIn applies the NotIn predicate on the "created_at" field.

func HasMsgs

func HasMsgs() predicate.Block

HasMsgs applies the HasEdge predicate on the "msgs" edge.

func HasMsgsWith

func HasMsgsWith(preds ...predicate.Msg) predicate.Block

HasMsgsWith applies the HasEdge predicate on the "msgs" edge with a given conditions (other predicates).

func HasReceipts

func HasReceipts() predicate.Block

HasReceipts applies the HasEdge predicate on the "receipts" edge.

func HasReceiptsWith

func HasReceiptsWith(preds ...predicate.Receipt) predicate.Block

HasReceiptsWith applies the HasEdge predicate on the "receipts" edge with a given conditions (other predicates).

func Hash added in v0.1.7

func Hash(v []byte) predicate.Block

Hash applies equality check predicate on the "hash" field. It's identical to HashEQ.

func HashEQ added in v0.1.7

func HashEQ(v []byte) predicate.Block

HashEQ applies the EQ predicate on the "hash" field.

func HashGT added in v0.1.7

func HashGT(v []byte) predicate.Block

HashGT applies the GT predicate on the "hash" field.

func HashGTE added in v0.1.7

func HashGTE(v []byte) predicate.Block

HashGTE applies the GTE predicate on the "hash" field.

func HashIn added in v0.1.7

func HashIn(vs ...[]byte) predicate.Block

HashIn applies the In predicate on the "hash" field.

func HashLT added in v0.1.7

func HashLT(v []byte) predicate.Block

HashLT applies the LT predicate on the "hash" field.

func HashLTE added in v0.1.7

func HashLTE(v []byte) predicate.Block

HashLTE applies the LTE predicate on the "hash" field.

func HashNEQ added in v0.1.7

func HashNEQ(v []byte) predicate.Block

HashNEQ applies the NEQ predicate on the "hash" field.

func HashNotIn added in v0.1.7

func HashNotIn(vs ...[]byte) predicate.Block

HashNotIn applies the NotIn predicate on the "hash" field.

func Height added in v0.1.7

func Height(v uint64) predicate.Block

Height applies equality check predicate on the "height" field. It's identical to HeightEQ.

func HeightEQ added in v0.1.7

func HeightEQ(v uint64) predicate.Block

HeightEQ applies the EQ predicate on the "height" field.

func HeightGT added in v0.1.7

func HeightGT(v uint64) predicate.Block

HeightGT applies the GT predicate on the "height" field.

func HeightGTE added in v0.1.7

func HeightGTE(v uint64) predicate.Block

HeightGTE applies the GTE predicate on the "height" field.

func HeightIn added in v0.1.7

func HeightIn(vs ...uint64) predicate.Block

HeightIn applies the In predicate on the "height" field.

func HeightLT added in v0.1.7

func HeightLT(v uint64) predicate.Block

HeightLT applies the LT predicate on the "height" field.

func HeightLTE added in v0.1.7

func HeightLTE(v uint64) predicate.Block

HeightLTE applies the LTE predicate on the "height" field.

func HeightNEQ added in v0.1.7

func HeightNEQ(v uint64) predicate.Block

HeightNEQ applies the NEQ predicate on the "height" field.

func HeightNotIn added in v0.1.7

func HeightNotIn(vs ...uint64) predicate.Block

HeightNotIn applies the NotIn predicate on the "height" field.

func ID

func ID(id int) predicate.Block

ID filters vertices based on their ID field.

func IDEQ

func IDEQ(id int) predicate.Block

IDEQ applies the EQ predicate on the ID field.

func IDGT

func IDGT(id int) predicate.Block

IDGT applies the GT predicate on the ID field.

func IDGTE

func IDGTE(id int) predicate.Block

IDGTE applies the GTE predicate on the ID field.

func IDIn

func IDIn(ids ...int) predicate.Block

IDIn applies the In predicate on the ID field.

func IDLT

func IDLT(id int) predicate.Block

IDLT applies the LT predicate on the ID field.

func IDLTE

func IDLTE(id int) predicate.Block

IDLTE applies the LTE predicate on the ID field.

func IDNEQ

func IDNEQ(id int) predicate.Block

IDNEQ applies the NEQ predicate on the ID field.

func IDNotIn

func IDNotIn(ids ...int) predicate.Block

IDNotIn applies the NotIn predicate on the ID field.

func Not

Not applies the not operator on the given predicate.

func Offset added in v0.1.7

func Offset(v uint64) predicate.Block

Offset applies equality check predicate on the "offset" field. It's identical to OffsetEQ.

func OffsetEQ added in v0.1.7

func OffsetEQ(v uint64) predicate.Block

OffsetEQ applies the EQ predicate on the "offset" field.

func OffsetGT added in v0.1.7

func OffsetGT(v uint64) predicate.Block

OffsetGT applies the GT predicate on the "offset" field.

func OffsetGTE added in v0.1.7

func OffsetGTE(v uint64) predicate.Block

OffsetGTE applies the GTE predicate on the "offset" field.

func OffsetIn added in v0.1.7

func OffsetIn(vs ...uint64) predicate.Block

OffsetIn applies the In predicate on the "offset" field.

func OffsetLT added in v0.1.7

func OffsetLT(v uint64) predicate.Block

OffsetLT applies the LT predicate on the "offset" field.

func OffsetLTE added in v0.1.7

func OffsetLTE(v uint64) predicate.Block

OffsetLTE applies the LTE predicate on the "offset" field.

func OffsetNEQ added in v0.1.7

func OffsetNEQ(v uint64) predicate.Block

OffsetNEQ applies the NEQ predicate on the "offset" field.

func OffsetNotIn added in v0.1.7

func OffsetNotIn(vs ...uint64) predicate.Block

OffsetNotIn applies the NotIn predicate on the "offset" field.

func Or

func Or(predicates ...predicate.Block) predicate.Block

Or groups predicates with the OR operator between them.

func Timestamp

func Timestamp(v time.Time) predicate.Block

Timestamp applies equality check predicate on the "timestamp" field. It's identical to TimestampEQ.

func TimestampEQ

func TimestampEQ(v time.Time) predicate.Block

TimestampEQ applies the EQ predicate on the "timestamp" field.

func TimestampGT

func TimestampGT(v time.Time) predicate.Block

TimestampGT applies the GT predicate on the "timestamp" field.

func TimestampGTE

func TimestampGTE(v time.Time) predicate.Block

TimestampGTE applies the GTE predicate on the "timestamp" field.

func TimestampIn

func TimestampIn(vs ...time.Time) predicate.Block

TimestampIn applies the In predicate on the "timestamp" field.

func TimestampLT

func TimestampLT(v time.Time) predicate.Block

TimestampLT applies the LT predicate on the "timestamp" field.

func TimestampLTE

func TimestampLTE(v time.Time) predicate.Block

TimestampLTE applies the LTE predicate on the "timestamp" field.

func TimestampNEQ

func TimestampNEQ(v time.Time) predicate.Block

TimestampNEQ applies the NEQ predicate on the "timestamp" field.

func TimestampNotIn

func TimestampNotIn(vs ...time.Time) predicate.Block

TimestampNotIn applies the NotIn predicate on the "timestamp" field.

func ValidColumn

func ValidColumn(column string) bool

ValidColumn reports if the column name is valid (part of the table columns).

Types

type OrderOption

type OrderOption func(*sql.Selector)

OrderOption defines the ordering options for the Block queries.

func ByChainID added in v0.1.7

func ByChainID(opts ...sql.OrderTermOption) OrderOption

ByChainID orders the results by the chain_id field.

func ByCreatedAt

func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption

ByCreatedAt orders the results by the created_at field.

func ByHeight added in v0.1.7

func ByHeight(opts ...sql.OrderTermOption) OrderOption

ByHeight orders the results by the height field.

func ByID

func ByID(opts ...sql.OrderTermOption) OrderOption

ByID orders the results by the id field.

func ByMsgs

func ByMsgs(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByMsgs orders the results by msgs terms.

func ByMsgsCount

func ByMsgsCount(opts ...sql.OrderTermOption) OrderOption

ByMsgsCount orders the results by msgs count.

func ByOffset added in v0.1.7

func ByOffset(opts ...sql.OrderTermOption) OrderOption

ByOffset orders the results by the offset field.

func ByReceipts

func ByReceipts(term sql.OrderTerm, terms ...sql.OrderTerm) OrderOption

ByReceipts orders the results by receipts terms.

func ByReceiptsCount

func ByReceiptsCount(opts ...sql.OrderTermOption) OrderOption

ByReceiptsCount orders the results by receipts count.

func ByTimestamp

func ByTimestamp(opts ...sql.OrderTermOption) OrderOption

ByTimestamp orders the results by the timestamp field.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL