models

package
v0.0.0-...-9742f5a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TransactionStatusPending  = "pending"
	TransactionStatusMined    = "mined"
	TransactionStatusRejected = "rejected"
)

Enum values for transaction_status

Variables

View Source
var BlockColumns = struct {
	Rowid    string
	Height   string
	BlockID  string
	ParentID string
	Raw      string
}{
	Rowid:    "rowid",
	Height:   "height",
	BlockID:  "block_id",
	ParentID: "parent_id",
	Raw:      "raw",
}
View Source
var BlockRels = struct {
}{}

BlockRels is where relationship names are stored.

View Source
var BlockWhere = struct {
	Rowid    whereHelperint
	Height   whereHelperint
	BlockID  whereHelper__byte
	ParentID whereHelpernull_Bytes
	Raw      whereHelper__byte
}{
	Rowid:    whereHelperint{/* contains filtered or unexported fields */},
	Height:   whereHelperint{/* contains filtered or unexported fields */},
	BlockID:  whereHelper__byte{/* contains filtered or unexported fields */},
	ParentID: whereHelpernull_Bytes{/* contains filtered or unexported fields */},
	Raw:      whereHelper__byte{/* contains filtered or unexported fields */},
}
View Source
var ErrSyncFail = errors.New("models: failed to synchronize data after insert")

ErrSyncFail occurs during insert when the record could not be retrieved in order to populate default value information. This usually happens when LastInsertId fails or there was a primary key configuration that was not resolvable.

View Source
var MempoolTransactionColumns = struct {
	Rowid string
	Txid  string
	Raw   string
}{
	Rowid: "rowid",
	Txid:  "txid",
	Raw:   "raw",
}
View Source
var MempoolTransactionRels = struct {
}{}

MempoolTransactionRels is where relationship names are stored.

View Source
var MempoolTransactionWhere = struct {
	Rowid whereHelperint
	Txid  whereHelpertypes_BytesArray
	Raw   whereHelper__byte
}{
	Rowid: whereHelperint{/* contains filtered or unexported fields */},
	Txid:  whereHelpertypes_BytesArray{/* contains filtered or unexported fields */},
	Raw:   whereHelper__byte{/* contains filtered or unexported fields */},
}
View Source
var TableNames = struct {
	Block               string
	MempoolTransaction  string
	TransactionAuditlog string
	Utxo                string
}{
	Block:               "block",
	MempoolTransaction:  "mempool_transaction",
	TransactionAuditlog: "transaction_auditlog",
	Utxo:                "utxo",
}
View Source
var TransactionAuditlogColumns = struct {
	Rowid  string
	Txid   string
	Raw    string
	Status string
}{
	Rowid:  "rowid",
	Txid:   "txid",
	Raw:    "raw",
	Status: "status",
}
View Source
var TransactionAuditlogRels = struct {
}{}

TransactionAuditlogRels is where relationship names are stored.

View Source
var TransactionAuditlogWhere = struct {
	Rowid  whereHelperint
	Txid   whereHelpertypes_BytesArray
	Raw    whereHelper__byte
	Status whereHelperstring
}{
	Rowid:  whereHelperint{/* contains filtered or unexported fields */},
	Txid:   whereHelpertypes_BytesArray{/* contains filtered or unexported fields */},
	Raw:    whereHelper__byte{/* contains filtered or unexported fields */},
	Status: whereHelperstring{/* contains filtered or unexported fields */},
}
View Source
var UtxoColumns = struct {
	Rowid        string
	Txid         string
	OutputIdx    string
	Value        string
	ScriptPubkey string
}{
	Rowid:        "rowid",
	Txid:         "txid",
	OutputIdx:    "output_idx",
	Value:        "value",
	ScriptPubkey: "script_pubkey",
}
View Source
var UtxoRels = struct {
}{}

UtxoRels is where relationship names are stored.

