Documentation ¶
Index ¶
- Constants
- Variables
- type Collection
- func (collection *Collection) BestIndex(ctx context.Context, query Query) (*Index, error)
- func (collection *Collection) CreateIndex(ctx context.Context, fields ...string) (*Index, error)
- func (collection *Collection) Get(ctx context.Context, recordId []byte) (ipld.Node, error)
- func (collection *Collection) GetProof(recordId []byte) (*InclusionProof, error)
- func (collection *Collection) HasPrimaryKey() bool
- func (collection *Collection) IndexNDJSON(ctx context.Context, byteStream io.Reader) error
- func (collection *Collection) Indexes(ctx context.Context) ([]*Index, error)
- func (collection *Collection) Initialize() error
- func (collection *Collection) Insert(ctx context.Context, record ipld.Node) error
- func (collection *Collection) Iterate(ctx context.Context) (<-chan Record, error)
- func (collection *Collection) Search(ctx context.Context, query Query) (<-chan Record, error)
- type CompareCondition
- type Database
- func FromBlockStore(blockStore blockstore.Blockstore, rootCid cid.Cid) (*Database, error)
- func ImportFromFile(source string) (*Database, error)
- func Merge(ctx context.Context, db *Database, other *Database) (*Database, error)
- func NewDatabaseFromBlockStore(ctx context.Context, blockStore blockstore.Blockstore) (*Database, error)
- func NewMemoryDatabase() (*Database, error)
- func (db *Database) ApplyChanges(ctx context.Context) error
- func (db *Database) Collection(name string, primaryKey ...string) (*Collection, error)
- func (db *Database) ExportProof(ctx context.Context, prfCid cid.Cid, destination string) error
- func (db *Database) ExportToFile(ctx context.Context, destination string) error
- func (db *Database) GetBlockstore() *blockstore.Blockstore
- func (db *Database) GetDBMetaInfo() (*schema.DBMetaInfo, error)
- func (db *Database) RootCid() cid.Cid
- type InclusionProof
- type Index
- type Query
- type Record
Constants ¶
View Source
const ( GreaterThan op = "GreaterThan" LessThan op = "LessThan" )
View Source
const (
ChannelTimeOut = time.Second * 10
)
Variables ¶
View Source
var ( NULL_BYTE = []byte("\x00") FULL_BYTE = []byte("\xFF") DATA_PREFIX = []byte("\x00d") INDEX_PREFIX = []byte("\x00i") DB_METADATA_KEY = []byte("\xFF\x00") )
View Source
var ( INDEX_VERSION_1 = int64(1) CURRENT_DB_VERSION = INDEX_VERSION_1 )
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
func (*Collection) CreateIndex ¶
func (*Collection) GetProof ¶
func (collection *Collection) GetProof(recordId []byte) (*InclusionProof, error)
func (*Collection) HasPrimaryKey ¶
func (collection *Collection) HasPrimaryKey() bool
func (*Collection) IndexNDJSON ¶
func (*Collection) Indexes ¶
func (collection *Collection) Indexes(ctx context.Context) ([]*Index, error)
func (*Collection) Initialize ¶
func (collection *Collection) Initialize() error
type CompareCondition ¶
type CompareCondition struct {
// contains filtered or unexported fields
}
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func FromBlockStore ¶
func FromBlockStore(blockStore blockstore.Blockstore, rootCid cid.Cid) (*Database, error)
func ImportFromFile ¶
func Merge ¶
Merge two db in ProllyTree level, but the collection merging is not handling now.(i.e. maybe here exists the case that two collections has same name but with different primary keys)
func NewDatabaseFromBlockStore ¶
func NewDatabaseFromBlockStore(ctx context.Context, blockStore blockstore.Blockstore) (*Database, error)
func NewMemoryDatabase ¶
func (*Database) Collection ¶
func (db *Database) Collection(name string, primaryKey ...string) (*Collection, error)
func (*Database) ExportProof ¶
func (*Database) ExportToFile ¶
func (*Database) GetBlockstore ¶
func (db *Database) GetBlockstore() *blockstore.Blockstore
func (*Database) GetDBMetaInfo ¶
func (db *Database) GetDBMetaInfo() (*schema.DBMetaInfo, error)
type InclusionProof ¶
Click to show internal directories.
Click to hide internal directories.