Documentation ¶
Overview ¶
Copyright (C) 2018 go-cloudcard authors
This file is part of the go-cloudcard library.
the go-cloudcard library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-cloudcard library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-cloudcard library. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018 go-cloudcard authors ¶
This file is part of the go-cloudcard library.
the go-cloudcard library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-cloudcard library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-cloudcard library. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018 go-cloudcard authors ¶
This file is part of the go-cloudcard library.
the go-cloudcard library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-cloudcard library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-cloudcard library. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018 go-cloudcard authors ¶
This file is part of the go-cloudcard library.
the go-cloudcard library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-cloudcard library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-cloudcard library. If not, see <http://www.gnu.org/licenses/>.
Copyright (C) 2018 go-cloudcard authors ¶
This file is part of the go-cloudcard library.
the go-cloudcard library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
the go-cloudcard library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with the go-cloudcard library. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- Variables
- func NewcloudcardDB(filename string) (*cloudcardDB, error)
- func SetDbConfig(conf *config.Config, dbConfig *DbConfig)
- type BadgerDB
- func (db *BadgerDB) Close() error
- func (db *BadgerDB) Delete(key []byte) error
- func (db *BadgerDB) DisableBatch()
- func (db *BadgerDB) EnableBatch()
- func (db *BadgerDB) Flush() error
- func (db *BadgerDB) Get(key []byte) ([]byte, error)
- func (db *BadgerDB) Has(key []byte) (bool, error)
- func (db *BadgerDB) Put(key, value []byte) error
- func (db *BadgerDB) ValueSize() int
- type Batcher
- type Compacter
- type DbConfig
- type Iteratee
- type Iterator
- type LevelDB
- func (db *LevelDB) Close() error
- func (db *LevelDB) Compact(start []byte, limit []byte) error
- func (db *LevelDB) Delete(key []byte) error
- func (db *LevelDB) DisableBatch()
- func (db *LevelDB) EnableBatch()
- func (db *LevelDB) Flush() error
- func (db *LevelDB) Get(key []byte) ([]byte, error)
- func (db *LevelDB) Has(key []byte) (bool, error)
- func (db *LevelDB) NewIterator() Iterator
- func (db *LevelDB) NewIteratorWithPrefix(prefix []byte) Iterator
- func (db *LevelDB) Put(key, value []byte) error
- func (db *LevelDB) ValueSize() int
- type MemoryBatch
- type MemoryDB
- func (db *MemoryDB) Close() error
- func (db *MemoryDB) Del(key []byte) error
- func (db *MemoryDB) Delete(key []byte) error
- func (db *MemoryDB) DisableBatch()
- func (db *MemoryDB) EnableBatch()
- func (db *MemoryDB) Flush() error
- func (db *MemoryDB) Get(key []byte) ([]byte, error)
- func (db *MemoryDB) Has(key []byte) (bool, error)
- func (db *MemoryDB) Put(key []byte, value []byte) error
- func (db *MemoryDB) ValueSize() int
- type Reader
- type Stater
- type Storage
- type Writer
Constants ¶
const ( TypeLevelDB = "levelDB" TypeBadgerDB = "badgerDB" )
Variables ¶
var ( ErrBucketNotExist = errors.New("bucket does not exist") ErrKeyNotExist = errors.New("key does not exist") )
var (
ErrKeyNotFound = errors.New("not found")
)
Functions ¶
func NewcloudcardDB ¶
func SetDbConfig ¶
Types ¶
type BadgerDB ¶
type BadgerDB struct {
// contains filtered or unexported fields
}
func NewBadgerDB ¶
func (*BadgerDB) DisableBatch ¶
func (db *BadgerDB) DisableBatch()
func (*BadgerDB) EnableBatch ¶
func (db *BadgerDB) EnableBatch()
type DbConfig ¶
type DbConfig struct { DbType string `yaml:"db_type"` EnableBatch bool `yaml:"enable_batch"` DbDir string `yaml:"db_dir"` }
func GetDbConfig ¶
func NewDefaultDbConfig ¶
func NewDefaultDbConfig() *DbConfig
type LevelDB ¶
type LevelDB struct {
// contains filtered or unexported fields
}
func (*LevelDB) DisableBatch ¶
func (db *LevelDB) DisableBatch()
func (*LevelDB) EnableBatch ¶
func (db *LevelDB) EnableBatch()
func (*LevelDB) NewIterator ¶
func (*LevelDB) NewIteratorWithPrefix ¶
type MemoryBatch ¶
type MemoryBatch struct {
// contains filtered or unexported fields
}
MemoryBatch do batch task in memory storage
type MemoryDB ¶
type MemoryDB struct {
// contains filtered or unexported fields
}
MemoryDB the nodes in trie.
func (*MemoryDB) DisableBatch ¶
func (db *MemoryDB) DisableBatch()
DisableBatch disable batch write.