Documentation ¶
Index ¶
- type ElasticSearchRepository
- type ExifRepository
- type OAuthClientRedirectURLRepository
- type OAuthClientRepository
- type OauthAccessTokenRepository
- type OauthCodeRepository
- type PhotoFileRepository
- type PhotoRepository
- type PhotoStorageRepository
- type PhotoThumbnailRepository
- type PhotoUploadSignRepository
- type UserAuthRepository
- type UserPasswordRepository
- type UserRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ElasticSearchRepository ¶
type ElasticSearchRepository interface { InsertPhoto(ctx context.Context, photo *models.PhotoIndex) error BulkInsertPhotos(ctx context.Context, photos []*models.PhotoIndex) (*esutil.BulkIndexerStats, error) SearchPhotos(ctx context.Context, query *filters.PhotoSearchQuery) (*models.PhotoResult, error) AggregateByDateTimeOriginalYear(ctx context.Context) ([]*models.PhotoDateHistogram, error) AggregateByDateTimeOriginalYearMonth(ctx context.Context, year int) ([]*models.PhotoDateHistogram, error) AggregateByDateTimeOriginalYearMonthDate(ctx context.Context, year, month int) ([]*models.PhotoDateHistogram, error) }
func NewElasticSearchRepository ¶
func NewElasticSearchRepository(searchClient es.Search, newBulkIndexerFunc func() esutil.BulkIndexer) ElasticSearchRepository
type ExifRepository ¶
type ExifRepository interface { GetPhotoMetaDataByPhotoID(ctx context.Context, photoID int) (dbmodels.ExifSlice, error) GetPhotoMetaItemByTagID(ctx context.Context, photoID, tagID int) (*dbmodels.Exif, error) GetPhotoMetaItemsByPhotoIDsTagID(ctx context.Context, photoIDs []int, tagID int) (dbmodels.ExifSlice, error) InsertPhotoMetaItem(ctx context.Context, exif *dbmodels.Exif) (*dbmodels.Exif, error) UpdatePhotoMetaItem(ctx context.Context, exif *dbmodels.Exif) (*dbmodels.Exif, error) }
func NewExifRepository ¶
func NewExifRepository(db mysql.SQLExecutor) ExifRepository
type OAuthClientRedirectURLRepository ¶
type OAuthClientRedirectURLRepository interface { GetOAuthClientRedirectURLsByOAuthClientID(ctx context.Context, oauthClientID string) ([]*dbmodels.OauthClientRedirectURL, error) CreateOAuthClientRedirectURL(ctx context.Context, url *entities.OAuthClientRedirectURL) (*dbmodels.OauthClientRedirectURL, error) }
func NewOauthClientRedirectURLRepository ¶
func NewOauthClientRedirectURLRepository(db mysql.SQLExecutor) OAuthClientRedirectURLRepository
type OAuthClientRepository ¶
type OAuthClientRepository interface { GetByOauthClientID(ctx context.Context, id string) (*dbmodels.OauthClient, error) ExistOauthClient(ctx context.Context, id string) (bool, error) CreateOAuthClient(ctx context.Context, client *dbmodels.OauthClient, redirectURLs []*dbmodels.OauthClientRedirectURL) (*dbmodels.OauthClient, []*dbmodels.OauthClientRedirectURL, error) }
func NewOAuthClientRepository ¶
func NewOAuthClientRepository(db mysql.SQLExecutor) OAuthClientRepository
type OauthAccessTokenRepository ¶
type OauthAccessTokenRepository interface { SetAccessToken(ctx context.Context, oauthAccessToken *models.OauthAccessToken, accessToken string, expireIn int64) error GetSession(ctx context.Context, accessToken string) (*entities.OauthSession, error) }
func NewOauthAccessTokenRepository ¶
func NewOauthAccessTokenRepository(db redis.Driver) OauthAccessTokenRepository
type OauthCodeRepository ¶
type OauthCodeRepository interface { SetCode(ctx context.Context, code string, m *models.OauthCode) error GetCode(ctx context.Context, code string) (*models.OauthCode, error) }
func NewOauthCodeRepository ¶
func NewOauthCodeRepository(db redis.Driver) OauthCodeRepository
type PhotoFileRepository ¶
type PhotoFileRepository interface { GetPhotoFileByPhotoFileID(ctx context.Context, photoFileID int) (*dbmodels.PhotoFile, error) GetPhotoFilesByPhotoID(ctx context.Context, photoID int) ([]*dbmodels.PhotoFile, error) GetPhotoFilesByPhotoIDs(ctx context.Context, photoIDs []int) ([]*dbmodels.PhotoFile, error) InsertPhotoFile(ctx context.Context, photoFile *dbmodels.PhotoFile) (*dbmodels.PhotoFile, error) UpdatePhotoFile(ctx context.Context, photoFile *dbmodels.PhotoFile) (*dbmodels.PhotoFile, error) GetPhotoFileByFilePath(ctx context.Context, filePath string) (*dbmodels.PhotoFile, error) ExistPhotoFileByFilePath(ctx context.Context, filePath string) (bool, error) }
func NewPhotoFileRepository ¶
func NewPhotoFileRepository(db mysql.SQLExecutor) PhotoFileRepository
type PhotoRepository ¶
type PhotoRepository interface { GetPhoto(ctx context.Context, photoID int) (*dbmodels.Photo, error) GetPhotos(ctx context.Context, limit, offset int) ([]*dbmodels.Photo, error) CountPhotos(ctx context.Context) (int, error) GetPhotoByFilePath(ctx context.Context, fileHash string) (*dbmodels.Photo, error) InsertPhoto(ctx context.Context, photo *dbmodels.Photo) (*dbmodels.Photo, error) UpdatePhoto(ctx context.Context, photo *dbmodels.Photo) (*dbmodels.Photo, error) }
func NewPhotoRepository ¶
func NewPhotoRepository(db mysql.SQLExecutor) PhotoRepository
type PhotoStorageRepository ¶
type PhotoStorageRepository interface { SaveContent(userID, fileName string, dateTimeOriginal time.Time, data []byte) (os.FileInfo, string, error) ReadDir(dirPath string) ([]os.FileInfo, error) LoadContent(path string) ([]byte, error) ParsePhotoMetaFromFile(path string) ([]models.IfdEntry, error) CreateUserDir(userID string) error }
func NewPhotoStorageRepository ¶
func NewPhotoStorageRepository(driver storage.Driver) PhotoStorageRepository
type PhotoThumbnailRepository ¶
type PhotoThumbnailRepository interface { SavePreview(ctx context.Context, photoID int, data []byte) error SaveThumbnail(ctx context.Context, photoID int, data []byte) error }
func NewPhotoThumbnailRepository ¶
func NewPhotoThumbnailRepository(fileDriver storage.Driver, db mysql.SQLExecutor) PhotoThumbnailRepository
type PhotoUploadSignRepository ¶
type PhotoUploadSignRepository interface { GetSign(ctx context.Context, token string) (*models.PhotoUploadSign, error) SetSignToken(ctx context.Context, token, userID string, expireIn int64) error }
func NewPhotoUploadSignRepository ¶
func NewPhotoUploadSignRepository(db redis.Driver) PhotoUploadSignRepository
type UserAuthRepository ¶
type UserAuthRepository interface { UpsertUserAuth(ctx context.Context, m *dbmodels.UserAuth, refreshTokenRaw string) (*dbmodels.UserAuth, error) GetUserAuth(ctx context.Context, userID, clientID string) (*dbmodels.UserAuth, error) GetUserAuthByRefreshToken(ctx context.Context, refreshToken string) (*dbmodels.UserAuth, error) DeleteUserAuth(ctx context.Context, userID, clientID string) error DeleteClientAllAuth(ctx context.Context, clientID string) error }
func NewUserAuthRepository ¶
func NewUserAuthRepository(db mysql.SQLExecutor) UserAuthRepository
type UserPasswordRepository ¶
type UserPasswordRepository interface {
GetUserPassword(ctx context.Context, userID string) (*dbmodels.UserPassword, error)
}
func NewUserPasswordRepository ¶
func NewUserPasswordRepository(db mysql.SQLExecutor) UserPasswordRepository
type UserRepository ¶
type UserRepository interface { GetUser(ctx context.Context, userID string) (*dbmodels.User, error) GetUsers(ctx context.Context, filter *filters.UserFilter, limit, offset int) ([]*dbmodels.User, error) CountUsers(ctx context.Context, filter *filters.UserFilter) (int, error) ExistUser(ctx context.Context, userID string) (bool, error) CreateUser(ctx context.Context, user *dbmodels.User, password *dbmodels.UserPassword) (*dbmodels.User, error) UpdateUserProfile(ctx context.Context, user *dbmodels.User) (*dbmodels.User, error) }
func NewUserRepository ¶
func NewUserRepository(db mysql.SQLExecutor) UserRepository
Source Files ¶
- elasticsearch_repository.go
- exif_repository.go
- oauth_access_token_repository.go
- oauth_client_redirect_url_repository.go
- oauth_client_repository.go
- oauth_code_repository.go
- photo_file_repository.go
- photo_repository.go
- photo_storage_repository.go
- photo_thumbnail_repository.go
- photo_upload_sign_repository.go
- repository.go
- user_auth_repository.go
- user_password_repository.go
- user_repository.go
Click to show internal directories.
Click to hide internal directories.