Documentation ¶
Index ¶
- Variables
- type Alias
- type AnotherModel
- type AnotherModelQuery
- type AnotherModelResultSet
- type AnotherModelStore
- func (s *AnotherModelStore) Find(query *AnotherModelQuery) (*AnotherModelResultSet, error)
- func (s *AnotherModelStore) FindOne(query *AnotherModelQuery) (*AnotherModel, error)
- func (s *AnotherModelStore) Insert(doc *AnotherModel) error
- func (s *AnotherModelStore) MustFind(query *AnotherModelQuery) *AnotherModelResultSet
- func (s *AnotherModelStore) MustFindOne(query *AnotherModelQuery) *AnotherModel
- func (s *AnotherModelStore) New() (doc *AnotherModel)
- func (s *AnotherModelStore) Query() *AnotherModelQuery
- func (s *AnotherModelStore) Save(doc *AnotherModel) (updated bool, err error)
- func (s *AnotherModelStore) Update(doc *AnotherModel) error
- type AnotherType
- type MyModel
- type MyModelQuery
- type MyModelResultSet
- type MyModelStore
- func (s *MyModelStore) Find(query *MyModelQuery) (*MyModelResultSet, error)
- func (s *MyModelStore) FindOne(query *MyModelQuery) (*MyModel, error)
- func (s *MyModelStore) Insert(doc *MyModel) error
- func (s *MyModelStore) MustFind(query *MyModelQuery) *MyModelResultSet
- func (s *MyModelStore) MustFindOne(query *MyModelQuery) *MyModel
- func (s *MyModelStore) New() (doc *MyModel)
- func (s *MyModelStore) Query() *MyModelQuery
- func (s *MyModelStore) Save(doc *MyModel) (updated bool, err error)
- func (s *MyModelStore) Update(doc *MyModel) error
- type SliceAlias
- type SomeType
Constants ¶
This section is empty.
Variables ¶
View Source
var Schema = schema{ AnotherModel: &schemaAnotherModel{ Foo: storable.NewField("foo", "float64"), Bar: storable.NewField("bar", "string"), }, MyModel: &schemaMyModel{ String: storable.NewField("string", "string"), Int: storable.NewField("bla2", "int"), Slice: storable.NewField("slice", "string"), SliceAlias: storable.NewField("slicealias", "string"), NestedRef: &schemaMyModelNestedRef{ X: storable.NewField("nestedref.x", "int"), Y: storable.NewField("nestedref.y", "int"), Another: &schemaMyModelNestedRefAnother{ X: storable.NewField("nestedref.another.x", "int"), Y: storable.NewField("nestedref.another.y", "int"), }, }, Nested: &schemaMyModelNested{ X: storable.NewField("nested.x", "int"), Y: storable.NewField("nested.y", "int"), Another: &schemaMyModelNestedAnother{ X: storable.NewField("nested.another.x", "int"), Y: storable.NewField("nested.another.y", "int"), }, }, NestedSlice: &schemaMyModelNestedSlice{ X: storable.NewField("nestedslice.x", "int"), Y: storable.NewField("nestedslice.y", "int"), Another: &schemaMyModelNestedSliceAnother{ X: storable.NewField("nestedslice.another.x", "int"), Y: storable.NewField("nestedslice.another.y", "int"), }, }, AliasOfString: storable.NewField("aliasofstring", "string"), Time: storable.NewField("time", "time.Time"), MapsOfString: storable.NewMap("mapsofstring.[map]", "string"), InlineStruct: &schemaMyModelInlineStruct{ MapOfString: storable.NewMap("inlinestruct.mapofstring.[map]", "string"), MapOfSomeType: &schemaMyModelInlineStructMapOfSomeType{ X: storable.NewMap("inlinestruct.mapofsometype.[map].x", "int"), Y: storable.NewMap("inlinestruct.mapofsometype.[map].y", "int"), Another: &schemaMyModelInlineStructMapOfSomeTypeAnother{ X: storable.NewMap("inlinestruct.mapofsometype.[map].another.x", "int"), Y: storable.NewMap("inlinestruct.mapofsometype.[map].another.y", "int"), }, }, }, }, }
Functions ¶
This section is empty.
Types ¶
type AnotherModel ¶ added in v0.2.0
type AnotherModel struct { storable.Document `bson:",inline" collection:"another_model"` Foo float64 Bar string }
func NewAnotherModel ¶ added in v0.2.0
func NewAnotherModel() *AnotherModel
type AnotherModelQuery ¶ added in v0.2.0
func (*AnotherModelQuery) FindById ¶ added in v0.2.0
func (q *AnotherModelQuery) FindById(ids ...bson.ObjectId)
type AnotherModelResultSet ¶ added in v0.2.0
func (*AnotherModelResultSet) All ¶ added in v0.2.0
func (r *AnotherModelResultSet) All() ([]*AnotherModel, error)
func (*AnotherModelResultSet) Next ¶ added in v0.2.0
func (r *AnotherModelResultSet) Next() (*AnotherModel, error)
func (*AnotherModelResultSet) One ¶ added in v0.2.0
func (r *AnotherModelResultSet) One() (*AnotherModel, error)
type AnotherModelStore ¶ added in v0.2.0
func NewAnotherModelStore ¶ added in v0.2.0
func NewAnotherModelStore(db *mgo.Database, foo bool) *AnotherModelStore
func (*AnotherModelStore) Find ¶ added in v0.2.0
func (s *AnotherModelStore) Find(query *AnotherModelQuery) (*AnotherModelResultSet, error)
func (*AnotherModelStore) FindOne ¶ added in v0.2.0
func (s *AnotherModelStore) FindOne(query *AnotherModelQuery) (*AnotherModel, error)
func (*AnotherModelStore) Insert ¶ added in v0.2.0
func (s *AnotherModelStore) Insert(doc *AnotherModel) error
func (*AnotherModelStore) MustFind ¶ added in v0.2.0
func (s *AnotherModelStore) MustFind(query *AnotherModelQuery) *AnotherModelResultSet
func (*AnotherModelStore) MustFindOne ¶ added in v0.2.0
func (s *AnotherModelStore) MustFindOne(query *AnotherModelQuery) *AnotherModel
func (*AnotherModelStore) New ¶ added in v0.2.0
func (s *AnotherModelStore) New() (doc *AnotherModel)
func (*AnotherModelStore) Query ¶ added in v0.2.0
func (s *AnotherModelStore) Query() *AnotherModelQuery
func (*AnotherModelStore) Save ¶ added in v0.2.0
func (s *AnotherModelStore) Save(doc *AnotherModel) (updated bool, err error)
func (*AnotherModelStore) Update ¶ added in v0.2.0
func (s *AnotherModelStore) Update(doc *AnotherModel) error
type AnotherType ¶ added in v0.2.0
type MyModel ¶ added in v0.2.0
type MyModel struct { storable.Document `bson:",inline" collection:"my_model"` String string Int int `bson:"bla2"` Bytes []byte Slice []string SliceAlias SliceAlias NestedRef *SomeType Nested SomeType NestedSlice []*SomeType AliasOfString Alias Time time.Time MapsOfString map[string]string InlineStruct struct { MapOfString map[string]string MapOfSomeType map[string]SomeType } }
func (*MyModel) IrrelevantFunction ¶ added in v0.2.0
func (m *MyModel) IrrelevantFunction()
type MyModelQuery ¶ added in v0.2.0
func (*MyModelQuery) FindById ¶ added in v0.2.0
func (q *MyModelQuery) FindById(ids ...bson.ObjectId)
type MyModelResultSet ¶ added in v0.2.0
func (*MyModelResultSet) All ¶ added in v0.2.0
func (r *MyModelResultSet) All() ([]*MyModel, error)
func (*MyModelResultSet) Next ¶ added in v0.2.0
func (r *MyModelResultSet) Next() (*MyModel, error)
func (*MyModelResultSet) One ¶ added in v0.2.0
func (r *MyModelResultSet) One() (*MyModel, error)
type MyModelStore ¶ added in v0.2.0
func NewMyModelStore ¶ added in v0.2.0
func NewMyModelStore(db *mgo.Database) *MyModelStore
func (*MyModelStore) Find ¶ added in v0.2.0
func (s *MyModelStore) Find(query *MyModelQuery) (*MyModelResultSet, error)
func (*MyModelStore) FindOne ¶ added in v0.2.0
func (s *MyModelStore) FindOne(query *MyModelQuery) (*MyModel, error)
func (*MyModelStore) Insert ¶ added in v0.2.0
func (s *MyModelStore) Insert(doc *MyModel) error
func (*MyModelStore) MustFind ¶ added in v0.2.0
func (s *MyModelStore) MustFind(query *MyModelQuery) *MyModelResultSet
func (*MyModelStore) MustFindOne ¶ added in v0.2.0
func (s *MyModelStore) MustFindOne(query *MyModelQuery) *MyModel
func (*MyModelStore) New ¶ added in v0.2.0
func (s *MyModelStore) New() (doc *MyModel)
func (*MyModelStore) Query ¶ added in v0.2.0
func (s *MyModelStore) Query() *MyModelQuery
func (*MyModelStore) Save ¶ added in v0.2.0
func (s *MyModelStore) Save(doc *MyModel) (updated bool, err error)
func (*MyModelStore) Update ¶ added in v0.2.0
func (s *MyModelStore) Update(doc *MyModel) error
type SliceAlias ¶ added in v0.2.0
type SliceAlias []string
type SomeType ¶ added in v0.2.0
type SomeType struct { X int Y int Another AnotherType }
Click to show internal directories.
Click to hide internal directories.