fstack

package module
v0.0.0-...-1cb680b Latest Latest
Warning

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

Go to latest
Published: May 4, 2016 License: GPL-3.0 Imports: 8 Imported by: 0

README

file-stack-db

Key with historical values database based on file-stack

It provides:

  • Dynamic allocation or reusing of file stacks
  • Auto closing unused stacks that reduce file handlers usage (especially for low-cost platforms)

Tools

Stack DB with RPC/RPC-HTTP/HTTP API:

go get -u github.com/reddec/file-stack-db/cmd/...

Use package manager for Debian/Centos by packager.io

Dev documentation

See godoc

HTTP API

See swagger UI or swagger.yaml

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	io.Closer
	// contains filtered or unexported fields
}

Database of file stacks

func NewDatabase

func NewDatabase(rootDir string, keepAlive time.Duration) (*Database, error)

NewDatabase - create new database and start stack collector (closes outaded stack)

func (*Database) Clean

func (db *Database) Clean() error

Clean and remove all stacks in database from filesystem

func (*Database) Close

func (db *Database) Close() error

Close all allocated stacks and stops stack collector. Never use database again after close

func (*Database) Find

func (db *Database) Find(key string, create bool) (*fstack.Stack, error)

Find a stack or create new

func (*Database) Get

func (db *Database) Get(key string) *fstack.Stack

Get stack or create new. Panics on errors

func (*Database) Names

func (db *Database) Names() []string

Names of known stacks in the database

func (*Database) Remove

func (db *Database) Remove(key string) error

Remove stack from database and file system

func (*Database) Scan

func (db *Database) Scan() error

Scan root dir for allocated stacks Warning! All files in root dir will be interpreted as stacks

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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