Documentation ¶
Index ¶
- func CreateContext() (context.Context, context.CancelFunc, error)
- func GetCollectionName(obj DataObject) string
- func Init(c Config) error
- func Ping() error
- type BaseObject
- type Collection
- type CollectionStruct
- func (coll CollectionStruct) Count(filter interface{}) (int64, error)
- func (coll CollectionStruct) CreateIndex(name string, keys interface{}) error
- func (coll CollectionStruct) Delete(o interface{}) error
- func (coll CollectionStruct) Drop()
- func (coll CollectionStruct) Find(o interface{}, filter interface{}) error
- func (coll CollectionStruct) FindSpecificType(o interface{}, filter interface{}) error
- func (coll CollectionStruct) Load(o interface{}) error
- func (coll CollectionStruct) MongoCollection() *mongo.Collection
- func (coll CollectionStruct) Save(o interface{}) error
- func (coll CollectionStruct) Update(o interface{}, filter interface{}) error
- func (coll CollectionStruct) UpdateAll(o interface{}, filter interface{}) (int, error)
- type Config
- type DataObject
- func (obj DataObject) Append(val DataObject)
- func (obj DataObject) Clear()
- func (obj DataObject) CreateNew() DataObject
- func (obj DataObject) Field(name string) DataObject
- func (obj DataObject) FieldExists(name string) bool
- func (obj DataObject) FieldTag(name string, tagName string) string
- func (obj DataObject) FullTypeName() string
- func (obj DataObject) GetID() (primitive.ObjectID, error)
- func (obj DataObject) Index(i int) DataObject
- func (obj DataObject) Interface() interface{}
- func (obj DataObject) IsSlice() bool
- func (obj DataObject) Len() int
- func (obj DataObject) Name() string
- func (obj DataObject) Package() string
- func (obj DataObject) Set(val interface{})
- func (obj DataObject) SetCreationTime() error
- func (obj DataObject) SetID(id primitive.ObjectID) error
- func (obj DataObject) SetTypeName() error
- func (obj DataObject) SetUpdateTime() error
- func (obj DataObject) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateContext ¶
func CreateContext() (context.Context, context.CancelFunc, error)
func GetCollectionName ¶
func GetCollectionName(obj DataObject) string
Types ¶
type BaseObject ¶
type Collection ¶
type Collection interface { Save(obj interface{}) error Update(obj interface{}, filter interface{}) error UpdateAll(obj interface{}, filter interface{}) (int, error) Load(obj interface{}) error Find(obj interface{}, filter interface{}) error FindSpecificType(obj interface{}, filter interface{}) error Drop() Delete(obj interface{}) error Count(filter interface{}) (int64, error) MongoCollection() *mongo.Collection CreateIndex(name string, keys interface{}) error }
func Coll ¶
func Coll(o interface{}) Collection
type CollectionStruct ¶
type CollectionStruct struct {
Collection *mongo.Collection
}
func (CollectionStruct) Count ¶
func (coll CollectionStruct) Count(filter interface{}) (int64, error)
func (CollectionStruct) CreateIndex ¶
func (coll CollectionStruct) CreateIndex(name string, keys interface{}) error
func (CollectionStruct) Delete ¶
func (coll CollectionStruct) Delete(o interface{}) error
func (CollectionStruct) Drop ¶
func (coll CollectionStruct) Drop()
func (CollectionStruct) Find ¶
func (coll CollectionStruct) Find(o interface{}, filter interface{}) error
func (CollectionStruct) FindSpecificType ¶
func (coll CollectionStruct) FindSpecificType(o interface{}, filter interface{}) error
func (CollectionStruct) Load ¶
func (coll CollectionStruct) Load(o interface{}) error
func (CollectionStruct) MongoCollection ¶
func (coll CollectionStruct) MongoCollection() *mongo.Collection
func (CollectionStruct) Save ¶
func (coll CollectionStruct) Save(o interface{}) error
func (CollectionStruct) Update ¶
func (coll CollectionStruct) Update(o interface{}, filter interface{}) error
func (CollectionStruct) UpdateAll ¶
func (coll CollectionStruct) UpdateAll(o interface{}, filter interface{}) (int, error)
type Config ¶
type Config struct { ConnectionString string // contains filtered or unexported fields }
type DataObject ¶
type DataObject struct {
// contains filtered or unexported fields
}
func Obj ¶
func Obj(obj interface{}) DataObject
func (DataObject) Append ¶
func (obj DataObject) Append(val DataObject)
func (DataObject) Clear ¶
func (obj DataObject) Clear()
func (DataObject) CreateNew ¶
func (obj DataObject) CreateNew() DataObject
func (DataObject) Field ¶
func (obj DataObject) Field(name string) DataObject
func (DataObject) FieldExists ¶
func (obj DataObject) FieldExists(name string) bool
func (DataObject) FullTypeName ¶
func (obj DataObject) FullTypeName() string
func (DataObject) Index ¶
func (obj DataObject) Index(i int) DataObject
func (DataObject) Interface ¶
func (obj DataObject) Interface() interface{}
func (DataObject) IsSlice ¶
func (obj DataObject) IsSlice() bool
func (DataObject) Len ¶
func (obj DataObject) Len() int
func (DataObject) Name ¶
func (obj DataObject) Name() string
func (DataObject) Package ¶
func (obj DataObject) Package() string
func (DataObject) Set ¶
func (obj DataObject) Set(val interface{})
func (DataObject) SetCreationTime ¶
func (obj DataObject) SetCreationTime() error
func (DataObject) SetTypeName ¶
func (obj DataObject) SetTypeName() error
func (DataObject) SetUpdateTime ¶
func (obj DataObject) SetUpdateTime() error
func (DataObject) String ¶
func (obj DataObject) String() string
Click to show internal directories.
Click to hide internal directories.