Documentation ¶
Index ¶
- Constants
- Variables
- type Cursor
- type DB
- func (db *DB) Close() error
- func (db *DB) Cursor() *Cursor
- func (db *DB) Delete(from int64, to int64)
- func (db *DB) Flush() error
- func (db *DB) Get(key int64) (*Point, error)
- func (db *DB) Path() string
- func (db *DB) Put(key int64, value map[string]float64) error
- func (db *DB) Query(from int64, to int64, level uint16, count int, reducer map[string]string) []*Point
- type Ops
- type Point
- type Time
- type Value
Constants ¶
View Source
const ( Version uint16 = 1 MetaSize uint64 = 512 MetaBaseSize uint64 = 3 RootBaseSize uint64 = 12 )
View Source
const ( LevelRoot = 0x0001 LevelYear = 0x0002 LevelMonth = 0x0004 LevelDay = 0x0008 LevelHour = 0x0010 LevelMinute = 0x0020 LevelSecond = 0x0040 LevelMSecond = 0x0080 LevelUSecond = 0x0100 LevelNSecond = 0x0200 LevelFlag = 0x0FFF LeafFlag = 0x3000 InteriorChunkFlag = 0x1000 LeafChunkFlag = 0x2000 )
View Source
const ChunkCrcSize int64 = 4
View Source
const ChunkLengthSize int64 = 4
View Source
const TimeFormat string = "2006-01-02 15:04:05"
Variables ¶
View Source
var ( // ErrDatabaseNotOpen is returned when a DB instance is accessed before it // is opened or after it is closed. ErrDatabaseNotOpen = errors.New("database not open") // ErrNotFound is returned when key is not exists. ErrNotFound = errors.New("key not found") // ErrInvalid is returned when both meta pages on a database are invalid. // This typically occurs when a file is not a database. ErrInvalid = errors.New("invalid database") // ErrVersionMismatch is returned when the data file was created with a different version. ErrVersionMismatch = errors.New("version mismatch") // ErrChecksum is returned when either meta page checksum does not match. ErrChecksum = errors.New("checksum error") // ErrTimeout is returned when a database cannot obtain an exclusive lock // on the data file after the timeout passed to Open(). ErrTimeout = errors.New("timeout") ErrChunkBadCrc = errors.New("chunk crc bad") ErrChunkDataLessThanSize = errors.New("chunk data less than size") )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.