Documentation ¶
Index ¶
- Constants
- func NewMongoImageRepository(client *mongo.Client, logger echo.Logger) image_repository.ImageRepository
- type ImageDocument
- type ImageDocuments
- type MongoImageRepository
- func (r *MongoImageRepository) CreateImage(ctx context.Context, image image_model.Image) error
- func (*MongoImageRepository) DeleteImage(ctx context.Context, id uuid.UUID) error
- func (r *MongoImageRepository) GetImage(ctx context.Context, id uuid.UUID) (image_model.Image, error)
- func (*MongoImageRepository) SearchImages(ctx context.Context) (image_model.Images, error)
Constants ¶
View Source
const MongoImageCollection = "images"
Variables ¶
This section is empty.
Functions ¶
func NewMongoImageRepository ¶
func NewMongoImageRepository(client *mongo.Client, logger echo.Logger) image_repository.ImageRepository
Types ¶
type ImageDocument ¶
type ImageDocument struct { ID string `bson:"_id"` Name string `bson:"name"` Alt string `bson:"alt"` URL string `bson:"url"` }
func NewImageDocument ¶
func NewImageDocument(image image_model.Image) ImageDocument
func (ImageDocument) ToEntity ¶
func (doc ImageDocument) ToEntity() image_model.Image
type ImageDocuments ¶
type ImageDocuments []ImageDocument
func NewImageDocuments ¶
func NewImageDocuments(images image_model.Images) ImageDocuments
func (ImageDocuments) ToEntities ¶
func (docs ImageDocuments) ToEntities() image_model.Images
type MongoImageRepository ¶
type MongoImageRepository struct {
// contains filtered or unexported fields
}
func (*MongoImageRepository) CreateImage ¶
func (r *MongoImageRepository) CreateImage(ctx context.Context, image image_model.Image) error
func (*MongoImageRepository) DeleteImage ¶
func (*MongoImageRepository) GetImage ¶
func (r *MongoImageRepository) GetImage(ctx context.Context, id uuid.UUID) (image_model.Image, error)
func (*MongoImageRepository) SearchImages ¶
func (*MongoImageRepository) SearchImages(ctx context.Context) (image_model.Images, error)
Click to show internal directories.
Click to hide internal directories.