View Source
var UtxoWhere = struct {
	Rowid        whereHelperint
	Txid         whereHelpertypes_BytesArray
	OutputIdx    whereHelperint
	Value        whereHelperint
	ScriptPubkey whereHelper__byte
}{
	Rowid:        whereHelperint{/* contains filtered or unexported fields */},
	Txid:         whereHelpertypes_BytesArray{/* contains filtered or unexported fields */},
	OutputIdx:    whereHelperint{/* contains filtered or unexported fields */},
	Value:        whereHelperint{/* contains filtered or unexported fields */},
	ScriptPubkey: whereHelper__byte{/* contains filtered or unexported fields */},
}

Functions

func AddBlockHook

func AddBlockHook(hookPoint boil.HookPoint, blockHook BlockHook)

AddBlockHook registers your hook function for all future operations.

func AddMempoolTransactionHook

func AddMempoolTransactionHook(hookPoint boil.HookPoint, mempoolTransactionHook MempoolTransactionHook)

AddMempoolTransactionHook registers your hook function for all future operations.

func AddTransactionAuditlogHook

func AddTransactionAuditlogHook(hookPoint boil.HookPoint, transactionAuditlogHook TransactionAuditlogHook)

AddTransactionAuditlogHook registers your hook function for all future operations.

func AddUtxoHook

func AddUtxoHook(hookPoint boil.HookPoint, utxoHook UtxoHook)

AddUtxoHook registers your hook function for all future operations.

func BlockExists

func BlockExists(ctx context.Context, exec boil.ContextExecutor, rowid int) (bool, error)

BlockExists checks if the Block row exists.

func Blocks

func Blocks(mods ...qm.QueryMod) blockQuery

Blocks retrieves all the records using an executor.

func MempoolTransactionExists

func MempoolTransactionExists(ctx context.Context, exec boil.ContextExecutor, rowid int) (bool, error)

MempoolTransactionExists checks if the MempoolTransaction row exists.

func MempoolTransactions

func MempoolTransactions(mods ...qm.QueryMod) mempoolTransactionQuery

MempoolTransactions retrieves all the records using an executor.

func NewQuery

func NewQuery(mods ...qm.QueryMod) *queries.Query

NewQuery initializes a new Query using the passed in QueryMods

func TransactionAuditlogExists

func TransactionAuditlogExists(ctx context.Context, exec boil.ContextExecutor, rowid int) (bool, error)

TransactionAuditlogExists checks if the TransactionAuditlog row exists.

func TransactionAuditlogs

func TransactionAuditlogs(mods ...qm.QueryMod) transactionAuditlogQuery

TransactionAuditlogs retrieves all the records using an executor.

func UtxoExists

func UtxoExists(ctx context.Context, exec boil.ContextExecutor, rowid int) (bool, error)

UtxoExists checks if the Utxo row exists.

func Utxos

func Utxos(mods ...qm.QueryMod) utxoQuery

Utxos retrieves all the records using an executor.

Types

type Block

type Block struct {
	Rowid    int        `boil:"rowid" json:"rowid" toml:"rowid" yaml:"rowid"`
	Height   int        `boil:"height" json:"height" toml:"height" yaml:"height"`
	BlockID  []byte     `boil:"block_id" json:"block_id" toml:"block_id" yaml:"block_id"`
	ParentID null.Bytes `boil:"parent_id" json:"parent_id,omitempty" toml:"parent_id" yaml:"parent_id,omitempty"`
	Raw      []byte     `boil:"raw" json:"raw" toml:"raw" yaml:"raw"`

	R *blockR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L blockL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Block is an object representing the database table.

func FindBlock

func FindBlock(ctx context.Context, exec boil.ContextExecutor, rowid int, selectCols ...string) (*Block, error)

FindBlock retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Block) Delete

func (o *Block) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Block record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Block) Insert

func (o *Block) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Block) Reload

func (o *Block) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Block) Update

