model

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Package model contains the types for schema 'public'.

Index

Constants

This section is empty.

Variables

View Source
var XOLog = func(string, ...interface{}) {}

XOLog provides the log func used by generated queries.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID          int64          `json:"id"`          // id
	Mail        sql.NullString `json:"mail"`        // mail
	Name        sql.NullString `json:"name"`        // name
	Avatar      sql.NullString `json:"avatar"`      // avatar
	Description sql.NullString `json:"description"` // description
	Status      sql.NullInt64  `json:"status"`      // status
	Password    sql.NullString `json:"password"`    // password
	CreatedAt   pq.NullTime    `json:"created_at"`  // created_at
	// contains filtered or unexported fields
}

Account represents a row from 'public.accounts'.

func AccountByID

func AccountByID(db XODB, id int64) (*Account, error)

AccountByID retrieves a row from 'public.accounts' as a Account.

Generated from index 'accounts_pkey'.

func AccountByMail

func AccountByMail(db XODB, mail sql.NullString) (*Account, error)

AccountByMail retrieves a row from 'public.accounts' as a Account.

Generated from index 'accounts_mail_idx'.

func AccountFilter

func AccountFilter(db XODB, filter, sort string, offset, limit int64) ([]*Account, error)

AccountsQuery returns offset-limit rows from 'public.accounts' filte by filter, ordered by "id" in descending order.

func (*Account) Delete

func (a *Account) Delete(db XODB) error

Delete deletes the Account from the database.

func (*Account) Deleted

func (a *Account) Deleted() bool

Deleted provides information if the Account has been deleted from the database.

func (*Account) Exists

func (a *Account) Exists() bool

Exists determines if the Account exists in the database.

func (*Account) Insert

func (a *Account) Insert(db XODB) error

Insert inserts the Account to the database.

func (*Account) Save

func (a *Account) Save(db XODB) error

Save saves the Account to the database.

func (*Account) Update

func (a *Account) Update(db XODB) error

Update updates the Account in the database.

func (*Account) Upsert

func (a *Account) Upsert(db XODB) error

Upsert performs an upsert for Account.

NOTE: PostgreSQL 9.5+ only

type App

type App struct {
	ID        int64          `json:"id"`         // id
	Name      sql.NullString `json:"name"`       // name
	SecretKey sql.NullString `json:"secret_key"` // secret_key
	Status    sql.NullInt64  `json:"status"`     // status
	AccountID sql.NullInt64  `json:"account_id"` // account_id
	CreatedAt pq.NullTime    `json:"created_at"` // created_at
	// contains filtered or unexported fields
}

App represents a row from 'public.apps'.

func AppByID

func AppByID(db XODB, id int64) (*App, error)

AppByID retrieves a row from 'public.apps' as a App.

Generated from index 'apps_pkey'.

func AppBySecretKey

func AppBySecretKey(db XODB, secretKey sql.NullString) (*App, error)

AppBySecretKey retrieves a row from 'public.apps' as a App.

Generated from index 'apps_secret_key_idx'.

func AppFilter

func AppFilter(db XODB, filter, sort string, offset, limit int64) ([]*App, error)

AppsQuery returns offset-limit rows from 'public.apps' filte by filter, ordered by "id" in descending order.

func AppsByAccountID

func AppsByAccountID(db XODB, accountID sql.NullInt64) ([]*App, error)

AppsByAccountID retrieves a row from 'public.apps' as a App.

Generated from index 'apps_account_id_idx'.

func (*App) Account

func (a *App) Account(db XODB) (*Account, error)

Account returns the Account associated with the App's AccountID (account_id).

Generated from foreign key 'apps_account_id_fkey'.

func (*App) Delete

func (a *App) Delete(db XODB) error

Delete deletes the App from the database.

func (*App) Deleted

func (a *App) Deleted() bool

Deleted provides information if the App has been deleted from the database.

func (*App) Exists

func (a *App) Exists() bool

Exists determines if the App exists in the database.

func (*App) Insert

func (a *App) Insert(db XODB) error

Insert inserts the App to the database.

func (*App) Save

func (a *App) Save(db XODB) error

Save saves the App to the database.

func (*App) Update

func (a *App) Update(db XODB) error

Update updates the App in the database.

func (*App) Upsert

func (a *App) Upsert(db XODB) error

Upsert performs an upsert for App.

NOTE: PostgreSQL 9.5+ only

type Block

type Block struct {
	ID              int64          `json:"id"`               // id
	ChainID         sql.NullString `json:"chain_id"`         // chain_id
	Height          sql.NullInt64  `json:"height"`           // height
	NumTxs          sql.NullInt64  `json:"num_txs"`          // num_txs
	TotalTxs        sql.NullInt64  `json:"total_txs"`        // total_txs
	DataHash        sql.NullString `json:"data_hash"`        // data_hash
	ValidatorsHash  sql.NullString `json:"validators_hash"`  // validators_hash
	Time            pq.NullTime    `json:"time"`             // time
	CreatedAt       pq.NullTime    `json:"created_at"`       // created_at
	ValidatorsNum   sql.NullInt64  `json:"validators_num"`   // validators_num
	ValidatorsTotal sql.NullInt64  `json:"validators_total"` // validators_total
	// contains filtered or unexported fields
}

