tests

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Schema = schema{
	EventsFixture: &schemaEventsFixture{
		Checks: storable.NewMap("checks.[map]", "bool"),
	},
	EventsSaveFixture: &schemaEventsSaveFixture{
		Checks: storable.NewMap("checks.[map]", "bool"),
	},
	MultiKeySortFixture: &schemaMultiKeySortFixture{
		Name:  storable.NewField("name", "string"),
		Start: storable.NewField("start", "time.Time"),
		End:   storable.NewField("end", "time.Time"),
	},
	QueryFixture: &schemaQueryFixture{
		Foo: storable.NewField("foo", "string"),
	},
	ResultSetFixture: &schemaResultSetFixture{
		Foo: storable.NewField("foo", "string"),
	},
	ResultSetInitFixture: &schemaResultSetInitFixture{
		Foo: storable.NewField("foo", "string"),
	},
	SchemaFixture: &schemaSchemaFixture{
		String: storable.NewField("string", "string"),
		Int:    storable.NewField("foo", "int"),
		Nested: &schemaSchemaFixtureNested{
			String: storable.NewField("nested.string", "string"),
			Int:    storable.NewField("nested.foo", "int"),
			Nested: &schemaSchemaFixtureNestedNested{},
			Inline: &schemaSchemaFixtureNestedInline{
				Inline: storable.NewField("nested.inline", "string"),
			},
			MapOfString:    storable.NewMap("nested.mapofstring.[map]", "string"),
			MapOfInterface: storable.NewMap("nested.mapofinterface.[map]", "interface{}"),
			MapOfSomeType: &schemaSchemaFixtureNestedMapOfSomeType{
				Foo: storable.NewMap("nested.mapofsometype.[map].foo", "string"),
			},
		},
		Inline: &schemaSchemaFixtureInline{
			Inline: storable.NewField("inline", "string"),
		},
		MapOfString:    storable.NewMap("mapofstring.[map]", "string"),
		MapOfInterface: storable.NewMap("mapofinterface.[map]", "interface{}"),
		MapOfSomeType: &schemaSchemaFixtureMapOfSomeType{
			Foo: storable.NewMap("mapofsometype.[map].foo", "string"),
		},
	},
	StoreFixture: &schemaStoreFixture{
		Foo: storable.NewField("foo", "string"),
	},
	StoreWithConstructFixture: &schemaStoreWithConstructFixture{
		Foo: storable.NewField("foo", "string"),
	},
	StoreWithNewFixture: &schemaStoreWithNewFixture{
		Foo: storable.NewField("foo", "string"),
		Bar: storable.NewField("bar", "string"),
	},
}

Functions

This section is empty.

Types

type EventsFixture

type EventsFixture struct {
	storable.Document `bson:",inline" collection:"event"`
	Checks            map[string]bool
	MustFailBefore    error
	MustFailAfter     error
}

type EventsFixtureQuery

type EventsFixtureQuery struct {
	storable.BaseQuery
}

func (*EventsFixtureQuery) FindById

func (q *EventsFixtureQuery) FindById(ids ...bson.ObjectId) *EventsFixtureQuery

FindById add a new criteria to the query searching by _id

type EventsFixtureResultSet

type EventsFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*EventsFixtureResultSet) All

All returns all documents on the resultset and close the resultset

func (*EventsFixtureResultSet) ForEach

func (r *EventsFixtureResultSet) ForEach(f func(*EventsFixture) error) error

ForEach iterates the resultset calling to the given function.

func (*EventsFixtureResultSet) Get

Get returns the document retrieved with the Next method.

func (*EventsFixtureResultSet) Next

func (r *EventsFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*EventsFixtureResultSet) One

One returns the first document on the resultset and close the resultset

type EventsFixtureStore

type EventsFixtureStore struct {
	storable.Store
}

func NewEventsFixtureStore

func NewEventsFixtureStore(db *mgo.Database) *EventsFixtureStore

func (*EventsFixtureStore) AfterInsert

func (s *EventsFixtureStore) AfterInsert(doc *EventsFixture) error

func (*EventsFixtureStore) AfterUpdate

func (s *EventsFixtureStore) AfterUpdate(doc *EventsFixture) error

func (*EventsFixtureStore) BeforeInsert

func (s *EventsFixtureStore) BeforeInsert(doc *EventsFixture) error

func (*EventsFixtureStore) BeforeUpdate

func (s *EventsFixtureStore) BeforeUpdate(doc *EventsFixture) error

