leveldb

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2016 License: Apache-2.0 Imports: 8 Imported by: 9

Documentation

Overview

Package leveldb implements a graphstore.Service using a LevelDB backend database.

Index

Constants

This section is empty.

Variables

View Source
var DefaultOptions = &Options{
	CacheCapacity:   512 * 1024 * 1024,
	WriteBufferSize: 60 * 1024 * 1024,
}

DefaultOptions is the default Options struct passed to Open when not otherwise given one.

Functions

func Open

func Open(path string, opts *Options) (keyvalue.DB, error)

Open returns a keyvalue DB backed by a LevelDB database at the given filepath. If opts==nil, the DefaultOptions are used.

func OpenGraphStore

func OpenGraphStore(path string, opts *Options) (graphstore.Service, error)

OpenGraphStore returns a graphstore.Service backed by a LevelDB database at the given filepath. If opts==nil, the DefaultOptions are used.

func ValidDB

func ValidDB(path string) bool

ValidDB determines if the given path could be a LevelDB database.

Types

type Options

type Options struct {
	// CacheCapacity is the caching capacity (in bytes) used for the LevelDB.
	CacheCapacity int

	// CacheLargeReads determines whether to use the cache for large reads. This
	// is usually discouraged but may be useful when the entire LevelDB is known
	// to fit into the cache.
	CacheLargeReads bool

	// WriteBufferSize is the number of bytes the database will build up in memory
	// (backed by a disk log) before writing to the on-disk table.
	WriteBufferSize int

	// MustExist ensures that the given database exists before opening it.  If
	// false and the database does not exist, it will be created.
	MustExist bool
}

Options for customizing a LevelDB backend.

Jump to

Keyboard shortcuts

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