func (o *Block) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Block. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*Block) Upsert

func (o *Block) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type BlockHook

type BlockHook func(context.Context, boil.ContextExecutor, *Block) error

BlockHook is the signature for custom Block hook methods

type BlockSlice

type BlockSlice []*Block

BlockSlice is an alias for a slice of pointers to Block. This should generally be used opposed to []Block.

func (BlockSlice) DeleteAll

func (o BlockSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*BlockSlice) ReloadAll

func (o *BlockSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (BlockSlice) UpdateAll

func (o BlockSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type M

type M map[string]interface{}

M type is for providing columns and column values to UpdateAll.

type MempoolTransaction

type MempoolTransaction struct {
	Rowid int              `boil:"rowid" json:"rowid" toml:"rowid" yaml:"rowid"`
	Txid  types.BytesArray `boil:"txid" json:"txid" toml:"txid" yaml:"txid"`
	Raw   []byte           `boil:"raw" json:"raw" toml:"raw" yaml:"raw"`

	R *mempoolTransactionR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L mempoolTransactionL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

MempoolTransaction is an object representing the database table.

func FindMempoolTransaction

func FindMempoolTransaction(ctx context.Context, exec boil.ContextExecutor, rowid int, selectCols ...string) (*MempoolTransaction, error)

FindMempoolTransaction retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*MempoolTransaction) Delete

Delete deletes a single MempoolTransaction record with an executor. Delete will match against the primary key column to find the record to delete.

func (*MempoolTransaction) Insert

func (o *MempoolTransaction) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*MempoolTransaction) Reload

Reload refetches the object from the database using the primary keys with an executor.

func (*MempoolTransaction) Update

func (o *MempoolTransaction) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the MempoolTransaction. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*MempoolTransaction) Upsert

func (o *MempoolTransaction) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type MempoolTransactionHook

type MempoolTransactionHook func(context.Context, boil.ContextExecutor, *MempoolTransaction) error

MempoolTransactionHook is the signature for custom MempoolTransaction hook methods

type MempoolTransactionSlice

type MempoolTransactionSlice []*MempoolTransaction

MempoolTransactionSlice is an alias for a slice of pointers to MempoolTransaction. This should generally be used opposed to []MempoolTransaction.

func (MempoolTransactionSlice) DeleteAll

DeleteAll deletes all rows in the slice, using an executor.

func (*MempoolTransactionSlice) ReloadAll

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (MempoolTransactionSlice) UpdateAll

func (o MempoolTransactionSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type TransactionAuditlog

type TransactionAuditlog struct {
	Rowid  int              `boil:"rowid" json:"rowid" toml:"rowid" yaml:"rowid"`
	Txid   types.BytesArray `boil:"txid" json:"txid" toml:"txid" yaml:"txid"`
	Raw    []byte           `boil:"raw" json:"raw" toml:"raw" yaml:"raw"`
	Status string           `boil:"status" json:"status" toml:"status" yaml:"status"`

	R *transactionAuditlogR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L transactionAuditlogL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

TransactionAuditlog is an object representing the database table.

func FindTransactionAuditlog

func FindTransactionAuditlog(ctx context.Context, exec boil.ContextExecutor, rowid int, selectCols ...string) (*TransactionAuditlog, error)

FindTransactionAuditlog retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*TransactionAuditlog) Delete

Delete deletes a single TransactionAuditlog record with an executor. Delete will match against the primary key column to find the record to delete.

func (*TransactionAuditlog) Insert

func (o *TransactionAuditlog) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*TransactionAuditlog) Reload

Reload refetches the object from the database using the primary keys with an executor.

func (*TransactionAuditlog) Update

func (o *TransactionAuditlog) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the TransactionAuditlog. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*TransactionAuditlog) Upsert

func (o *TransactionAuditlog) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type TransactionAuditlogHook

type TransactionAuditlogHook func(context.Context, boil.ContextExecutor, *TransactionAuditlog) error

