storage

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2016 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package storage implements banshee's persistence storage.

Structure

Storage handles 4 kinds of data: index, metric, state and admin, the directory structure is:

storage/
    |--index/               --- Metric index          LevelDB
    |--metric/              --- Metric data           LevelDB
    |--state-288x300/       --- Detection state       LevelDB
    |--admin                --- Rules/Users/Projects  SQLite3

The storage directory will be created if not exists.

For each child database, see its package's documentation for more.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB struct {
	// Child db
	Admin  *admindb.DB
	Index  *indexdb.DB
	Metric *metricdb.DB
	State  *statedb.DB
}

DB handles the storage on leveldb.

func Open

func Open(fileName string, options *Options) (*DB, error)

Open a DB by fileName and options.

func (*DB) Close

func (db *DB) Close() error

Close a DB.

type Options

type Options struct {
	// statedb
	NumGrid uint32
	GridLen uint32
}

Options is for db opening.

Directories

Path Synopsis
Package admindb handles the admin storage on SQLite3.
Package admindb handles the admin storage on SQLite3.
Package indexdb handles the storage for indexes.
Package indexdb handles the storage for indexes.
Package metricdb handles the storage for metrics.
Package metricdb handles the storage for metrics.
Package statedb handles the states storage on LevelDB.
Package statedb handles the states storage on LevelDB.

Jump to

Keyboard shortcuts

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