func (*EventsFixtureStore) Find

Find performs a find on the collection using the given query.

func (*EventsFixtureStore) FindOne

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*EventsFixtureStore) Insert

func (s *EventsFixtureStore) Insert(doc *EventsFixture) error

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*EventsFixtureStore) MustFind

MustFind like Find but panics on error

func (*EventsFixtureStore) MustFindOne

func (s *EventsFixtureStore) MustFindOne(query *EventsFixtureQuery) *EventsFixture

MustFindOne like FindOne but panics on error

func (*EventsFixtureStore) New

func (s *EventsFixtureStore) New() (doc *EventsFixture)

New returns a new instance of EventsFixture.

func (*EventsFixtureStore) Query

Query return a new instance of EventsFixtureQuery.

func (*EventsFixtureStore) Save

func (s *EventsFixtureStore) Save(doc *EventsFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*EventsFixtureStore) Update

func (s *EventsFixtureStore) Update(doc *EventsFixture) error

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type EventsSaveFixture

type EventsSaveFixture struct {
	storable.Document `bson:",inline" collection:"event"`
	Checks            map[string]bool
	MustFailBefore    error
	MustFailAfter     error
}

type EventsSaveFixtureQuery

type EventsSaveFixtureQuery struct {
	storable.BaseQuery
}

func (*EventsSaveFixtureQuery) FindById

FindById add a new criteria to the query searching by _id

type EventsSaveFixtureResultSet

type EventsSaveFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*EventsSaveFixtureResultSet) All

All returns all documents on the resultset and close the resultset

func (*EventsSaveFixtureResultSet) ForEach

ForEach iterates the resultset calling to the given function.

func (*EventsSaveFixtureResultSet) Get

Get returns the document retrieved with the Next method.

func (*EventsSaveFixtureResultSet) Next

func (r *EventsSaveFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*EventsSaveFixtureResultSet) One

One returns the first document on the resultset and close the resultset

type EventsSaveFixtureStore

type EventsSaveFixtureStore struct {
	storable.Store
}

func NewEventsSaveFixtureStore

func NewEventsSaveFixtureStore(db *mgo.Database) *EventsSaveFixtureStore

func (*EventsSaveFixtureStore) AfterSave

func (s *EventsSaveFixtureStore) AfterSave(doc *EventsSaveFixture) error

func (*EventsSaveFixtureStore) BeforeSave

func (s *EventsSaveFixtureStore) BeforeSave(doc *EventsSaveFixture) error

func (*EventsSaveFixtureStore) Find

Find performs a find on the collection using the given query.

func (*EventsSaveFixtureStore) FindOne

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*EventsSaveFixtureStore) Insert

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*EventsSaveFixtureStore) MustFind

MustFind like Find but panics on error

func (*EventsSaveFixtureStore) MustFindOne

MustFindOne like FindOne but panics on error

func (*EventsSaveFixtureStore) New

func (s *EventsSaveFixtureStore) New() (doc *EventsSaveFixture)

New returns a new instance of EventsSaveFixture.

func (*EventsSaveFixtureStore) Query

Query return a new instance of EventsSaveFixtureQuery.

func (*EventsSaveFixtureStore) Save

func (s *EventsSaveFixtureStore) Save(doc *EventsSaveFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*EventsSaveFixtureStore) Update

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type MultiKeySortFixture added in v1.0.2

type MultiKeySortFixture struct {
	storable.Document `bson:",inline" collection:"query"`
	Name              string
	Start             time.Time
	End               time.Time
}

type MultiKeySortFixtureQuery added in v1.0.2

type MultiKeySortFixtureQuery struct {
	storable.BaseQuery
}

func (*MultiKeySortFixtureQuery) FindById added in v1.0.2

FindById add a new criteria to the query searching by _id

type MultiKeySortFixtureResultSet added in v1.0.2

type MultiKeySortFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*MultiKeySortFixtureResultSet) All added in v1.0.2

All returns all documents on the resultset and close the resultset

func (*MultiKeySortFixtureResultSet) ForEach added in v1.0.2

ForEach iterates the resultset calling to the given function.

func (*MultiKeySortFixtureResultSet) Get added in v1.0.2

Get returns the document retrieved with the Next method.

func (*MultiKeySortFixtureResultSet) Next added in v1.0.2

func (r *MultiKeySortFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*MultiKeySortFixtureResultSet) One added in v1.0.2

One returns the first document on the resultset and close the resultset