Block represents a row from 'public.blocks'.

func BlockByChainIDHeight

func BlockByChainIDHeight(db XODB, chainID sql.NullString, height sql.NullInt64) (*Block, error)

BlockByChainIDHeight retrieves a row from 'public.blocks' as a Block.

Generated from index 'blocks_chain_id_height_idx'.

func BlockByID

func BlockByID(db XODB, id int64) (*Block, error)

BlockByID retrieves a row from 'public.blocks' as a Block.

Generated from index 'blocks_pkey'.

func BlockFilter

func BlockFilter(db XODB, filter, sort string, offset, limit int64) ([]*Block, error)

BlocksQuery returns offset-limit rows from 'public.blocks' filte by filter, ordered by "id" in descending order.

func BlocksByChainID

func BlocksByChainID(db XODB, chainID sql.NullString) ([]*Block, error)

BlocksByChainID retrieves a row from 'public.blocks' as a Block.

Generated from index 'blocks_chain_id_idx'.

func (*Block) Delete

func (b *Block) Delete(db XODB) error

Delete deletes the Block from the database.

func (*Block) Deleted

func (b *Block) Deleted() bool

Deleted provides information if the Block has been deleted from the database.

func (*Block) Exists

func (b *Block) Exists() bool

Exists determines if the Block exists in the database.

func (*Block) Insert

func (b *Block) Insert(db XODB) error

Insert inserts the Block to the database.

func (*Block) Save

func (b *Block) Save(db XODB) error

Save saves the Block to the database.

func (*Block) Update

func (b *Block) Update(db XODB) error

Update updates the Block in the database.

func (*Block) Upsert

func (b *Block) Upsert(db XODB) error

Upsert performs an upsert for Block.

NOTE: PostgreSQL 9.5+ only

type BlockValidator

type BlockValidator struct {
	ID               int64          `json:"id"`                // id
	ChainID          sql.NullString `json:"chain_id"`          // chain_id
	Height           sql.NullInt64  `json:"height"`            // height
	ValidatorAddress sql.NullString `json:"validator_address"` // validator_address
	ValidatorIndex   sql.NullInt64  `json:"validator_index"`   // validator_index
	Type             sql.NullInt64  `json:"type"`              // type
	Round            sql.NullInt64  `json:"round"`             // round
	Signature        sql.NullString `json:"signature"`         // signature
	VotingPower      sql.NullInt64  `json:"voting_power"`      // voting_power
	Accum            sql.NullInt64  `json:"accum"`             // accum
	Time             pq.NullTime    `json:"time"`              // time
	CreatedAt        pq.NullTime    `json:"created_at"`        // created_at
	// contains filtered or unexported fields
}

BlockValidator represents a row from 'public.block_validators'.

func BlockValidatorByID

func BlockValidatorByID(db XODB, id int64) (*BlockValidator, error)

BlockValidatorByID retrieves a row from 'public.block_validators' as a BlockValidator.

Generated from index 'block_validators_pkey'.

func BlockValidatorFilter

func BlockValidatorFilter(db XODB, filter, sort string, offset, limit int64) ([]*BlockValidator, error)

BlockValidatorsQuery returns offset-limit rows from 'public.block_validators' filte by filter, ordered by "id" in descending order.

func BlockValidatorsByChainIDHeight

func BlockValidatorsByChainIDHeight(db XODB, chainID sql.NullString, height sql.NullInt64) ([]*BlockValidator, error)

BlockValidatorsByChainIDHeight retrieves a row from 'public.block_validators' as a BlockValidator.

Generated from index 'block_validators_chain_id_height_idx'.

func BlockValidatorsByValidatorAddress

func BlockValidatorsByValidatorAddress(db XODB, validatorAddress sql.NullString) ([]*BlockValidator, error)

BlockValidatorsByValidatorAddress retrieves a row from 'public.block_validators' as a BlockValidator.

Generated from index 'block_validators_address_idx'.

func (*BlockValidator) Delete

func (bv *BlockValidator) Delete(db XODB) error

Delete deletes the BlockValidator from the database.

func (*BlockValidator) Deleted

func (bv *BlockValidator) Deleted() bool

Deleted provides information if the BlockValidator has been deleted from the database.

func (*BlockValidator) Exists

func (bv *BlockValidator) Exists() bool

Exists determines if the BlockValidator exists in the database.

func (*BlockValidator) Insert

func (bv *BlockValidator) Insert(db XODB) error

Insert inserts the BlockValidator to the database.

func (*BlockValidator) Save

func (bv *BlockValidator) Save(db XODB) error

Save saves the BlockValidator to the database.

func (*BlockValidator) Update

func (bv *BlockValidator) Update(db XODB) error

Update updates the BlockValidator in the database.

func (*BlockValidator) Upsert

func (bv *BlockValidator) Upsert(db XODB) error

Upsert performs an upsert for BlockValidator.

NOTE: PostgreSQL 9.5+ only

type ConsensusState

