Documentation ¶
Index ¶
- Variables
- func Build(w io.Writer, data []Pair) error
- func VerifyChecksum(expected uint32, data []byte) error
- type ChecksumError
- type Pair
- type ReadAtCloser
- type SSTable
- func (t *SSTable) All() <-chan Pair
- func (t *SSTable) AllKeys() <-chan string
- func (t *SSTable) At(idx int) (Pair, error)
- func (t *SSTable) Close() error
- func (t *SSTable) Find(key string) int
- func (t *SSTable) Get(key string) ([]byte, error)
- func (t *SSTable) In(i, j int) <-chan Pair
- func (t *SSTable) InRange(lo, hi string) <-chan Pair
- func (t *SSTable) Key(idx int) string
- func (t *SSTable) KeysIn(i, j int) <-chan string
- func (t *SSTable) KeysInRange(lo, hi string) <-chan string
- func (t *SSTable) Len() int
- func (t *SSTable) Range(lo, hi string) (int, int)
- func (t *SSTable) Value(idx int) ([]byte, error)
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTooManyRecords = errors.New("go-sstable: too many records") ErrTooMuchData = errors.New("go-sstable: too much data (max file size 4 GiB)") ErrKeyTooLong = errors.New("go-sstable: key too long (max key length 255 bytes)") ErrValueTooLong = errors.New("go-sstable: value too long (max value length 16 MiB)") ErrBadFormat = errors.New("go-sstable: invalid file format") ErrKeyNotFound = errors.New("go-sstable: key not found") )
Functions ¶
func VerifyChecksum ¶
Example (Fail) ¶
err := VerifyChecksum(0, []byte("abc")) fmt.Printf("%#v\n", err) fmt.Println(err)
Output: sstable.ChecksumError{Expected:0x0, Actual:0x21f1576e} go-sstable: invalid checksum: expected 0x00000000, got 0x21f1576e
Example (Pass) ¶
err := VerifyChecksum(0x21f1576e, []byte("abc")) fmt.Printf("%#v\n", err) fmt.Println(err)
Output: <nil> <nil>
Types ¶
type ChecksumError ¶
func (ChecksumError) Error ¶
func (err ChecksumError) Error() string
type SSTable ¶
type SSTable struct {
// contains filtered or unexported fields
}
func New ¶
func New(f ReadAtCloser) (*SSTable, error)
func (*SSTable) KeysInRange ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.