Documentation ¶
Index ¶
- Constants
- type Fish
- type IMongoMapper
- type MongoMapper
- func (m *MongoMapper) Add(ctx context.Context, id string, add int64) error
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Fish, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *Fish) error
- func (m *MongoMapper) StartClient(ctx context.Context) (*mongo.Client, error)
- func (m *MongoMapper) Update(ctx context.Context, data *Fish) error
Constants ¶
View Source
const CollectionName = "fish"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fish ¶
type Fish struct { UserId primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` FishNum int64 `bson:"fishNum,omitempty" json:"fishNum,omitempty"` }
type IMongoMapper ¶
type IMongoMapper interface { Insert(ctx context.Context, data *Fish) error FindOne(ctx context.Context, id string) (*Fish, error) Update(ctx context.Context, data *Fish) error Delete(ctx context.Context, id string) error Add(ctx context.Context, id string, add int64) error StartClient(ctx context.Context) (*mongo.Client, error) }
func NewMongoMapper ¶
func NewMongoMapper(config *config.Config) IMongoMapper
type MongoMapper ¶
type MongoMapper struct {
// contains filtered or unexported fields
}
func (*MongoMapper) StartClient ¶ added in v1.2.8
Click to show internal directories.
Click to hide internal directories.