Documentation ¶
Index ¶
- Constants
- type IMongoMapper
- type Image
- type MongoMapper
- func (m *MongoMapper) CountImage(ctx context.Context, catId string) (int64, error)
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Image, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *Image) error
- func (m *MongoMapper) InsertMany(ctx context.Context, image []*Image) error
- func (m *MongoMapper) ListImage(ctx context.Context, catId string, lastId *string, limit, offset int64, ...) ([]*Image, error)
- func (m *MongoMapper) Update(ctx context.Context, data *Image) error
Constants ¶
View Source
const CollectionName = "image"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMongoMapper ¶
type IMongoMapper interface { Insert(ctx context.Context, data *Image) error FindOne(ctx context.Context, id string) (*Image, error) Update(ctx context.Context, data *Image) error Delete(ctx context.Context, id string) error ListImage(ctx context.Context, catId string, lastId *string, limit, offset int64, backward bool) ([]*Image, error) InsertMany(ctx context.Context, image []*Image) error CountImage(ctx context.Context, catId string) (int64, error) }
func NewMongoMapper ¶
func NewMongoMapper(config *config.Config) IMongoMapper
type Image ¶
type Image struct { ID 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"` CatId string `bson:"catId,omitempty" json:"catId,omitempty"` ImageUrl string `bson:"imageUrl,omitempty" json:"imageUrl,omitempty"` }
type MongoMapper ¶
type MongoMapper struct {
// contains filtered or unexported fields
}
func (*MongoMapper) CountImage ¶
func (*MongoMapper) InsertMany ¶
func (m *MongoMapper) InsertMany(ctx context.Context, image []*Image) error
Click to show internal directories.
Click to hide internal directories.