TransactionAuditlogHook is the signature for custom TransactionAuditlog hook methods

type TransactionAuditlogSlice

type TransactionAuditlogSlice []*TransactionAuditlog

TransactionAuditlogSlice is an alias for a slice of pointers to TransactionAuditlog. This should generally be used opposed to []TransactionAuditlog.

func (TransactionAuditlogSlice) DeleteAll

DeleteAll deletes all rows in the slice, using an executor.

func (*TransactionAuditlogSlice) ReloadAll

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (TransactionAuditlogSlice) UpdateAll

func (o TransactionAuditlogSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

type Utxo

type Utxo struct {
	Rowid        int              `boil:"rowid" json:"rowid" toml:"rowid" yaml:"rowid"`
	Txid         types.BytesArray `boil:"txid" json:"txid" toml:"txid" yaml:"txid"`
	OutputIdx    int              `boil:"output_idx" json:"output_idx" toml:"output_idx" yaml:"output_idx"`
	Value        int              `boil:"value" json:"value" toml:"value" yaml:"value"`
	ScriptPubkey []byte           `boil:"script_pubkey" json:"script_pubkey" toml:"script_pubkey" yaml:"script_pubkey"`

	R *utxoR `boil:"-" json:"-" toml:"-" yaml:"-"`
	L utxoL  `boil:"-" json:"-" toml:"-" yaml:"-"`
}

Utxo is an object representing the database table.

func FindUtxo

func FindUtxo(ctx context.Context, exec boil.ContextExecutor, rowid int, selectCols ...string) (*Utxo, error)

FindUtxo retrieves a single record by ID with an executor. If selectCols is empty Find will return all columns.

func (*Utxo) Delete

func (o *Utxo) Delete(ctx context.Context, exec boil.ContextExecutor) (int64, error)

Delete deletes a single Utxo record with an executor. Delete will match against the primary key column to find the record to delete.

func (*Utxo) Insert

func (o *Utxo) Insert(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) error

Insert a single record using an executor. See boil.Columns.InsertColumnSet documentation to understand column list inference for inserts.

func (*Utxo) Reload

func (o *Utxo) Reload(ctx context.Context, exec boil.ContextExecutor) error

Reload refetches the object from the database using the primary keys with an executor.

func (*Utxo) Update

func (o *Utxo) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error)

Update uses an executor to update the Utxo. See boil.Columns.UpdateColumnSet documentation to understand column list inference for updates. Update does not automatically update the record in case of default values. Use .Reload() to refresh the records.

func (*Utxo) Upsert

func (o *Utxo) Upsert(ctx context.Context, exec boil.ContextExecutor, updateOnConflict bool, conflictColumns []string, updateColumns, insertColumns boil.Columns) error

Upsert attempts an insert using an executor, and does an update or ignore on conflict. See boil.Columns documentation for how to properly use updateColumns and insertColumns.

type UtxoHook

type UtxoHook func(context.Context, boil.ContextExecutor, *Utxo) error

UtxoHook is the signature for custom Utxo hook methods

type UtxoSlice

type UtxoSlice []*Utxo

UtxoSlice is an alias for a slice of pointers to Utxo. This should generally be used opposed to []Utxo.

func (UtxoSlice) DeleteAll

func (o UtxoSlice) DeleteAll(ctx context.Context, exec boil.ContextExecutor) (int64, error)

DeleteAll deletes all rows in the slice, using an executor.

func (*UtxoSlice) ReloadAll

func (o *UtxoSlice) ReloadAll(ctx context.Context, exec boil.ContextExecutor) error

ReloadAll refetches every row with matching primary key column values and overwrites the original object slice with the newly updated slice.

func (UtxoSlice) UpdateAll

func (o UtxoSlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error)

UpdateAll updates all rows with the specified column values, using an executor.

Jump to

Keyboard shortcuts

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