type MultiKeySortFixtureStore added in v1.0.2

type MultiKeySortFixtureStore struct {
	storable.Store
}

func NewMultiKeySortFixtureStore added in v1.0.2

func NewMultiKeySortFixtureStore(db *mgo.Database) *MultiKeySortFixtureStore

func (*MultiKeySortFixtureStore) Find added in v1.0.2

Find performs a find on the collection using the given query.

func (*MultiKeySortFixtureStore) FindOne added in v1.0.2

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*MultiKeySortFixtureStore) Insert added in v1.0.2

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*MultiKeySortFixtureStore) MustFind added in v1.0.2

MustFind like Find but panics on error

func (*MultiKeySortFixtureStore) MustFindOne added in v1.0.2

MustFindOne like FindOne but panics on error

func (*MultiKeySortFixtureStore) New added in v1.0.2

New returns a new instance of MultiKeySortFixture.

func (*MultiKeySortFixtureStore) Query added in v1.0.2

Query return a new instance of MultiKeySortFixtureQuery.

func (*MultiKeySortFixtureStore) Save added in v1.0.2

func (s *MultiKeySortFixtureStore) Save(doc *MultiKeySortFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*MultiKeySortFixtureStore) Update added in v1.0.2

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type QueryFixture

type QueryFixture struct {
	storable.Document `bson:",inline" collection:"query"`
	Foo               string
}

type QueryFixtureQuery

type QueryFixtureQuery struct {
	storable.BaseQuery
}

func (*QueryFixtureQuery) FindById

func (q *QueryFixtureQuery) FindById(ids ...bson.ObjectId) *QueryFixtureQuery

FindById add a new criteria to the query searching by _id

type QueryFixtureResultSet

type QueryFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*QueryFixtureResultSet) All

func (r *QueryFixtureResultSet) All() ([]*QueryFixture, error)

All returns all documents on the resultset and close the resultset

func (*QueryFixtureResultSet) ForEach

func (r *QueryFixtureResultSet) ForEach(f func(*QueryFixture) error) error

ForEach iterates the resultset calling to the given function.

func (*QueryFixtureResultSet) Get

Get returns the document retrieved with the Next method.

func (*QueryFixtureResultSet) Next

func (r *QueryFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*QueryFixtureResultSet) One

One returns the first document on the resultset and close the resultset

type QueryFixtureStore

type QueryFixtureStore struct {
	storable.Store
}

func NewQueryFixtureStore

func NewQueryFixtureStore(db *mgo.Database) *QueryFixtureStore

func (*QueryFixtureStore) Find

Find performs a find on the collection using the given query.

func (*QueryFixtureStore) FindOne

func (s *QueryFixtureStore) FindOne(query *QueryFixtureQuery) (*QueryFixture, error)

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*QueryFixtureStore) Insert

func (s *QueryFixtureStore) Insert(doc *QueryFixture) error

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*QueryFixtureStore) MustFind

MustFind like Find but panics on error

func (*QueryFixtureStore) MustFindOne

func (s *QueryFixtureStore) MustFindOne(query *QueryFixtureQuery) *QueryFixture

MustFindOne like FindOne but panics on error

func (*QueryFixtureStore) New

func (s *QueryFixtureStore) New(f string) (doc *QueryFixture)

New returns a new instance of QueryFixture.

func (*QueryFixtureStore) Query

Query return a new instance of QueryFixtureQuery.

func (*QueryFixtureStore) Save

func (s *QueryFixtureStore) Save(doc *QueryFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*QueryFixtureStore) Update

func (s *QueryFixtureStore) Update(doc *QueryFixture) error

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type ResultSetFixture

type ResultSetFixture struct {
	storable.Document `bson:",inline" collection:"resultset"`
	Foo               string
}

type ResultSetFixtureQuery

type ResultSetFixtureQuery struct {
	storable.BaseQuery
}

func (*ResultSetFixtureQuery) FindById

FindById add a new criteria to the query searching by _id

type ResultSetFixtureResultSet

type ResultSetFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*ResultSetFixtureResultSet) All

All returns all documents on the resultset and close the resultset

func (*ResultSetFixtureResultSet) ForEach

ForEach iterates the resultset calling to the given function.

func (*ResultSetFixtureResultSet) Get

Get returns the document retrieved with the Next method.

func (*ResultSetFixtureResultSet) Next

func (r *ResultSetFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*ResultSetFixtureResultSet) One

One returns the first document on the resultset and close the resultset