type ConsensusState struct {
	ID              int64          `json:"id"`               // id
	ChainID         sql.NullString `json:"chain_id"`         // chain_id
	Height          sql.NullString `json:"height"`           // height
	Round           sql.NullString `json:"round"`            // round
	Step            sql.NullString `json:"step"`             // step
	PrevotesNum     sql.NullInt64  `json:"prevotes_num"`     // prevotes_num
	PrevotesValue   sql.NullString `json:"prevotes_value"`   // prevotes_value
	PrecommitsNum   sql.NullInt64  `json:"precommits_num"`   // precommits_num
	PrecommitsValue sql.NullString `json:"precommits_value"` // precommits_value
	StartTime       sql.NullString `json:"start_time"`       // start_time
	// contains filtered or unexported fields
}

ConsensusState represents a row from 'public.consensus_state'.

func ConsensusStateByChainID

func ConsensusStateByChainID(db XODB, chainID sql.NullString) (*ConsensusState, error)

ConsensusStateByChainID retrieves a row from 'public.consensus_state' as a ConsensusState.

Generated from index 'consensus_state_chain_id_idx'.

func ConsensusStateByID

func ConsensusStateByID(db XODB, id int64) (*ConsensusState, error)

ConsensusStateByID retrieves a row from 'public.consensus_state' as a ConsensusState.

Generated from index 'consensus_state_pkey'.

func ConsensusStateFilter

func ConsensusStateFilter(db XODB, filter, sort string, offset, limit int64) ([]*ConsensusState, error)

ConsensusStatesQuery returns offset-limit rows from 'public.consensus_state' filte by filter, ordered by "id" in descending order.

func (*ConsensusState) Delete

func (cs *ConsensusState) Delete(db XODB) error

Delete deletes the ConsensusState from the database.

func (*ConsensusState) Deleted

func (cs *ConsensusState) Deleted() bool

Deleted provides information if the ConsensusState has been deleted from the database.

func (*ConsensusState) Exists

func (cs *ConsensusState) Exists() bool

Exists determines if the ConsensusState exists in the database.

func (*ConsensusState) Insert

func (cs *ConsensusState) Insert(db XODB) error

Insert inserts the ConsensusState to the database.

func (*ConsensusState) Save

func (cs *ConsensusState) Save(db XODB) error

Save saves the ConsensusState to the database.

func (*ConsensusState) Update

func (cs *ConsensusState) Update(db XODB) error

Update updates the ConsensusState in the database.

func (*ConsensusState) Upsert

func (cs *ConsensusState) Upsert(db XODB) error

Upsert performs an upsert for ConsensusState.

NOTE: PostgreSQL 9.5+ only

type Genesi

type Genesi struct {
	ID          int64          `json:"id"`           // id
	ChainID     sql.NullString `json:"chain_id"`     // chain_id
	GenesisTime pq.NullTime    `json:"genesis_time"` // genesis_time
	Data        sql.NullString `json:"data"`         // data
	CreatedAt   pq.NullTime    `json:"created_at"`   // created_at
	// contains filtered or unexported fields
}

Genesi represents a row from 'public.genesis'.

func GenesiByChainID

func GenesiByChainID(db XODB, chainID sql.NullString) (*Genesi, error)

GenesiByChainID retrieves a row from 'public.genesis' as a Genesi.

Generated from index 'genesis_chain_id_idx'.

func GenesiByID

func GenesiByID(db XODB, id int64) (*Genesi, error)

GenesiByID retrieves a row from 'public.genesis' as a Genesi.

Generated from index 'genesis_pkey'.

func GenesiFilter

func GenesiFilter(db XODB, filter, sort string, offset, limit int64) ([]*Genesi, error)

GenesisQuery returns offset-limit rows from 'public.genesis' filte by filter, ordered by "id" in descending order.

func (*Genesi) Delete

func (g *Genesi) Delete(db XODB) error

Delete deletes the Genesi from the database.

func (*Genesi) Deleted

func (g *Genesi) Deleted() bool

Deleted provides information if the Genesi has been deleted from the database.

func (*Genesi) Exists

func (g *Genesi) Exists() bool

Exists determines if the Genesi exists in the database.

func (*Genesi) Insert

func (g *Genesi) Insert(db XODB) error

Insert inserts the Genesi to the database.

func (*Genesi) Save

func (g *Genesi) Save(db XODB) error

Save saves the Genesi to the database.

func (*Genesi) Update

func (g *Genesi) Update(db XODB) error

Update updates the Genesi in the database.

func (*Genesi) Upsert

func (g *Genesi) Upsert(db XODB) error

Upsert performs an upsert for Genesi.

NOTE: PostgreSQL 9.5+ only

type LoginStatus

type LoginStatus struct {
	ID        int64          `json:"id"`         // id
	AccountID sql.NullInt64  `json:"account_id"` // account_id
	LoginType sql.NullInt64  `json:"login_type"` // login_type
	Token     sql.NullString `json:"token"`      // token
	ExpiredAt pq.NullTime    `json:"expired_at"` // expired_at
	// contains filtered or unexported fields
}

LoginStatus represents a row from 'public.login_status'.

func LoginStatusByAccountID

func LoginStatusByAccountID(db XODB, accountID sql.NullInt64) (*LoginStatus, error)

LoginStatusByAccountID retrieves a row from 'public.login_status' as a LoginStatus.

