Documentation ¶
Index ¶
- type DBStore
- func (store *DBStore) AssignFaceToBox(boxID int, faceName string) (entity.Box, error)
- func (store *DBStore) ClassifyFaces() error
- func (store *DBStore) CreateJoke(jokeString string) error
- func (store *DBStore) CreatePhoto(filename string, uploadedFile *multipart.FileHeader, unixTime int64) error
- func (store *DBStore) CreatePhotoFromMobile(filename string, uploadedFile *multipart.FileHeader, ...) error
- func (store *DBStore) DeleteBox(box entity.Box) error
- func (store *DBStore) DeleteJoke(jokeID int) error
- func (store *DBStore) DeletePhoto(photoID int) error
- func (store *DBStore) GetFace(faceID int) (entity.Face, error)
- func (store *DBStore) GetFaces() ([]*entity.Face, error)
- func (store *DBStore) GetJokes() ([]*entity.Joke, error)
- func (store *DBStore) GetLabel(labelID int) (entity.Label, error)
- func (store *DBStore) GetLabels() ([]*entity.Label, error)
- func (store *DBStore) GetPhoto(photoID int) (entity.Photo, error)
- func (store *DBStore) GetPhotos() ([]*entity.Photo, error)
- func (store *DBStore) GetPhotosByMonth(offset int) ([]*MonthPhotoPair, error)
- func (store *DBStore) GetPhotosByMonthSlow() ([]*MonthPhotoPair, error)
- func (store *DBStore) GetUnassignedBoxes() ([]*entity.Box, error)
- func (store *DBStore) IsDuplicatePhoto(info map[string]interface{}) bool
- func (store *DBStore) LikeJoke(jokeID int) error
- func (store *DBStore) Search(query string) (SearchResult, error)
- type MonthPhotoPair
- type SearchResult
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DBStore ¶
DBStore implements the Store interface
func (*DBStore) AssignFaceToBox ¶
AssignFaceToBox takes a box and the name of a person and assigns that face to the box
func (*DBStore) ClassifyFaces ¶
ClassifyFaces runs the automatic face recognition engine
func (*DBStore) CreateJoke ¶
CreateJoke creates a joke in the database
func (*DBStore) CreatePhoto ¶
func (store *DBStore) CreatePhoto(filename string, uploadedFile *multipart.FileHeader, unixTime int64) error
CreatePhoto takes a filname to a newly updated photo and does:
- gets EXIF information
- labels the image using the tensorflow object detection package
- adds the entry to the database
func (*DBStore) CreatePhotoFromMobile ¶
func (store *DBStore) CreatePhotoFromMobile(filename string, uploadedFile *multipart.FileHeader, info map[string]interface{}) error
CreatePhotoFromMobile functions identically to CreatePhoto but uses EXIF data in the 'info' json object
func (*DBStore) DeleteBox ¶
DeleteBox deletes the box's photo and removes the entry from the database
func (*DBStore) DeleteJoke ¶
DeleteJoke deletes a specific joke by ID from the database
func (*DBStore) DeletePhoto ¶
DeletePhoto deletes a specific photo by ID
func (*DBStore) GetLabel ¶
GetLabel gets a specific labelID and returns information about the label and all photos tagged with that label
func (*DBStore) GetLabels ¶
GetLabels gets a list of all labels that contain a non-zero number of photos
func (*DBStore) GetPhotosByMonth ¶
func (store *DBStore) GetPhotosByMonth(offset int) ([]*MonthPhotoPair, error)
GetPhotosByMonth gets all photos and partitions them by (month, year) pairs
func (*DBStore) GetPhotosByMonthSlow ¶
func (store *DBStore) GetPhotosByMonthSlow() ([]*MonthPhotoPair, error)
GetPhotosByMonthSlow is an older implementation of GetPhotosByMonth that uses sorting
func (*DBStore) GetUnassignedBoxes ¶
GetUnassignedBoxes gets all boxes that are not assigned to a person
func (*DBStore) IsDuplicatePhoto ¶
IsDuplicatePhoto uses the metadata to determine if this photo is already stored
type MonthPhotoPair ¶
MonthPhotoPair represents the pair (month, photos taken on month)
type SearchResult ¶
SearchResult represents the pair (month, photos taken on month)
type Store ¶
type Store interface { CreateJoke(jokeString string) error DeleteJoke(jokeID int) error LikeJoke(jokeID int) error GetJokes() ([]*entity.Joke, error) CreatePhoto(filename string, uploadedFile *multipart.FileHeader, unixTime int64) error CreatePhotoFromMobile(filename string, uploadedFile *multipart.FileHeader, info map[string]interface{}) error GetPhoto(photoID int) (entity.Photo, error) DeletePhoto(photoID int) error GetPhotos() ([]*entity.Photo, error) GetPhotosByMonth(offset int) ([]*MonthPhotoPair, error) IsDuplicatePhoto(info map[string]interface{}) bool GetLabels() ([]*entity.Label, error) GetLabel(labelID int) (entity.Label, error) GetFaces() ([]*entity.Face, error) GetFace(faceID int) (entity.Face, error) ClassifyFaces() error GetUnassignedBoxes() ([]*entity.Box, error) DeleteBox(box entity.Box) error AssignFaceToBox(boxID int, faceName string) (entity.Box, error) Search(query string) (SearchResult, error) }
Store is an interface defining all methods to interact with the models:
- Joke
- Photo
- Label
- Face
- Box