type ResultSetFixtureStore

type ResultSetFixtureStore struct {
	storable.Store
}

func NewResultSetFixtureStore

func NewResultSetFixtureStore(db *mgo.Database) *ResultSetFixtureStore

func (*ResultSetFixtureStore) Find

Find performs a find on the collection using the given query.

func (*ResultSetFixtureStore) FindOne

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*ResultSetFixtureStore) Insert

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*ResultSetFixtureStore) MustFind

MustFind like Find but panics on error

func (*ResultSetFixtureStore) MustFindOne

MustFindOne like FindOne but panics on error

func (*ResultSetFixtureStore) New

New returns a new instance of ResultSetFixture.

func (*ResultSetFixtureStore) Query

Query return a new instance of ResultSetFixtureQuery.

func (*ResultSetFixtureStore) Save

func (s *ResultSetFixtureStore) Save(doc *ResultSetFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*ResultSetFixtureStore) Update

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type ResultSetInitFixture added in v1.0.9

type ResultSetInitFixture struct {
	storable.Document `bson:",inline" collection:"resultset"`
	Foo               string
}

func (*ResultSetInitFixture) Init added in v1.0.9

func (r *ResultSetInitFixture) Init(doc storable.DocumentBase) error

type ResultSetInitFixtureQuery added in v1.0.9

type ResultSetInitFixtureQuery struct {
	storable.BaseQuery
}

func (*ResultSetInitFixtureQuery) FindById added in v1.0.9

FindById add a new criteria to the query searching by _id

type ResultSetInitFixtureResultSet added in v1.0.9

type ResultSetInitFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*ResultSetInitFixtureResultSet) All added in v1.0.9

All returns all documents on the resultset and close the resultset

func (*ResultSetInitFixtureResultSet) ForEach added in v1.0.9

ForEach iterates the resultset calling to the given function.

func (*ResultSetInitFixtureResultSet) Get added in v1.0.9

Get returns the document retrieved with the Next method.

func (*ResultSetInitFixtureResultSet) Next added in v1.0.9

func (r *ResultSetInitFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*ResultSetInitFixtureResultSet) One added in v1.0.9

One returns the first document on the resultset and close the resultset

type ResultSetInitFixtureStore added in v1.0.9

type ResultSetInitFixtureStore struct {
	storable.Store
}

func NewResultSetInitFixtureStore added in v1.0.9

func NewResultSetInitFixtureStore(db *mgo.Database) *ResultSetInitFixtureStore

func (*ResultSetInitFixtureStore) Find added in v1.0.9

Find performs a find on the collection using the given query.

func (*ResultSetInitFixtureStore) FindOne added in v1.0.9

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*ResultSetInitFixtureStore) Insert added in v1.0.9

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*ResultSetInitFixtureStore) MustFind added in v1.0.9

MustFind like Find but panics on error

func (*ResultSetInitFixtureStore) MustFindOne added in v1.0.9

MustFindOne like FindOne but panics on error

func (*ResultSetInitFixtureStore) New added in v1.0.9

New returns a new instance of ResultSetInitFixture.

func (*ResultSetInitFixtureStore) Query added in v1.0.9

Query return a new instance of ResultSetInitFixtureQuery.

func (*ResultSetInitFixtureStore) Save added in v1.0.9

func (s *ResultSetInitFixtureStore) Save(doc *ResultSetInitFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*ResultSetInitFixtureStore) Update added in v1.0.9

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type SchemaFixture

type SchemaFixture struct {
	storable.Document `bson:",inline" collection:"schema"`

	String string
	Int    int `bson:"foo"`
	Nested *SchemaFixture
	Inline struct {
		Inline string
	} `bson:",inline"`
	MapOfString    map[string]string
	MapOfInterface map[string]interface{}
	MapOfSomeType  map[string]struct {
		Foo string
	}
}

type SchemaFixtureQuery

type SchemaFixtureQuery struct {
	storable.BaseQuery
}

func (*SchemaFixtureQuery) FindById

func (q *SchemaFixtureQuery) FindById(ids ...bson.ObjectId) *SchemaFixtureQuery

FindById add a new criteria to the query searching by _id

type SchemaFixtureResultSet

type SchemaFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*SchemaFixtureResultSet) All

All returns all documents on the resultset and close the resultset

func (*SchemaFixtureResultSet) ForEach

func (r *SchemaFixtureResultSet) ForEach(f func(*SchemaFixture) error) error

