database

package
v0.0.0-...-cec0596 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

本包是作为对blot数据库封装的一个存在

本包是作为对blot数据库封装的一个存在

Index

Constants

This section is empty.

Variables

View Source
var ListenPort string

Functions

func IsBucketExist

func IsBucketExist(bd *BlockchainDB, bt BucketType) bool

判断仓库是否存在

func IsDbExist

func IsDbExist(nodeID string) bool

判断数据库是否存在

Types

type BlockchainDB

type BlockchainDB struct {
	ListenPort string
}

func New

func New() *BlockchainDB

func (*BlockchainDB) Delete

func (bd *BlockchainDB) Delete(k []byte, bt BucketType) bool

删除数据

func (*BlockchainDB) DeleteBucket

func (bd *BlockchainDB) DeleteBucket(bt BucketType) bool

删除仓库

func (*BlockchainDB) Put

func (bd *BlockchainDB) Put(k, v []byte, bt BucketType)

存入数据

func (*BlockchainDB) View

func (bd *BlockchainDB) View(k []byte, bt BucketType) []byte

查看数据

type BucketType

type BucketType string

仓库类型

const (
	BlockBucket BucketType = "blocks"
	AddrBucket  BucketType = "address"
	UTXOBucket  BucketType = "utxo"
	AgentBucket BucketType = "agent"
)

Jump to

Keyboard shortcuts

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