mysql

package
v0.0.0-...-081779a Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

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

Jump to

Keyboard shortcuts

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