Documentation ¶
Index ¶
- func NewImageRepository(db *gorm.DB) file.Repository
- type ImageRepository
- func (i *ImageRepository) AddImage(image *file.Image) error
- func (i *ImageRepository) DeleteImagesByName(names []string) ([]file.Location, error)
- func (i *ImageRepository) GetNewestImages(pagi *file.Pagination) ([]file.Location, error)
- func (i *ImageRepository) GetOldestImages(pagi *file.Pagination) ([]file.Location, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewImageRepository ¶
func NewImageRepository(db *gorm.DB) file.Repository
NewImageRepository instantiates a new database repo for image to use
Types ¶
type ImageRepository ¶
type ImageRepository struct {
// contains filtered or unexported fields
}
ImageRepository implements image database interface
func (*ImageRepository) AddImage ¶
func (i *ImageRepository) AddImage(image *file.Image) error
AddImage creates new item in the database
func (*ImageRepository) DeleteImagesByName ¶
func (i *ImageRepository) DeleteImagesByName(names []string) ([]file.Location, error)
DeleteImagesByName by a list of names []string
func (*ImageRepository) GetNewestImages ¶
func (i *ImageRepository) GetNewestImages(pagi *file.Pagination) ([]file.Location, error)
GetNewestImages retrieves images by latest added to the database in ascending order by id
func (*ImageRepository) GetOldestImages ¶
func (i *ImageRepository) GetOldestImages(pagi *file.Pagination) ([]file.Location, error)
GetOldestImages retrieves images by oldest added to the database in descending order by id
Click to show internal directories.
Click to hide internal directories.