stockpile

module
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: GPL-3.0

README

stockpile

** Current state: ALPHA **

Interface to different databases, meant to allow easy mocking through the stockpile/mock package.

Useful in two ways:

  1. Setup a persistance layer between data and database using the database interface
  2. Use the mock database to run unit tests to test only specific business code

TODO:

  • Support limit option

  • Support skip option

  • [/] Support sort option

    • Int sort
    • String sort
    • Time sort
  • Open(ctx context.Context) error

  • Close(ctx context.Context) error

  • Insert(collection string, object interface{}) error

  • InsertMany(collection string, slice interface{}) error

  • FindOne(collection string, object interface{}, filter *Filter, opts *Options) error

  • FindAll(collection string, object interface{}, filter *Filter, opts *Options) error

  • Update(collection string, object interface{}, filter *Filter) error

  • Upsert(collection string, object interface{}, filter *Filter) error

  • Delete(collection string, filter *Filter) error

  • Search(collection, search string, fields []string, object interface{}) error

filter matching will remove underscores in field names

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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