Skip to content
Manipulate is the library to store and retrieve Elemental based model in various backend
Go Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
internal fix: typo Jun 10, 2019
maniphttp fixed: seed rng (#103) Sep 10, 2019
manipmemory
manipmongo new/manipmongo: added a crude way to perform mongo explain Sep 13, 2019
maniptest fix: typo Jun 10, 2019
manipvortex Fix crash in vortex subscriber when there is no filter (#97) Aug 10, 2019
.gitignore New: Enable code coverage reports (#62) Nov 8, 2018
Gopkg.toml chore: move to github.com/gofrs/uuid Oct 30, 2018
LICENSE new: licensing May 1, 2019
Makefile Update: Set GO111MODULE to off (#102) Sep 13, 2019
README.md fixed: update readme May 1, 2019
context.go new: support for auto retry (#85) May 31, 2019
context_test.go fix: typo Jun 10, 2019
doc.go new: licensing May 1, 2019
errors.go new: licensing May 1, 2019
errors_test.go new: licensing May 1, 2019
filter.go new: move Filtering out of elemental (#78) May 2, 2019
filter_test.go
go.mod
go.sum
iter.go new: added manipulate.IterUntilFunc Jun 6, 2019
iter_test.go new: added manipulate.IterUntilFunc Jun 6, 2019
manipulate.go
options.go
options_test.go fix: typo Jun 10, 2019
retry.go new: support for auto retry (#85) May 31, 2019
retry_test.go
transaction.go new: licensing May 1, 2019
transaction_test.go new: licensing May 1, 2019

README.md

Manipulate

codecov

README IS A WORK IN PROGRESS AS WE ARE WRITTING MORE DOCUMENTATION ABOUT THIS PACKAGE.

Package manipulate provides everything needed to perform CRUD operations on an elemental based data model.

The main interface is Manipulator. This interface provides various methods for creation, modification, retrieval and so on.

A Manipulator works with elemental.Identifiable.

The storage engine used by a Manipulator is abstracted. By default manipulate provides implementations for Mongo, ReST HTTP, Websocket and a Memory backed datastore. You can of course implement Your own storage implementation.

Each method of a Manipulator is taking a manipulate.Context as argument. The context is used to pass additional informations like a Filter, or some Parameters.

Example for creating an object

// Create a User from a generated Elemental model.
user := models.NewUser() // always use the initializer to get various default value correctly set.
user.FullName := "Antoine Mercadal"
user.Login := "primalmotion"

// Create Mongo Manipulator.
m := manipmongo.New("127.0.0.1", "test")

// Then create the User.
m.Create(nil, user)

Example for retreving an object

// Create a Context with a filter.
ctx := manipulate.NewContextWithFilter(manipulate.NewFilterComposer().
    WithKey("login").Equals("primalmotion").
    Done(),
)

// Retrieve the users matching the filter.
var users models.UserLists
m.RetrieveMany(ctx, &users)
You can’t perform that action at this time.