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 ¶
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.
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.
Click to show internal directories.
Click to hide internal directories.