dbfiles

package module
v0.0.0-...-5d11610 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2016 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

dbfiles

Database which stores data in plaintext csv.

Documentation

Index

Constants

View Source
const DefaultBaseDir = "data"

Variables

This section is empty.

Functions

This section is empty.

Types

type CSV

type CSV struct{}

func (CSV) Extention

func (driver CSV) Extention() string

func (CSV) Read

func (driver CSV) Read(reader io.Reader) ([][]string, error)

func (CSV) Write

func (driver CSV) Write(writer io.Writer, values []string) error

type DBFiles

type DBFiles struct {
	BaseDir string
	Driver
	Structure
	WriteQueue chan (record)
	// contains filtered or unexported fields
}

func New

func New() *DBFiles

func (*DBFiles) Destroy

func (db *DBFiles) Destroy() error

func (DBFiles) Get

func (db DBFiles) Get(key ...string) ([][]string, error)

func (DBFiles) Keys

func (db DBFiles) Keys() ([][]string, error)

func (*DBFiles) Put

func (db *DBFiles) Put(values []string, key ...string) error

type Driver

type Driver interface {
	Extention() string
	Write(io.Writer, []string) error
	Read(io.Reader) ([][]string, error)
}

type Flat

type Flat struct {
}

func NewFlat

func NewFlat() Flat

func (Flat) Create

func (str Flat) Create(basedir string) error

func (Flat) File

func (str Flat) File(basedir string, driver Driver, key []string) (io.ReadWriteCloser, error)

type Folders

type Folders struct {
}

func NewFolders

func NewFolders() Folders

func (Folders) Create

func (str Folders) Create(basedir string) error

func (Folders) File

func (str Folders) File(basedir string, driver Driver, key []string) (io.ReadWriteCloser, error)

type Structure

type Structure interface {
	Create(string) error
	File(string, Driver, []string) (io.ReadWriteCloser, error)
}

Jump to

Keyboard shortcuts

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