db

package
v0.0.0-...-725ffc3 Latest Latest
Warning

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

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

Documentation

Overview

Package db is the endive subpackage that implements the Database interface.

The current implementation saves all Book information as a simple JSON file.

That makes it: - easy to index with bleve - easy to check and, if desperate, edit for a human being - easy to version with git

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONDB

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

JSONDB implements endive.Database with a JSON backend.

func (*JSONDB) Backup

func (db *JSONDB) Backup(path string) error

Backup JSON database by versioning it in a git repository.

func (*JSONDB) Equals

func (db *JSONDB) Equals(o endive.Database) bool

Equals to another Database

func (*JSONDB) Load

func (db *JSONDB) Load(bks endive.Collection) error

Load database into a Collection

func (*JSONDB) Path

func (db *JSONDB) Path() string

Path of database

func (*JSONDB) Save

func (db *JSONDB) Save(bks endive.Collection) (hasSaved bool, err error)

Save database as a JSON file

func (*JSONDB) SetPath

func (db *JSONDB) SetPath(path string)

SetPath for database

Jump to

Keyboard shortcuts

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