golang-scribble: github.com/nanobox-io/golang-scribble Index | Files | Directories

package scribble

import "github.com/nanobox-io/golang-scribble"

Package scribble is a tiny JSON database


Package Files



const Version = "1.0.4"

Version is the current version of the project

type Driver Uses

type Driver struct {
    // contains filtered or unexported fields

Driver is what is used to interact with the scribble database. It runs transactions, and provides log output

func New Uses

func New(dir string, options *Options) (*Driver, error)

New creates a new scribble database at the desired directory location, and returns a *Driver to then use for interacting with the database

func (*Driver) Delete Uses

func (d *Driver) Delete(collection, resource string) error

Delete locks that database and then attempts to remove the collection/resource specified by [path]

func (*Driver) Read Uses

func (d *Driver) Read(collection, resource string, v interface{}) error

Read a record from the database

func (*Driver) ReadAll Uses

func (d *Driver) ReadAll(collection string) ([]string, error)

ReadAll records from a collection; this is returned as a slice of strings because there is no way of knowing what type the record is.

func (*Driver) Write Uses

func (d *Driver) Write(collection, resource string, v interface{}) error

Write locks the database and attempts to write the record to the database under the [collection] specified with the [resource] name given

type Logger Uses

type Logger interface {
    Fatal(string, ...interface{})
    Error(string, ...interface{})
    Warn(string, ...interface{})
    Info(string, ...interface{})
    Debug(string, ...interface{})
    Trace(string, ...interface{})

Logger is a generic logger interface

type Options Uses

type Options struct {
    Logger // the logger scribble will use (configurable)

Options uses for specification of working golang-scribble



Package scribble imports 7 packages (graph) and is imported by 37 packages. Updated 2020-02-09. Refresh now. Tools for package owners.