Documentation
¶
Index ¶
- type Counter
- type CounterColumns
- type CounterModel
- type Mail
- func (dao *Mail) Aggregate(ctx context.Context, pipelineFunc MailPipelineFunc, ...) (*mongo.Cursor, error)
- func (dao *Mail) Count(ctx context.Context, filterFunc MailFilterFunc, ...) (int64, error)
- func (dao *Mail) DeleteMany(ctx context.Context, filterFunc MailFilterFunc, ...) (*mongo.DeleteResult, error)
- func (dao *Mail) DeleteOne(ctx context.Context, filterFunc MailFilterFunc, ...) (*mongo.DeleteResult, error)
- func (dao *Mail) DeleteOneByID(ctx context.Context, id string, optionsFunc ...MailDeleteOptionsFunc) (*mongo.DeleteResult, error)
- func (dao *Mail) FindMany(ctx context.Context, filterFunc MailFilterFunc, ...) ([]*modelpkg.Mail, error)
- func (dao *Mail) FindOne(ctx context.Context, filterFunc MailFilterFunc, ...) (*modelpkg.Mail, error)
- func (dao *Mail) FindOneByID(ctx context.Context, id string, optionsFunc ...MailFindOneOptionsFunc) (*modelpkg.Mail, error)
- func (dao *Mail) InsertMany(ctx context.Context, models []*modelpkg.Mail, ...) (*mongo.InsertManyResult, error)
- func (dao *Mail) InsertOne(ctx context.Context, model *modelpkg.Mail, ...) (*mongo.InsertOneResult, error)
- func (dao *Mail) UpdateMany(ctx context.Context, filterFunc MailFilterFunc, updateFunc MailUpdateFunc, ...) (*mongo.UpdateResult, error)
- func (dao *Mail) UpdateOne(ctx context.Context, filterFunc MailFilterFunc, updateFunc MailUpdateFunc, ...) (*mongo.UpdateResult, error)
- func (dao *Mail) UpdateOneByID(ctx context.Context, id string, updateFunc MailUpdateFunc, ...) (*mongo.UpdateResult, error)
- type MailAggregateOptionsFunc
- type MailColumns
- type MailCountOptionsFunc
- type MailDeleteOptionsFunc
- type MailFilterFunc
- type MailFindManyOptionsFunc
- type MailFindOneOptionsFunc
- type MailInsertManyOptionsFunc
- type MailInsertOneOptionsFunc
- type MailPipelineFunc
- type MailUpdateFunc
- type MailUpdateOptionsFunc
- type User
- func (dao *User) Aggregate(ctx context.Context, pipelineFunc UserPipelineFunc, ...) (*mongo.Cursor, error)
- func (dao *User) Count(ctx context.Context, filterFunc UserFilterFunc, ...) (int64, error)
- func (dao *User) DeleteMany(ctx context.Context, filterFunc UserFilterFunc, ...) (*mongo.DeleteResult, error)
- func (dao *User) DeleteOne(ctx context.Context, filterFunc UserFilterFunc, ...) (*mongo.DeleteResult, error)
- func (dao *User) DeleteOneByID(ctx context.Context, id string, optionsFunc ...UserDeleteOptionsFunc) (*mongo.DeleteResult, error)
- func (dao *User) FindMany(ctx context.Context, filterFunc UserFilterFunc, ...) ([]*modelpkg.User, error)
- func (dao *User) FindOne(ctx context.Context, filterFunc UserFilterFunc, ...) (*modelpkg.User, error)
- func (dao *User) FindOneByID(ctx context.Context, id string, optionsFunc ...UserFindOneOptionsFunc) (*modelpkg.User, error)
- func (dao *User) InsertMany(ctx context.Context, models []*modelpkg.User, ...) (*mongo.InsertManyResult, error)
- func (dao *User) InsertOne(ctx context.Context, model *modelpkg.User, ...) (*mongo.InsertOneResult, error)
- func (dao *User) UpdateMany(ctx context.Context, filterFunc UserFilterFunc, updateFunc UserUpdateFunc, ...) (*mongo.UpdateResult, error)
- func (dao *User) UpdateOne(ctx context.Context, filterFunc UserFilterFunc, updateFunc UserUpdateFunc, ...) (*mongo.UpdateResult, error)
- func (dao *User) UpdateOneByID(ctx context.Context, id string, updateFunc UserUpdateFunc, ...) (*mongo.UpdateResult, error)
- type UserAggregateOptionsFunc
- type UserColumns
- type UserCountOptionsFunc
- type UserDeleteOptionsFunc
- type UserFilterFunc
- type UserFindManyOptionsFunc
- type UserFindOneOptionsFunc
- type UserInsertManyOptionsFunc
- type UserInsertOneOptionsFunc
- type UserPipelineFunc
- type UserUpdateFunc
- type UserUpdateOptionsFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct { Columns *CounterColumns Database *mongo.Database Collection *mongo.Collection }
func NewCounter ¶
type CounterColumns ¶
type CounterModel ¶
type Mail ¶
type Mail struct { Columns *MailColumns Database *mongo.Database Collection *mongo.Collection }
func (*Mail) Aggregate ¶
func (dao *Mail) Aggregate(ctx context.Context, pipelineFunc MailPipelineFunc, optionsFunc ...MailAggregateOptionsFunc) (*mongo.Cursor, error)
Aggregate executes an aggregate command against the collection and returns a cursor over the resulting documents.
func (*Mail) Count ¶
func (dao *Mail) Count(ctx context.Context, filterFunc MailFilterFunc, optionsFunc ...MailCountOptionsFunc) (int64, error)
Count returns the number of documents in the collection.
func (*Mail) DeleteMany ¶
func (dao *Mail) DeleteMany(ctx context.Context, filterFunc MailFilterFunc, optionsFunc ...MailDeleteOptionsFunc) (*mongo.DeleteResult, error)
DeleteMany executes a delete command to delete documents from the collection.
func (*Mail) DeleteOne ¶
func (dao *Mail) DeleteOne(ctx context.Context, filterFunc MailFilterFunc, optionsFunc ...MailDeleteOptionsFunc) (*mongo.DeleteResult, error)
DeleteOne executes a delete command to delete at most one document from the collection.
func (*Mail) DeleteOneByID ¶
func (dao *Mail) DeleteOneByID(ctx context.Context, id string, optionsFunc ...MailDeleteOptionsFunc) (*mongo.DeleteResult, error)
DeleteOneByID executes a delete command to delete at most one document from the collection.
func (*Mail) FindMany ¶
func (dao *Mail) FindMany(ctx context.Context, filterFunc MailFilterFunc, optionsFunc ...MailFindManyOptionsFunc) ([]*modelpkg.Mail, error)
FindMany executes a find command and returns many models the matching documents in the collection.
func (*Mail) FindOne ¶
func (dao *Mail) FindOne(ctx context.Context, filterFunc MailFilterFunc, optionsFunc ...MailFindOneOptionsFunc) (*modelpkg.Mail, error)
FindOne executes a find command and returns a model for one document in the collection.
func (*Mail) FindOneByID ¶
func (dao *Mail) FindOneByID(ctx context.Context, id string, optionsFunc ...MailFindOneOptionsFunc) (*modelpkg.Mail, error)
FindOneByID executes a find command and returns a model for one document in the collection.
func (*Mail) InsertMany ¶
func (dao *Mail) InsertMany(ctx context.Context, models []*modelpkg.Mail, optionsFunc ...MailInsertManyOptionsFunc) (*mongo.InsertManyResult, error)
InsertMany executes an insert command to insert multiple documents into the collection.
func (*Mail) InsertOne ¶
func (dao *Mail) InsertOne(ctx context.Context, model *modelpkg.Mail, optionsFunc ...MailInsertOneOptionsFunc) (*mongo.InsertOneResult, error)
InsertOne executes an insert command to insert a single document into the collection.
func (*Mail) UpdateMany ¶
func (dao *Mail) UpdateMany(ctx context.Context, filterFunc MailFilterFunc, updateFunc MailUpdateFunc, optionsFunc ...MailUpdateOptionsFunc) (*mongo.UpdateResult, error)
UpdateMany executes an update command to update documents in the collection.
func (*Mail) UpdateOne ¶
func (dao *Mail) UpdateOne(ctx context.Context, filterFunc MailFilterFunc, updateFunc MailUpdateFunc, optionsFunc ...MailUpdateOptionsFunc) (*mongo.UpdateResult, error)
UpdateOne executes an update command to update at most one document in the collection.
func (*Mail) UpdateOneByID ¶
func (dao *Mail) UpdateOneByID(ctx context.Context, id string, updateFunc MailUpdateFunc, optionsFunc ...MailUpdateOptionsFunc) (*mongo.UpdateResult, error)
UpdateOneByID executes an update command to update at most one document in the collection.
type MailAggregateOptionsFunc ¶
type MailAggregateOptionsFunc func(cols *MailColumns) *options.AggregateOptions
type MailColumns ¶
type MailCountOptionsFunc ¶
type MailCountOptionsFunc func(cols *MailColumns) *options.CountOptions
type MailDeleteOptionsFunc ¶
type MailDeleteOptionsFunc func(cols *MailColumns) *options.DeleteOptions
type MailFilterFunc ¶
type MailFilterFunc func(cols *MailColumns) interface{}
type MailFindManyOptionsFunc ¶
type MailFindManyOptionsFunc func(cols *MailColumns) *options.FindOptions
type MailFindOneOptionsFunc ¶
type MailFindOneOptionsFunc func(cols *MailColumns) *options.FindOneOptions
type MailInsertManyOptionsFunc ¶
type MailInsertManyOptionsFunc func(cols *MailColumns) *options.InsertManyOptions
type MailInsertOneOptionsFunc ¶
type MailInsertOneOptionsFunc func(cols *MailColumns) *options.InsertOneOptions
type MailPipelineFunc ¶
type MailPipelineFunc func(cols *MailColumns) interface{}
type MailUpdateFunc ¶
type MailUpdateFunc func(cols *MailColumns) interface{}
type MailUpdateOptionsFunc ¶
type MailUpdateOptionsFunc func(cols *MailColumns) *options.UpdateOptions
type User ¶
type User struct { Columns *UserColumns Database *mongo.Database Collection *mongo.Collection }
func (*User) Aggregate ¶
func (dao *User) Aggregate(ctx context.Context, pipelineFunc UserPipelineFunc, optionsFunc ...UserAggregateOptionsFunc) (*mongo.Cursor, error)
Aggregate executes an aggregate command against the collection and returns a cursor over the resulting documents.
func (*User) Count ¶
func (dao *User) Count(ctx context.Context, filterFunc UserFilterFunc, optionsFunc ...UserCountOptionsFunc) (int64, error)
Count returns the number of documents in the collection.
func (*User) DeleteMany ¶
func (dao *User) DeleteMany(ctx context.Context, filterFunc UserFilterFunc, optionsFunc ...UserDeleteOptionsFunc) (*mongo.DeleteResult, error)
DeleteMany executes a delete command to delete documents from the collection.
func (*User) DeleteOne ¶
func (dao *User) DeleteOne(ctx context.Context, filterFunc UserFilterFunc, optionsFunc ...UserDeleteOptionsFunc) (*mongo.DeleteResult, error)
DeleteOne executes a delete command to delete at most one document from the collection.
func (*User) DeleteOneByID ¶
func (dao *User) DeleteOneByID(ctx context.Context, id string, optionsFunc ...UserDeleteOptionsFunc) (*mongo.DeleteResult, error)
DeleteOneByID executes a delete command to delete at most one document from the collection.
func (*User) FindMany ¶
func (dao *User) FindMany(ctx context.Context, filterFunc UserFilterFunc, optionsFunc ...UserFindManyOptionsFunc) ([]*modelpkg.User, error)
FindMany executes a find command and returns many models the matching documents in the collection.
func (*User) FindOne ¶
func (dao *User) FindOne(ctx context.Context, filterFunc UserFilterFunc, optionsFunc ...UserFindOneOptionsFunc) (*modelpkg.User, error)
FindOne executes a find command and returns a model for one document in the collection.
func (*User) FindOneByID ¶
func (dao *User) FindOneByID(ctx context.Context, id string, optionsFunc ...UserFindOneOptionsFunc) (*modelpkg.User, error)
FindOneByID executes a find command and returns a model for one document in the collection.
func (*User) InsertMany ¶
func (dao *User) InsertMany(ctx context.Context, models []*modelpkg.User, optionsFunc ...UserInsertManyOptionsFunc) (*mongo.InsertManyResult, error)
InsertMany executes an insert command to insert multiple documents into the collection.
func (*User) InsertOne ¶
func (dao *User) InsertOne(ctx context.Context, model *modelpkg.User, optionsFunc ...UserInsertOneOptionsFunc) (*mongo.InsertOneResult, error)
InsertOne executes an insert command to insert a single document into the collection.
func (*User) UpdateMany ¶
func (dao *User) UpdateMany(ctx context.Context, filterFunc UserFilterFunc, updateFunc UserUpdateFunc, optionsFunc ...UserUpdateOptionsFunc) (*mongo.UpdateResult, error)
UpdateMany executes an update command to update documents in the collection.
func (*User) UpdateOne ¶
func (dao *User) UpdateOne(ctx context.Context, filterFunc UserFilterFunc, updateFunc UserUpdateFunc, optionsFunc ...UserUpdateOptionsFunc) (*mongo.UpdateResult, error)
UpdateOne executes an update command to update at most one document in the collection.
func (*User) UpdateOneByID ¶
func (dao *User) UpdateOneByID(ctx context.Context, id string, updateFunc UserUpdateFunc, optionsFunc ...UserUpdateOptionsFunc) (*mongo.UpdateResult, error)
UpdateOneByID executes an update command to update at most one document in the collection.
type UserAggregateOptionsFunc ¶
type UserAggregateOptionsFunc func(cols *UserColumns) *options.AggregateOptions
type UserColumns ¶
type UserColumns struct { ID string UID string // 用户ID Account string // 用户账号 Password string // 用户密码 Salt string // 密码 Mobile string // 用户手机 Email string // 用户邮箱 Nickname string // 用户昵称 Signature string // 用户签名 Gender string // 用户性别 Level string // 用户等级 Experience string // 用户经验 Coin string // 用户金币 Type string // 用户类型 Status string // 用户状态 DeviceID string // 设备ID ThirdPlatforms string // 第三方平台 RegisterIP string // 注册IP RegisterTime string // 注册时间 LastLoginIP string // 最近登录IP LastLoginTime string // 最近登录时间 }
type UserCountOptionsFunc ¶
type UserCountOptionsFunc func(cols *UserColumns) *options.CountOptions
type UserDeleteOptionsFunc ¶
type UserDeleteOptionsFunc func(cols *UserColumns) *options.DeleteOptions
type UserFilterFunc ¶
type UserFilterFunc func(cols *UserColumns) interface{}
type UserFindManyOptionsFunc ¶
type UserFindManyOptionsFunc func(cols *UserColumns) *options.FindOptions
type UserFindOneOptionsFunc ¶
type UserFindOneOptionsFunc func(cols *UserColumns) *options.FindOneOptions
type UserInsertManyOptionsFunc ¶
type UserInsertManyOptionsFunc func(cols *UserColumns) *options.InsertManyOptions
type UserInsertOneOptionsFunc ¶
type UserInsertOneOptionsFunc func(cols *UserColumns) *options.InsertOneOptions
type UserPipelineFunc ¶
type UserPipelineFunc func(cols *UserColumns) interface{}
type UserUpdateFunc ¶
type UserUpdateFunc func(cols *UserColumns) interface{}
type UserUpdateOptionsFunc ¶
type UserUpdateOptionsFunc func(cols *UserColumns) *options.UpdateOptions