leveldb

package
v0.0.0-...-da200cc Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Copyright 2018 The Redix Authors. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.

leveldb is a db engine based on leveldb

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDB

type LevelDB struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

LevelDB - represents a leveldb db implementation

func OpenLevelDB

func OpenLevelDB(path string) (*LevelDB, error)

OpenLevelDB - Opens the specified path

func (*LevelDB) Close

func (ldb *LevelDB) Close()

Close ...

func (*LevelDB) Del

func (ldb *LevelDB) Del(keys []string) error

Del - removes key(s) from the store

func (*LevelDB) GC

func (ldb *LevelDB) GC() error

GC - runs the garbage collector

func (*LevelDB) Get

func (ldb *LevelDB) Get(k string) (string, error)

Get - fetches the value of the specified k

func (*LevelDB) Incr

func (ldb *LevelDB) Incr(k string, by int64) (int64, error)

Incr - increment the key by the specified value

func (*LevelDB) MGet

func (ldb *LevelDB) MGet(keys []string) (data []string)

MGet - fetch multiple values of the specified keys

func (*LevelDB) MSet

func (ldb *LevelDB) MSet(data map[string]string) error

MSet - sets multiple key-value pairs

func (*LevelDB) Scan

func (ldb *LevelDB) Scan(scannerOpt kvstore.ScannerOptions) error

Scan - iterate over the whole store using the handler function

func (*LevelDB) Set

func (ldb *LevelDB) Set(k, v string, ttl int) error

Set - sets a key with the specified value and optional ttl

func (*LevelDB) Size

func (ldb *LevelDB) Size() int64

Size - returns the size of the database in bytes

func (*LevelDB) TTL

func (ldb *LevelDB) TTL(key string) int64

TTL - returns the time to live of the specified key's value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL