Documentation
¶
Index ¶
- Constants
- type BigLogDB
- func (db *BigLogDB) Close()
- func (db *BigLogDB) GetFileNum() (uint32, error)
- func (db *BigLogDB) Read(key []byte, readlen uint32) ([]byte, error)
- func (db *BigLogDB) ReadBodyByPosition(ptrseek *LogFilePtrSeek, readlen uint32) ([]byte, error)
- func (db *BigLogDB) ReadHead(key []byte) ([]byte, *LogFilePtrSeek, error)
- func (db *BigLogDB) Save(key []byte, valuedata []byte) (*LogFilePtrSeek, error)
- func (db *BigLogDB) SetFileNum(newnum uint32) error
- type BigLogDBConfig
- type LogFilePtrSeek
Constants ¶
View Source
const (
LogFilePtrSeekSize = 4 + 4 + 4
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BigLogDB ¶
type BigLogDB struct {
// contains filtered or unexported fields
}
*
- big log db
func NewBigLogDBByLevelDB ¶
func NewBigLogDBByLevelDB(config *BigLogDBConfig, keySubfix string, ldb *leveldb.DB) (*BigLogDB, error)
create DataBase
func (*BigLogDB) GetFileNum ¶
func (*BigLogDB) ReadBodyByPosition ¶
func (db *BigLogDB) ReadBodyByPosition(ptrseek *LogFilePtrSeek, readlen uint32) ([]byte, error)
Read data by position
func (*BigLogDB) ReadHead ¶
func (db *BigLogDB) ReadHead(key []byte) ([]byte, *LogFilePtrSeek, error)
Read log Head
func (*BigLogDB) Save ¶
func (db *BigLogDB) Save(key []byte, valuedata []byte) (*LogFilePtrSeek, error)
save data
func (*BigLogDB) SetFileNum ¶
type BigLogDBConfig ¶
type BigLogDBConfig struct { //UseLevelDB bool DataDir string KeySize uint8 //KeyReverse bool LogHeadMaxSize int BlockPartFileMaxSize int64 }
*
- config
func NewBigLogDBConfig ¶
func NewBigLogDBConfig( DataDir string, keySize uint8, partFileSize int64, ) *BigLogDBConfig
type LogFilePtrSeek ¶
func (*LogFilePtrSeek) Copy ¶
func (lp *LogFilePtrSeek) Copy() *LogFilePtrSeek
func (*LogFilePtrSeek) Parse ¶
func (lp *LogFilePtrSeek) Parse(data []byte, seek uint32) (uint32, error)
func (*LogFilePtrSeek) Serialize ¶
func (lp *LogFilePtrSeek) Serialize() ([]byte, error)
assembling datas
func (*LogFilePtrSeek) Size ¶
func (lp *LogFilePtrSeek) Size() uint32
Click to show internal directories.
Click to hide internal directories.