db

package
v0.0.0-...-88ff46c Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2018 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Engine *xorm.Engine
)

Functions

func IsInit

func IsInit() bool

func NewDB

func NewDB(addr, user, pass, port, dbname string) (err error)

Types

type Block

type Block struct {
	//Id                int    `xorm:"<-"`
	Hash              string `xorm:"hash"`
	Version           uint64 `xorm:"block_version"`
	Height            uint64 `xorm:"height"`
	PreviousBlockHash string `xorm:"previous_block_hash"`
	Timestamp         uint64 `xorm:"timestamp"`
	Nonce             uint64 `xorm:"nonce"`
	Bits              uint64 `xorm:"bits"`
	TxCount           int    `xorm:"tx_count"`
	TxIds             string `xorm:"tx_ids"`
}

func (*Block) TableName

func (b *Block) TableName() string

type DB

type DB struct {
	Address string
	Port    string
	User    string
	Pass    string
	DBName  string
}

func (*DB) Close

func (db *DB) Close() error

type Transactions

type Transactions struct {
	TxId           string `xorm:"tx_id"`
	BlockHash      string `xorm:"block_hash"`
	Amount         uint64 `xorm:"amount"`
	SerializedSize uint64 `xorm:"serialized_size"`
	TimeRange      uint64 `xorm:"timerange"`
}

func (*Transactions) TableName

func (tx *Transactions) TableName() string

type TxInputs

type TxInputs struct {
	//Id              uint    `xorm:"<-"`
	TxId            string `xorm:"tx_id" json:"-"`
	BlockHash       string `xorm:"block_hash" json:"-"`
	Address         string `xorm:"address" json:"address"`
	AssetId         string `xorm:"asset_id" json:"asset_id"`
	Amount          uint64 `xorm:"amount" json:"amount"`
	AssetDefinition string `xorm:"asset_definition" json:"-"`
	SpentOutputId   string `xorm:"spent_output_id" json:"spent_output_id"`
	Type            string `xorm:"type" json:"type"`
}

func (*TxInputs) TableName

func (t *TxInputs) TableName() string

type TxOutputs

type TxOutputs struct {
	//Id              int    `xorm:"<-"`
	TxId            string `xorm:"tx_id" json:"-"`
	BlockHash       string `xorm:"block_hash" json:"-"`
	Address         string `xorm:"address" json:"address"`
	AssetId         string `xorm:"asset_id" json:"asset_id"`
	Amount          uint64 `xorm:"amount" json:"amount"`
	AssetDefinition string `xorm:"asset_definition" json:"-"`
	OutputId        string `xorm:"output_id" json:"output_id"`
	Type            string `xorm:"type" json:"type"`
}

func (*TxOutputs) TableName

func (t *TxOutputs) TableName() string

Jump to

Keyboard shortcuts

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