Documentation ¶
Index ¶
- func Delete(obj interface{}) error
- func DeleteMany(table interface{}, filter interface{}) error
- func Find(out interface{}, filter interface{}, options ...FindOption) error
- func FindById(out interface{}, id string) error
- func FindOne(out interface{}, filter interface{}, options ...FindOption) error
- func GetIDValue(obj interface{}) string
- func GetTableName(obj interface{}) string
- func RegConnCreator(typeName string, creator ConnectionCreator)
- func Save(obj interface{}) error
- func ToSnakeCase(str string) string
- func UpdateMany(table interface{}, filter interface{}, update interface{}) error
- type BeforeInsertHandler
- type Connection
- type ConnectionCreator
- type FieldOrder
- type FindOption
- type MongoConn
- func (o *MongoConn) Delete(obj interface{}) error
- func (o *MongoConn) DeleteMany(table interface{}, filter interface{}) error
- func (o *MongoConn) Find(out interface{}, filter interface{}, findOptions ...FindOption) error
- func (o *MongoConn) FindById(out interface{}, id string) error
- func (o *MongoConn) FindOne(out interface{}, filter interface{}, opt ...FindOption) error
- func (o *MongoConn) Save(obj interface{}) error
- func (o *MongoConn) Update(table interface{}, filter interface{}, update interface{}) error
- type TableNameInformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteMany ¶
func DeleteMany(table interface{}, filter interface{}) error
func Find ¶
func Find(out interface{}, filter interface{}, options ...FindOption) error
func FindOne ¶
func FindOne(out interface{}, filter interface{}, options ...FindOption) error
func GetIDValue ¶
func GetIDValue(obj interface{}) string
func GetTableName ¶
func GetTableName(obj interface{}) string
func RegConnCreator ¶
func RegConnCreator(typeName string, creator ConnectionCreator)
func ToSnakeCase ¶
func UpdateMany ¶
func UpdateMany(table interface{}, filter interface{}, update interface{}) error
Types ¶
type BeforeInsertHandler ¶
type BeforeInsertHandler interface {
BeforeCreate()
}
type Connection ¶
type Connection interface { Save(obj interface{}) error Update(table interface{}, filter interface{}, update interface{}) error Delete(obj interface{}) error DeleteMany(table interface{}, filter interface{}) error FindById(out interface{}, id string) error FindOne(out interface{}, filter interface{}, options ...FindOption) error Find(out interface{}, filter interface{}, options ...FindOption) error }
func Conn ¶
func Conn(name ...string) Connection
type ConnectionCreator ¶
type ConnectionCreator func(configName string) (Connection, error)
type FieldOrder ¶
func Asc ¶
func Asc(fieldName string) FieldOrder
func Desc ¶
func Desc(fieldName string) FieldOrder
type FindOption ¶
type FindOption struct { Skip int Limit int Order []FieldOrder }
type MongoConn ¶
type MongoConn struct {
// contains filtered or unexported fields
}
func (*MongoConn) DeleteMany ¶
func (*MongoConn) Find ¶
func (o *MongoConn) Find(out interface{}, filter interface{}, findOptions ...FindOption) error
func (*MongoConn) FindOne ¶
func (o *MongoConn) FindOne(out interface{}, filter interface{}, opt ...FindOption) error
type TableNameInformer ¶
type TableNameInformer interface {
TableName() string
}
Click to show internal directories.
Click to hide internal directories.