Generated from index 'login_status_account_id_idx'.

func LoginStatusByID

func LoginStatusByID(db XODB, id int64) (*LoginStatus, error)

LoginStatusByID retrieves a row from 'public.login_status' as a LoginStatus.

Generated from index 'login_status_pkey'.

func LoginStatusByToken

func LoginStatusByToken(db XODB, token sql.NullString) (*LoginStatus, error)

LoginStatusByToken retrieves a row from 'public.login_status' as a LoginStatus.

Generated from index 'login_status_token_idx'.

func LoginStatusFilter

func LoginStatusFilter(db XODB, filter, sort string, offset, limit int64) ([]*LoginStatus, error)

LoginStatussQuery returns offset-limit rows from 'public.login_status' filte by filter, ordered by "id" in descending order.

func (*LoginStatus) Account

func (ls *LoginStatus) Account(db XODB) (*Account, error)

Account returns the Account associated with the LoginStatus's AccountID (account_id).

Generated from foreign key 'login_status_account_id_fkey'.

func (*LoginStatus) Delete

func (ls *LoginStatus) Delete(db XODB) error

Delete deletes the LoginStatus from the database.

func (*LoginStatus) Deleted

func (ls *LoginStatus) Deleted() bool

Deleted provides information if the LoginStatus has been deleted from the database.

func (*LoginStatus) Exists

func (ls *LoginStatus) Exists() bool

Exists determines if the LoginStatus exists in the database.

func (*LoginStatus) Insert

func (ls *LoginStatus) Insert(db XODB) error

Insert inserts the LoginStatus to the database.

func (*LoginStatus) Save

func (ls *LoginStatus) Save(db XODB) error

Save saves the LoginStatus to the database.

func (*LoginStatus) Update

func (ls *LoginStatus) Update(db XODB) error

Update updates the LoginStatus in the database.

func (*LoginStatus) Upsert

func (ls *LoginStatus) Upsert(db XODB) error

Upsert performs an upsert for LoginStatus.

NOTE: PostgreSQL 9.5+ only

type Node

type Node struct {
	ID        int64          `json:"id"`         // id
	Name      sql.NullString `json:"name"`       // name
	BaseURL   sql.NullString `json:"base_url"`   // base_url
	SecretKey sql.NullString `json:"secret_key"` // secret_key
	ChainID   sql.NullString `json:"chain_id"`   // chain_id
	GenesisID sql.NullInt64  `json:"genesis_id"` // genesis_id
	CreatedAt pq.NullTime    `json:"created_at"` // created_at
	// contains filtered or unexported fields
}

Node represents a row from 'public.nodes'.

func NodeByID

func NodeByID(db XODB, id int64) (*Node, error)

NodeByID retrieves a row from 'public.nodes' as a Node.

Generated from index 'nodes_pkey'.

func NodeByName

func NodeByName(db XODB, name sql.NullString) (*Node, error)

NodeByName retrieves a row from 'public.nodes' as a Node.

Generated from index 'nodes_name_idx'.

func NodeFilter

func NodeFilter(db XODB, filter, sort string, offset, limit int64) ([]*Node, error)

NodesQuery returns offset-limit rows from 'public.nodes' filte by filter, ordered by "id" in descending order.

func NodesByGenesisID

func NodesByGenesisID(db XODB, genesisID sql.NullInt64) ([]*Node, error)

NodesByGenesisID retrieves a row from 'public.nodes' as a Node.

Generated from index 'nodes_genesis_id_idx'.

func (*Node) Delete

func (n *Node) Delete(db XODB) error

Delete deletes the Node from the database.

func (*Node) Deleted

func (n *Node) Deleted() bool

Deleted provides information if the Node has been deleted from the database.

func (*Node) Exists

func (n *Node) Exists() bool

Exists determines if the Node exists in the database.

func (*Node) Genesi

func (n *Node) Genesi(db XODB) (*Genesi, error)

Genesi returns the Genesi associated with the Node's GenesisID (genesis_id).

Generated from foreign key 'nodes_genesis_id_fkey'.

func (*Node) Insert

func (n *Node) Insert(db XODB) error

Insert inserts the Node to the database.

func (*Node) Save

func (n *Node) Save(db XODB) error

Save saves the Node to the database.

func (*Node) Update

func (n *Node) Update(db XODB) error

Update updates the Node in the database.

func (*Node) Upsert

func (n *Node) Upsert(db XODB) error

Upsert performs an upsert for Node.

NOTE: PostgreSQL 9.5+ only

type NodeRoute

type NodeRoute struct {
	ID     int64          `json:"id"`      // id
	NodeID sql.NullInt64  `json:"node_id"` // node_id
	Route  sql.NullString `json:"route"`   // route
	Hidden sql.NullBool   `json:"hidden"`  // hidden
	// contains filtered or unexported fields
}

NodeRoute represents a row from 'public.node_route'.

func NodeRouteByID

func NodeRouteByID(db XODB, id int64) (*NodeRoute, error)

NodeRouteByID retrieves a row from 'public.node_route' as a NodeRoute.

Generated from index 'node_route_pkey'.

func NodeRouteFilter

