database

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelDBProcessDB added in v0.14.0

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

LevelDBProcessDB is a database for storing processes definition.

func NewProcessDB added in v0.14.0

func NewProcessDB(path string) (*LevelDBProcessDB, error)

NewProcessDB returns the database which is located under given path.

func (*LevelDBProcessDB) All added in v0.14.0

func (d *LevelDBProcessDB) All() ([]*process.Process, error)

All returns every process in database.

func (*LevelDBProcessDB) Close added in v0.14.0

func (d *LevelDBProcessDB) Close() error

Close closes database.

func (*LevelDBProcessDB) Delete added in v0.14.0

func (d *LevelDBProcessDB) Delete(hash hash.Hash) error

Delete deletes process from database.

func (*LevelDBProcessDB) Get added in v0.14.0

func (d *LevelDBProcessDB) Get(hash hash.Hash) (*process.Process, error)

Get retrives process from database.

func (*LevelDBProcessDB) Save added in v0.14.0

func (d *LevelDBProcessDB) Save(s *process.Process) error

Save stores process in database. If there is an another process that uses the same sid, it'll be deleted.

type ProcessDB added in v0.14.0

type ProcessDB interface {
	// Save saves a process to database.
	Save(s *process.Process) error

	// Get gets a process from database by its unique hash.
	Get(hash hash.Hash) (*process.Process, error)

	// Delete deletes a process from database by its unique hash.
	Delete(hash hash.Hash) error

	// All returns all processes from database.
	All() ([]*process.Process, error)

	// Close closes underlying database connection.
	Close() error
}

ProcessDB describes the API of database package.

Jump to

Keyboard shortcuts

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