ForEach iterates the resultset calling to the given function.

func (*SchemaFixtureResultSet) Get

Get returns the document retrieved with the Next method.

func (*SchemaFixtureResultSet) Next

func (r *SchemaFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*SchemaFixtureResultSet) One

One returns the first document on the resultset and close the resultset

type SchemaFixtureStore

type SchemaFixtureStore struct {
	storable.Store
}

func NewSchemaFixtureStore

func NewSchemaFixtureStore(db *mgo.Database) *SchemaFixtureStore

func (*SchemaFixtureStore) Find

Find performs a find on the collection using the given query.

func (*SchemaFixtureStore) FindOne

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*SchemaFixtureStore) Insert

func (s *SchemaFixtureStore) Insert(doc *SchemaFixture) error

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*SchemaFixtureStore) MustFind

MustFind like Find but panics on error

func (*SchemaFixtureStore) MustFindOne

func (s *SchemaFixtureStore) MustFindOne(query *SchemaFixtureQuery) *SchemaFixture

MustFindOne like FindOne but panics on error

func (*SchemaFixtureStore) New

func (s *SchemaFixtureStore) New() (doc *SchemaFixture)

New returns a new instance of SchemaFixture.

func (*SchemaFixtureStore) Query

Query return a new instance of SchemaFixtureQuery.

func (*SchemaFixtureStore) Save

func (s *SchemaFixtureStore) Save(doc *SchemaFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*SchemaFixtureStore) Update

func (s *SchemaFixtureStore) Update(doc *SchemaFixture) error

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type StoreFixture

type StoreFixture struct {
	storable.Document `bson:",inline" collection:"store"`
	Foo               string
}

type StoreFixtureQuery

type StoreFixtureQuery struct {
	storable.BaseQuery
}

func (*StoreFixtureQuery) FindById

func (q *StoreFixtureQuery) FindById(ids ...bson.ObjectId) *StoreFixtureQuery

FindById add a new criteria to the query searching by _id

type StoreFixtureResultSet

type StoreFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*StoreFixtureResultSet) All

func (r *StoreFixtureResultSet) All() ([]*StoreFixture, error)

All returns all documents on the resultset and close the resultset

func (*StoreFixtureResultSet) ForEach

func (r *StoreFixtureResultSet) ForEach(f func(*StoreFixture) error) error

ForEach iterates the resultset calling to the given function.

func (*StoreFixtureResultSet) Get

Get returns the document retrieved with the Next method.

func (*StoreFixtureResultSet) Next

func (r *StoreFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*StoreFixtureResultSet) One

One returns the first document on the resultset and close the resultset

type StoreFixtureStore

type StoreFixtureStore struct {
	storable.Store
}

func NewStoreFixtureStore

func NewStoreFixtureStore(db *mgo.Database) *StoreFixtureStore

func (*StoreFixtureStore) Find

Find performs a find on the collection using the given query.

func (*StoreFixtureStore) FindOne

func (s *StoreFixtureStore) FindOne(query *StoreFixtureQuery) (*StoreFixture, error)

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*StoreFixtureStore) Insert

func (s *StoreFixtureStore) Insert(doc *StoreFixture) error

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*StoreFixtureStore) MustFind

MustFind like Find but panics on error

func (*StoreFixtureStore) MustFindOne

func (s *StoreFixtureStore) MustFindOne(query *StoreFixtureQuery) *StoreFixture

MustFindOne like FindOne but panics on error

func (*StoreFixtureStore) New

func (s *StoreFixtureStore) New() (doc *StoreFixture)

New returns a new instance of StoreFixture.

func (*StoreFixtureStore) Query

Query return a new instance of StoreFixtureQuery.

func (*StoreFixtureStore) Save

func (s *StoreFixtureStore) Save(doc *StoreFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*StoreFixtureStore) Update

func (s *StoreFixtureStore) Update(doc *StoreFixture) error

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type StoreWithConstructFixture

type StoreWithConstructFixture struct {
	storable.Document `bson:",inline" collection:"store_construct"`
	Foo               string
}

type StoreWithConstructFixtureQuery

type StoreWithConstructFixtureQuery struct {
	storable.BaseQuery
}

func (*StoreWithConstructFixtureQuery) FindById

FindById add a new criteria to the query searching by _id

type StoreWithConstructFixtureResultSet

type StoreWithConstructFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*StoreWithConstructFixtureResultSet) All

All returns all documents on the resultset and close the resultset

func (*StoreWithConstructFixtureResultSet) ForEach