func NodeRouteFilter(db XODB, filter, sort string, offset, limit int64) ([]*NodeRoute, error)

NodeRoutesQuery returns offset-limit rows from 'public.node_route' filte by filter, ordered by "id" in descending order.

func NodeRoutesByNodeID

func NodeRoutesByNodeID(db XODB, nodeID sql.NullInt64) ([]*NodeRoute, error)

NodeRoutesByNodeID retrieves a row from 'public.node_route' as a NodeRoute.

Generated from index 'node_route_node_id_idx'.

func (*NodeRoute) Delete

func (nr *NodeRoute) Delete(db XODB) error

Delete deletes the NodeRoute from the database.

func (*NodeRoute) Deleted

func (nr *NodeRoute) Deleted() bool

Deleted provides information if the NodeRoute has been deleted from the database.

func (*NodeRoute) Exists

func (nr *NodeRoute) Exists() bool

Exists determines if the NodeRoute exists in the database.

func (*NodeRoute) Insert

func (nr *NodeRoute) Insert(db XODB) error

Insert inserts the NodeRoute to the database.

func (*NodeRoute) Node

func (nr *NodeRoute) Node(db XODB) (*Node, error)

Node returns the Node associated with the NodeRoute's NodeID (node_id).

Generated from foreign key 'node_route_node_id_fkey'.

func (*NodeRoute) Save

func (nr *NodeRoute) Save(db XODB) error

Save saves the NodeRoute to the database.

func (*NodeRoute) Update

func (nr *NodeRoute) Update(db XODB) error

Update updates the NodeRoute in the database.

func (*NodeRoute) Upsert

func (nr *NodeRoute) Upsert(db XODB) error

Upsert performs an upsert for NodeRoute.

NOTE: PostgreSQL 9.5+ only

type Peer

type Peer struct {
	ID         int64          `json:"id"`          // id
	ChainID    sql.NullString `json:"chain_id"`    // chain_id
	Moniker    sql.NullString `json:"moniker"`     // moniker
	PeerID     sql.NullString `json:"peer_id"`     // peer_id
	ListenAddr sql.NullString `json:"listen_addr"` // listen_addr
	Network    sql.NullString `json:"network"`     // network
	Version    sql.NullString `json:"version"`     // version
	Channels   sql.NullString `json:"channels"`    // channels
	SendStart  pq.NullTime    `json:"send_start"`  // send_start
	RecvStart  pq.NullTime    `json:"recv_start"`  // recv_start
	CreatedAt  pq.NullTime    `json:"created_at"`  // created_at
	// contains filtered or unexported fields
}

Peer represents a row from 'public.peers'.

func PeerByID

func PeerByID(db XODB, id int64) (*Peer, error)

PeerByID retrieves a row from 'public.peers' as a Peer.

Generated from index 'peers_pkey'.

func PeerByPeerID

func PeerByPeerID(db XODB, peerID sql.NullString) (*Peer, error)

PeerByPeerID retrieves a row from 'public.peers' as a Peer.

Generated from index 'peers_peer_id_idx'.

func PeerFilter

func PeerFilter(db XODB, filter, sort string, offset, limit int64) ([]*Peer, error)

PeersQuery returns offset-limit rows from 'public.peers' filte by filter, ordered by "id" in descending order.

func PeersByChainID

func PeersByChainID(db XODB, chainID sql.NullString) ([]*Peer, error)

PeersByChainID retrieves a row from 'public.peers' as a Peer.

Generated from index 'peers_chain_id_idx'.

func (*Peer) Delete

func (p *Peer) Delete(db XODB) error

Delete deletes the Peer from the database.

func (*Peer) Deleted

func (p *Peer) Deleted() bool

Deleted provides information if the Peer has been deleted from the database.

func (*Peer) Exists

func (p *Peer) Exists() bool

Exists determines if the Peer exists in the database.

func (*Peer) Insert

func (p *Peer) Insert(db XODB) error

Insert inserts the Peer to the database.

func (*Peer) Save

func (p *Peer) Save(db XODB) error

Save saves the Peer to the database.

func (*Peer) Update

func (p *Peer) Update(db XODB) error

Update updates the Peer in the database.

func (*Peer) Upsert

func (p *Peer) Upsert(db XODB) error

Upsert performs an upsert for Peer.

NOTE: PostgreSQL 9.5+ only

type QmoonStatus

type QmoonStatus struct {
	ID    int64          `json:"id"`    // id
	Key   sql.NullString `json:"key"`   // key
	Value sql.NullString `json:"value"` // value
	// contains filtered or unexported fields
}

QmoonStatus represents a row from 'public.qmoon_status'.

func QmoonStatusByID

func QmoonStatusByID(db XODB, id int64) (*QmoonStatus, error)

QmoonStatusByID retrieves a row from 'public.qmoon_status' as a QmoonStatus.

Generated from index 'qmoon_status_pkey'.

func QmoonStatusByKey

func QmoonStatusByKey(db XODB, key sql.NullString) (*QmoonStatus, error)

QmoonStatusByKey retrieves a row from 'public.qmoon_status' as a QmoonStatus.

Generated from index 'qmoon_status_key_idx'.

func QmoonStatusFilter

func QmoonStatusFilter(db XODB, filter, sort string, offset, limit int64) ([]*QmoonStatus, error)

QmoonStatussQuery returns offset-limit rows from 'public.qmoon_status' filte by filter, ordered by "id" in descending order.

func (*QmoonStatus) Delete

func (qs *QmoonStatus) Delete(db XODB) error

Delete deletes the QmoonStatus from the database.

func (*QmoonStatus) Deleted

func (qs *QmoonStatus) Deleted() bool

Deleted provides information if the QmoonStatus has been deleted from the database.

func (*QmoonStatus) Exists

func (qs *QmoonStatus) Exists() bool

Exists determines if the QmoonStatus exists in the database.

func (*QmoonStatus) Insert

func (qs *QmoonStatus) Insert(db XODB) error

Insert inserts the QmoonStatus to the database.

func (*QmoonStatus) Save

func (qs *QmoonStatus) Save(db XODB) error

Save saves the QmoonStatus to the database.

func (*QmoonStatus) Update

func (qs *QmoonStatus) Update(db XODB) error

Update updates the QmoonStatus in the database.

func (*QmoonStatus) Upsert

func (qs *QmoonStatus) Upsert(db XODB) error

Upsert performs an upsert for QmoonStatus.

NOTE: PostgreSQL 9.5+ only

type ScannerValuer

type ScannerValuer interface {
	sql.Scanner
	driver.Valuer
}

ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

type StringSlice

type StringSlice []string

StringSlice is a slice of strings.

func (*StringSlice) Scan

func (ss *StringSlice) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface for StringSlice.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface for StringSlice.

type TmBlock

type TmBlock struct {
	ID        int64          `json:"id"`         // id
	ChainID   sql.NullString `json:"chain_id"`   // chain_id
	Height    sql.NullInt64  `json:"height"`     // height
	Data      sql.NullString `json:"data"`       // data
	CreatedAt pq.NullTime    `json:"created_at"` // created_at
	// contains filtered or unexported fields
}

TmBlock represents a row from 'public.tm_blocks'.

func TmBlockByChainIDHeight

func TmBlockByChainIDHeight(db XODB, chainID sql.NullString, height sql.NullInt64) (*TmBlock, error)

TmBlockByChainIDHeight retrieves a row from 'public.tm_blocks' as a TmBlock.

Generated from index 'tm_blocks_chain_id_height_idx'.

func TmBlockByID

func TmBlockByID(db XODB, id int64) (*TmBlock, error)

TmBlockByID retrieves a row from 'public.tm_blocks' as a TmBlock.

Generated from index 'tm_blocks_pkey'.

func TmBlockFilter

func TmBlockFilter(db XODB, filter, sort string, offset, limit int64) ([]*TmBlock, error)

TmBlocksQuery returns offset-limit rows from 'public.tm_blocks' filte by filter, ordered by "id" in descending order.

func TmBlocksByChainID

func TmBlocksByChainID(db XODB, chainID sql.NullString) ([]*TmBlock, error)

TmBlocksByChainID retrieves a row from 'public.tm_blocks' as a TmBlock.

Generated from index 'tm_blocks_chain_id_idx'.

func (*TmBlock) Delete

func (tb *TmBlock) Delete(db XODB) error

Delete deletes the TmBlock from the database.

func (*TmBlock) Deleted

func (tb *TmBlock) Deleted() bool

Deleted provides information if the TmBlock has been deleted from the database.

func (*TmBlock) Exists

func (tb *TmBlock) Exists() bool

Exists determines if the TmBlock exists in the database.

func (*TmBlock) Insert

func (tb *TmBlock) Insert(db XODB) error

Insert inserts the TmBlock to the database.

func (*TmBlock) Save

func (tb *TmBlock) Save(db XODB) error

Save saves the TmBlock to the database.

func (*TmBlock) Update

func (tb *TmBlock) Update(db XODB) error

Update updates the TmBlock in the database.

func (*TmBlock) Upsert

func (tb *TmBlock) Upsert(db XODB) error

Upsert performs an upsert for TmBlock.

NOTE: PostgreSQL 9.5+ only

type TmBlockChain

type TmBlockChain struct {
	ID        int64          `json:"id"`         // id
	ChainID   sql.NullString `json:"chain_id"`   // chain_id
	Height    sql.NullInt64  `json:"height"`     // height
	NumTxs    sql.NullInt64  `json:"num_txs"`    // num_txs
	Data      sql.NullString `json:"data"`       // data
	Time      pq.NullTime    `json:"time"`       // time
	CreatedAt pq.NullTime    `json:"created_at"` // created_at
	// contains filtered or unexported fields
}

TmBlockChain represents a row from 'public.tm_block_chain'.

func TmBlockChainByChainIDHeight

func TmBlockChainByChainIDHeight(db XODB, chainID sql.NullString, height sql.NullInt64) (*TmBlockChain, error)

TmBlockChainByChainIDHeight retrieves a row from 'public.tm_block_chain' as a TmBlockChain.

Generated from index 'tm_block_chain_chain_id_height_idx'.

func TmBlockChainByID

func TmBlockChainByID(db XODB, id int64) (*TmBlockChain, error)

