image

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2023 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

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 (m *MongoMapper) CountImage(ctx context.Context, catId string) (int64, error)

func (*MongoMapper) Delete

func (m *MongoMapper) Delete(ctx context.Context, id string) error

func (*MongoMapper) FindOne

func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Image, error)

func (*MongoMapper) Insert

func (m *MongoMapper) Insert(ctx context.Context, data *Image) error

func (*MongoMapper) InsertMany

func (m *MongoMapper) InsertMany(ctx context.Context, image []*Image) error

func (*MongoMapper) ListImage

func (m *MongoMapper) ListImage(ctx context.Context, catId string, lastId *string, limit, offset int64, backward bool) ([]*Image, error)

func (*MongoMapper) Update

func (m *MongoMapper) Update(ctx context.Context, data *Image) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL