ouch

package
v0.7.5 Latest Latest
Warning

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

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

README

Ouch driver for PouchDB

To run "gopherjs test -v" you must "npm install pouchdb" (which actually runs on top of levelDB). And "npm install pouchdb-find" for queries.

Documentation

Index

Constants

View Source
const Type = driverName

Variables

This section is empty.

Functions

func Create

func Create(addr string, opt graph.Options) (nosql.Database, error)

func Open

func Open(addr string, opt graph.Options) (nosql.Database, error)

Types

type DB

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

func (*DB) Close

func (db *DB) Close() error

func (*DB) Delete

func (db *DB) Delete(col string) nosql.Delete

func (*DB) EnsureIndex

func (db *DB) EnsureIndex(ctx context.Context, col string, primary nosql.Index, secondary []nosql.Index) error

func (*DB) FindByKey

func (db *DB) FindByKey(ctx context.Context, col string, key nosql.Key) (nosql.Document, error)

func (*DB) Insert

func (db *DB) Insert(ctx context.Context, col string, key nosql.Key, d nosql.Document) (nosql.Key, error)

func (*DB) Query

func (db *DB) Query(col string) nosql.Query

func (*DB) Update

func (db *DB) Update(col string, key nosql.Key) nosql.Update

type Delete

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

func (*Delete) Do

func (d *Delete) Do(ctx context.Context) error

func (*Delete) Keys

func (d *Delete) Keys(keys ...nosql.Key) nosql.Delete

func (*Delete) WithFields

func (d *Delete) WithFields(filters ...nosql.FieldFilter) nosql.Delete

type Iterator

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

func (*Iterator) Close

func (it *Iterator) Close() error

func (*Iterator) Doc

func (it *Iterator) Doc() nosql.Document

func (*Iterator) Err

func (it *Iterator) Err() error

func (*Iterator) Key

func (it *Iterator) Key() nosql.Key

func (*Iterator) Next

func (it *Iterator) Next(ctx context.Context) bool

type Query

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

func (*Query) Count

func (q *Query) Count(ctx context.Context) (int64, error)

func (*Query) Iterate

func (q *Query) Iterate() nosql.DocIterator

func (*Query) Limit

func (q *Query) Limit(n int) nosql.Query

func (*Query) One

func (q *Query) One(ctx context.Context) (nosql.Document, error)

func (*Query) WithFields

func (q *Query) WithFields(filters ...nosql.FieldFilter) nosql.Query

type Update

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

func (*Update) Do

func (u *Update) Do(ctx context.Context) error

func (*Update) Inc

func (u *Update) Inc(field string, dn int) nosql.Update

func (*Update) Upsert

func (u *Update) Upsert(d nosql.Document) nosql.Update

Jump to

Keyboard shortcuts

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