ForEach iterates the resultset calling to the given function.

func (*StoreWithConstructFixtureResultSet) Get

Get returns the document retrieved with the Next method.

func (*StoreWithConstructFixtureResultSet) Next

func (r *StoreWithConstructFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*StoreWithConstructFixtureResultSet) One

One returns the first document on the resultset and close the resultset

type StoreWithConstructFixtureStore

type StoreWithConstructFixtureStore struct {
	storable.Store
}

func NewStoreWithConstructFixtureStore

func NewStoreWithConstructFixtureStore(db *mgo.Database) *StoreWithConstructFixtureStore

func (*StoreWithConstructFixtureStore) Find

Find performs a find on the collection using the given query.

func (*StoreWithConstructFixtureStore) FindOne

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*StoreWithConstructFixtureStore) Insert

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*StoreWithConstructFixtureStore) MustFind

MustFind like Find but panics on error

func (*StoreWithConstructFixtureStore) MustFindOne

MustFindOne like FindOne but panics on error

func (*StoreWithConstructFixtureStore) New

New returns a new instance of StoreWithConstructFixture.

func (*StoreWithConstructFixtureStore) Query

Query return a new instance of StoreWithConstructFixtureQuery.

func (*StoreWithConstructFixtureStore) Save

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*StoreWithConstructFixtureStore) Update

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

type StoreWithNewFixture added in v1.0.7

type StoreWithNewFixture struct {
	storable.Document `bson:",inline" collection:"store_new"`
	Foo               string
	Bar               string
}

type StoreWithNewFixtureQuery added in v1.0.7

type StoreWithNewFixtureQuery struct {
	storable.BaseQuery
}

func (*StoreWithNewFixtureQuery) FindById added in v1.0.7

FindById add a new criteria to the query searching by _id

type StoreWithNewFixtureResultSet added in v1.0.7

type StoreWithNewFixtureResultSet struct {
	storable.ResultSet
	// contains filtered or unexported fields
}

func (*StoreWithNewFixtureResultSet) All added in v1.0.7

All returns all documents on the resultset and close the resultset

func (*StoreWithNewFixtureResultSet) ForEach added in v1.0.7

ForEach iterates the resultset calling to the given function.

func (*StoreWithNewFixtureResultSet) Get added in v1.0.7

Get returns the document retrieved with the Next method.

func (*StoreWithNewFixtureResultSet) Next added in v1.0.7

func (r *StoreWithNewFixtureResultSet) Next() (returned bool)

Next prepares the next result document for reading with the Get method.

func (*StoreWithNewFixtureResultSet) One added in v1.0.7

One returns the first document on the resultset and close the resultset

type StoreWithNewFixtureStore added in v1.0.7

type StoreWithNewFixtureStore struct {
	storable.Store
}

func NewStoreWithNewFixtureStore added in v1.0.7

func NewStoreWithNewFixtureStore(db *mgo.Database) *StoreWithNewFixtureStore

func (*StoreWithNewFixtureStore) Find added in v1.0.7

Find performs a find on the collection using the given query.

func (*StoreWithNewFixtureStore) FindOne added in v1.0.7

FindOne performs a find on the collection using the given query returning the first document from the resultset.

func (*StoreWithNewFixtureStore) Insert added in v1.0.7

Insert insert the given document on the collection, trigger BeforeInsert and AfterInsert if any. Throws ErrNonNewDocument if doc is a non-new document.

func (*StoreWithNewFixtureStore) MustFind added in v1.0.7

MustFind like Find but panics on error

func (*StoreWithNewFixtureStore) MustFindOne added in v1.0.7

MustFindOne like FindOne but panics on error

func (*StoreWithNewFixtureStore) New added in v1.0.7

func (*StoreWithNewFixtureStore) Query added in v1.0.7

Query return a new instance of StoreWithNewFixtureQuery.

func (*StoreWithNewFixtureStore) Save added in v1.0.7

func (s *StoreWithNewFixtureStore) Save(doc *StoreWithNewFixture) (updated bool, err error)

Save insert or update the given document on the collection using Upsert, trigger BeforeUpdate and AfterUpdate if the document is non-new and BeforeInsert and AfterInset if is new.

func (*StoreWithNewFixtureStore) Update added in v1.0.7

Update update the given document on the collection, trigger BeforeUpdate and AfterUpdate if any. Throws ErrNewDocument if doc is a new document.

Jump to

Keyboard shortcuts

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