Documentation ¶
Index ¶
- Constants
- type Cassandra
- func (c *Cassandra) Connect() error
- func (c *Cassandra) GetBlockInfoByPayload(searchExpression string) ([]Tx, error)
- func (c *Cassandra) GetByBlocknum(blocknum uint64) ([]Tx, error)
- func (c *Cassandra) GetByTxId(txID string) ([]Tx, error)
- func (c *Cassandra) GetLastEntry() (Tx, error)
- func (c *Cassandra) Insert(tx Tx) error
- func (c *Cassandra) QueryAll() ([]Tx, error)
- func (c *Cassandra) QueryBlockByHash(hash string) ([]Tx, error)
- type DBmongo
- func (db *DBmongo) Connect() error
- func (db *DBmongo) GetBlockInfoByPayload(payload string) ([]Tx, error)
- func (db *DBmongo) GetByBlocknum(blocknum uint64) ([]Tx, error)
- func (db *DBmongo) GetByTxId(txID string) ([]Tx, error)
- func (db *DBmongo) GetLastEntry() (Tx, error)
- func (db *DBmongo) Insert(tx Tx) error
- func (db *DBmongo) QueryAll() ([]Tx, error)
- func (db *DBmongo) QueryBlockByHash(hash string) ([]Tx, error)
- type Entry
- type Manager
- type RW
- type Tx
Constants ¶
View Source
const ( CHANNEL_ID = "ChannelId" TXID = "Txid" HASH = "Hash" PREVIOUS_HASH = "PreviousHash" BLOCKNUM = "Blocknum" PAYLOAD = "Payload" VALIDATION_CODE = "ValidationCode" TIME = "Time" PAYLOADKEYS = "Payloadkeys" )
View Source
const ( NOT_FOUND_ERR = "not found" ERR_NO_DOCUMENTS = "mongo: no documents in result" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cassandra ¶
type Cassandra struct { Host string User string Password string Keyspace string Columnfamily string Session *gocql.Session }
func NewCassandraClient ¶
func (*Cassandra) GetBlockInfoByPayload ¶
func (*Cassandra) GetLastEntry ¶
type DBmongo ¶
type DBmongo struct { Host string Port int User string Password string DBname string Collection string Instance *mongo.Client }
func CreateDBConfMongo ¶
func (*DBmongo) GetBlockInfoByPayload ¶
func (*DBmongo) GetLastEntry ¶
type Tx ¶
type Tx struct { ChannelId string `json:"channelid" bson:"ChannelId"` Txid string `json:"txid" bson:"Txid"` Hash string `json:"hash" bson:"Hash"` PreviousHash string `json:"previoushash" bson:"PreviousHash"` Blocknum uint64 `json:"blocknum" bson:"Blocknum"` Payload string `json:"payload" bson:"Payload"` ValidationCode int32 `json:"validationcode" bson:"ValidationCode"` Time int64 `json:"time" bson:"Time"` }
Click to show internal directories.
Click to hide internal directories.