TmBlockChainByID retrieves a row from 'public.tm_block_chain' as a TmBlockChain.

Generated from index 'tm_block_chain_pkey'.

func TmBlockChainFilter

func TmBlockChainFilter(db XODB, filter, sort string, offset, limit int64) ([]*TmBlockChain, error)

TmBlockChainsQuery returns offset-limit rows from 'public.tm_block_chain' filte by filter, ordered by "id" in descending order.

func TmBlockChainsByChainID

func TmBlockChainsByChainID(db XODB, chainID sql.NullString) ([]*TmBlockChain, error)

TmBlockChainsByChainID retrieves a row from 'public.tm_block_chain' as a TmBlockChain.

Generated from index 'tm_block_chain_chain_id_idx'.

func (*TmBlockChain) Delete

func (tbc *TmBlockChain) Delete(db XODB) error

Delete deletes the TmBlockChain from the database.

func (*TmBlockChain) Deleted

func (tbc *TmBlockChain) Deleted() bool

Deleted provides information if the TmBlockChain has been deleted from the database.

func (*TmBlockChain) Exists

func (tbc *TmBlockChain) Exists() bool

Exists determines if the TmBlockChain exists in the database.

func (*TmBlockChain) Insert

func (tbc *TmBlockChain) Insert(db XODB) error

Insert inserts the TmBlockChain to the database.

func (*TmBlockChain) Save

func (tbc *TmBlockChain) Save(db XODB) error

Save saves the TmBlockChain to the database.

func (*TmBlockChain) Update

func (tbc *TmBlockChain) Update(db XODB) error

Update updates the TmBlockChain in the database.

func (*TmBlockChain) Upsert

func (tbc *TmBlockChain) Upsert(db XODB) error

Upsert performs an upsert for TmBlockChain.

NOTE: PostgreSQL 9.5+ only

type Tx

type Tx struct {
	ID          int64          `json:"id"`           // id
	ChainID     sql.NullString `json:"chain_id"`     // chain_id
	Height      sql.NullInt64  `json:"height"`       // height
	TxType      sql.NullString `json:"tx_type"`      // tx_type
	Index       sql.NullInt64  `json:"index"`        // index
	Maxgas      sql.NullInt64  `json:"maxgas"`       // maxgas
	QcpFrom     sql.NullString `json:"qcp_from"`     // qcp_from
	QcpTo       sql.NullString `json:"qcp_to"`       // qcp_to
	QcpSequence sql.NullInt64  `json:"qcp_sequence"` // qcp_sequence
	QcpTxindex  sql.NullInt64  `json:"qcp_txindex"`  // qcp_txindex
	QcpIsresult sql.NullBool   `json:"qcp_isresult"` // qcp_isresult
	OriginTx    sql.NullString `json:"origin_tx"`    // origin_tx
	JSONTx      sql.NullString `json:"json_tx"`      // json_tx
	Time        pq.NullTime    `json:"time"`         // time
	CreatedAt   pq.NullTime    `json:"created_at"`   // created_at
	// contains filtered or unexported fields
}

Tx represents a row from 'public.txs'.

func TxByChainIDHeightIndex

func TxByChainIDHeightIndex(db XODB, chainID sql.NullString, height sql.NullInt64, index sql.NullInt64) (*Tx, error)

TxByChainIDHeightIndex retrieves a row from 'public.txs' as a Tx.

Generated from index 'txs_chain_id_height_index_idx'.

func TxByID

func TxByID(db XODB, id int64) (*Tx, error)

TxByID retrieves a row from 'public.txs' as a Tx.

Generated from index 'txs_pkey'.

func TxFilter

func TxFilter(db XODB, filter, sort string, offset, limit int64) ([]*Tx, error)

TxsQuery returns offset-limit rows from 'public.txs' filte by filter, ordered by "id" in descending order.

func TxesByChainID

func TxesByChainID(db XODB, chainID sql.NullString) ([]*Tx, error)

TxesByChainID retrieves a row from 'public.txs' as a Tx.

Generated from index 'txs_chain_id_idx'.

func TxesByChainIDHeight

func TxesByChainIDHeight(db XODB, chainID sql.NullString, height sql.NullInt64) ([]*Tx, error)

TxesByChainIDHeight retrieves a row from 'public.txs' as a Tx.

Generated from index 'txs_chain_id_height_idx'.

func (*Tx) Delete

func (t *Tx) Delete(db XODB) error

Delete deletes the Tx from the database.

func (*Tx) Deleted

func (t *Tx) Deleted() bool

Deleted provides information if the Tx has been deleted from the database.

func (*Tx) Exists

func (t *Tx) Exists() bool

Exists determines if the Tx exists in the database.

func (*Tx) Insert

func (t *Tx) Insert(db XODB) error

Insert inserts the Tx to the database.

func (*Tx) Save

func (t *Tx) Save(db XODB) error

Save saves the Tx to the database.

func (*Tx) Update

func (t *Tx) Update(db XODB) error

Update updates the Tx in the database.

func (*Tx) Upsert

func (t *Tx) Upsert(db XODB) error

Upsert performs an upsert for Tx.

NOTE: PostgreSQL 9.5+ only

