database

package
v0.0.0-...-063ef29 Latest Latest
Warning

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

Go to latest
Published: May 24, 2014 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Interface to the LevelDB database.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSub

type DataSub struct {
	flow.Gadget
	In  flow.Input
	Out flow.Output
}

Generate database change messages based on one or more subscription prefixes.

func (*DataSub) Run

func (g *DataSub) Run()

Subscribe to database changes to pick up and publish all the matching ones.

type LevelDB

type LevelDB struct {
	flow.Gadget
	In       flow.Input
	Out      flow.Output
	DBAPI    api.IDBReadWriteAPI `flowapi:"DBReadWriteAPI"`
	Settings *LevelDBSettingsAPI `flowapi:"SettingsAPI,new"`
}

LevelDB is a multi-purpose gadget to get, put, and scan keys in a database. Acts on tags received on the input port. Registers itself as "LevelDB".

func (*LevelDB) Run

func (w *LevelDB) Run()

Open the database and start listening to incoming get/put/keys requests.

type LevelDBAPI

type LevelDBAPI struct{} //because we need more than *db

func (*LevelDBAPI) Get

func (d *LevelDBAPI) Get(key string) (interface{}, error)

func (*LevelDBAPI) Keys

func (d *LevelDBAPI) Keys(prefix string) ([]string, error)

func (*LevelDBAPI) Put

func (d *LevelDBAPI) Put(key string, value interface{}) error

type LevelDBSettingsAPI

type LevelDBSettingsAPI struct {
	// contains filtered or unexported fields
}

FlowAPI SettingsAPI

func (*LevelDBSettingsAPI) Get

func (d *LevelDBSettingsAPI) Get(key string) (interface{}, error)

func (*LevelDBSettingsAPI) InitAPI

func (d *LevelDBSettingsAPI) InitAPI(a ...interface{})

func (*LevelDBSettingsAPI) Keys

func (d *LevelDBSettingsAPI) Keys(prefix string) ([]string, error)

func (*LevelDBSettingsAPI) Put

func (d *LevelDBSettingsAPI) Put(key string, value interface{}) error

Jump to

Keyboard shortcuts

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