type Validator

type Validator struct {
	ID               int64          `json:"id"`                 // id
	ChainID          sql.NullString `json:"chain_id"`           // chain_id
	Address          sql.NullString `json:"address"`            // address
	PubKeyType       sql.NullString `json:"pub_key_type"`       // pub_key_type
	PubKeyValue      sql.NullString `json:"pub_key_value"`      // pub_key_value
	VotingPower      sql.NullInt64  `json:"voting_power"`       // voting_power
	Accum            sql.NullInt64  `json:"accum"`              // accum
	FirstBlockHeight sql.NullInt64  `json:"first_block_height"` // first_block_height
	FirstBlockTime   pq.NullTime    `json:"first_block_time"`   // first_block_time
	CreatedAt        pq.NullTime    `json:"created_at"`         // created_at
	// contains filtered or unexported fields
}

Validator represents a row from 'public.validators'.

func ValidatorByAddress

func ValidatorByAddress(db XODB, address sql.NullString) (*Validator, error)

ValidatorByAddress retrieves a row from 'public.validators' as a Validator.

Generated from index 'validators_address_idx'.

func ValidatorByID

func ValidatorByID(db XODB, id int64) (*Validator, error)

ValidatorByID retrieves a row from 'public.validators' as a Validator.

Generated from index 'validators_pkey'.

func ValidatorFilter

func ValidatorFilter(db XODB, filter, sort string, offset, limit int64) ([]*Validator, error)

ValidatorsQuery returns offset-limit rows from 'public.validators' filte by filter, ordered by "id" in descending order.

func ValidatorsByChainID

func ValidatorsByChainID(db XODB, chainID sql.NullString) ([]*Validator, error)

ValidatorsByChainID retrieves a row from 'public.validators' as a Validator.

Generated from index 'validators_chain_id_idx'.

func (*Validator) Delete

func (v *Validator) Delete(db XODB) error

Delete deletes the Validator from the database.

func (*Validator) Deleted

func (v *Validator) Deleted() bool

Deleted provides information if the Validator has been deleted from the database.

func (*Validator) Exists

func (v *Validator) Exists() bool

Exists determines if the Validator exists in the database.

func (*Validator) Insert

func (v *Validator) Insert(db XODB) error

Insert inserts the Validator to the database.

func (*Validator) Save

func (v *Validator) Save(db XODB) error

Save saves the Validator to the database.

func (*Validator) Update

func (v *Validator) Update(db XODB) error

Update updates the Validator in the database.

func (*Validator) Upsert

func (v *Validator) Upsert(db XODB) error

Upsert performs an upsert for Validator.

NOTE: PostgreSQL 9.5+ only

type VerifyCode

type VerifyCode struct {
	ID        int64          `json:"id"`         // id
	Email     sql.NullString `json:"email"`      // email
	Code      sql.NullString `json:"code"`       // code
	CreatedAt pq.NullTime    `json:"created_at"` // created_at
	// contains filtered or unexported fields
}

VerifyCode represents a row from 'public.verify_code'.

func VerifyCodeByEmail

func VerifyCodeByEmail(db XODB, email sql.NullString) (*VerifyCode, error)

VerifyCodeByEmail retrieves a row from 'public.verify_code' as a VerifyCode.

Generated from index 'verify_email_idx'.

func VerifyCodeByID

func VerifyCodeByID(db XODB, id int64) (*VerifyCode, error)

VerifyCodeByID retrieves a row from 'public.verify_code' as a VerifyCode.

Generated from index 'verify_code_pkey'.

func VerifyCodeFilter

func VerifyCodeFilter(db XODB, filter, sort string, offset, limit int64) ([]*VerifyCode, error)

VerifyCodesQuery returns offset-limit rows from 'public.verify_code' filte by filter, ordered by "id" in descending order.

func (*VerifyCode) Delete

func (vc *VerifyCode) Delete(db XODB) error

Delete deletes the VerifyCode from the database.

func (*VerifyCode) Deleted

func (vc *VerifyCode) Deleted() bool

Deleted provides information if the VerifyCode has been deleted from the database.

func (*VerifyCode) Exists

func (vc *VerifyCode) Exists() bool

Exists determines if the VerifyCode exists in the database.

func (*VerifyCode) Insert

func (vc *VerifyCode) Insert(db XODB) error

Insert inserts the VerifyCode to the database.

func (*VerifyCode) Save

func (vc *VerifyCode) Save(db XODB) error

Save saves the VerifyCode to the database.

func (*VerifyCode) Update

func (vc *VerifyCode) Update(db XODB) error

Update updates the VerifyCode in the database.

func (*VerifyCode) Upsert

func (vc *VerifyCode) Upsert(db XODB) error

Upsert performs an upsert for VerifyCode.

NOTE: PostgreSQL 9.5+ only

type XODB

type XODB interface {
	Exec(string, ...interface{}) (sql.Result, error)
	Query(string, ...interface{}) (*sql.Rows, error)
	QueryRow(string, ...interface{}) *sql.Row
}

XODB is the common interface for database operations that can be used with types from schema 'public'.

This should work with database/sql.DB and database/sql.Tx.

Jump to

Keyboard shortcuts

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