usecases

package
v0.0.0-...-adb56df Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DownloadUseCase

type DownloadUseCase interface {
	LoadPhotoFile(ctx context.Context, fileID int) (entities.StorageFileData, *entities.PhotoFile, error)
}

func NewDownloadUseCase

func NewDownloadUseCase(
	photoAdapter infrastructures.PhotoAdapter,
	photoStorageAdapter infrastructures.PhotoStorageAdapter,
) DownloadUseCase

type OauthUseCase

type OauthUseCase interface {
	CreateSpecialOauthClient(ctx context.Context, clientID, name, clientSecret string) error
	CreateOauthClient(ctx context.Context, client *entities.OauthClient) (*entities.OauthClient, string, error)
	GetOauthClientRedirectURLs(ctx context.Context, oauthClientID string) ([]*entities.OAuthClientRedirectURL, error)
	AuthClientSecret(ctx context.Context, clientID, clientSecret string) (*entities.OauthClient, error)
	ValidateToAuthorizeUser(ctx context.Context, clientID, redirectURL string) (*entities.OauthClient, error)
	Authorize(ctx context.Context, userID, password, clientID, redirectURL string) (string, error)
	Oauth2ClientCredential(ctx context.Context, client *entities.OauthClient) (*entities.Oauth2ClientCredential, error)
	Oauth2AuthorizationCode(ctx context.Context, client *entities.OauthClient, code, redirectURL string, now time.Time) (*entities.Oauth2AuthorizationCode, error)
	Oauth2RefreshToken(ctx context.Context, client *entities.OauthClient, refreshToken string) (*entities.Oauth2AuthorizationCode, error)
	AuthAccessToken(ctx context.Context, accessToken string) (*entities.OauthSession, *entities.OauthClient, error)
}

func NewOauthUseCase

func NewOauthUseCase(
	authService services.OAuthService,
	userService services.UserService,
) OauthUseCase

type PhotoImportUseCase

type PhotoImportUseCase interface {
	GenerateUploadURL(ctx context.Context, userID string, now time.Time) (*entities.PhotoUploadSign, error)
	UploadPhoto(ctx context.Context, signToken, fileName string, body []byte) error
	IndexingPhotos(ctx context.Context, rootPath string, extensions []string, fast bool) error
	ExecuteBatch(ctx context.Context, fast bool) error
}

func NewPhotoImportUseCase

func NewPhotoImportUseCase(
	photoService services.PhotoService,
	imageProcessService services.ImageProcessService,
	photoAdapter infrastructures.PhotoAdapter,
	storage infrastructures.PhotoStorageAdapter,
	searchAdapter infrastructures.SearchAdapter,
	userAdapter infrastructures.UserAdapter,
) PhotoImportUseCase

type PhotoUseCase

type PhotoUseCase interface {
	GetPhotoMetaByPhotoID(ctx context.Context, photoID int) (entities.PhotoMeta, error)
	GetPhotoFileByPhotoFileID(ctx context.Context, photoFileID int) (*entities.PhotoFile, error)
	GetPhotoFilesByPhotoID(ctx context.Context, photoID int) (entities.PhotoFileList, error)
}

func NewPhotoUseCase

func NewPhotoUseCase(photoAdapter infrastructures.PhotoAdapter) PhotoUseCase

type SearchUseCase

type SearchUseCase interface {
	AppendAllPhotoDocuments(ctx context.Context) error
	SearchPhotoByPhotoID(ctx context.Context, id int) (*entities.PhotoSearchResultItem, error)
	SearchPhotos(ctx context.Context, id, year, month, date *int, limit, offset int) (*entities.PhotoSearchResult, error)
	AggregateDateTimeOriginal(ctx context.Context, year, month int) (entities.PhotoDateTimeAggregation, error)
}

func NewSearchUseCase

func NewSearchUseCase(
	searchAdapter infrastructures.SearchAdapter,
	photoAdapter infrastructures.PhotoAdapter,
) SearchUseCase

type UserUseCase

type UserUseCase interface {
	ValidateToCreateUser(ctx context.Context, userID, name string, password string) error
	CreateUser(ctx context.Context, userID, name string, password string, now time.Time) (*entities.User, error)
	UpdateUserProfile(ctx context.Context, userID, name string) (*entities.User, error)
	GetUser(ctx context.Context, userID string) (*entities.User, error)
	GetUsers(ctx context.Context, userID *string, limit, offset int) (entities.UserList, int, error)
	ExistUser(ctx context.Context, userID string) (bool, error)
	GetUserPassword(ctx context.Context, userID string) (*entities.UserPassword, error)
	Login(ctx context.Context, client *entities.OauthClient, userID, password string, now time.Time) (*entities.Oauth2AuthorizationCode, error)
}

func NewUserUseCase

func NewUserUseCase(
	userAdapter infrastructures.UserAdapter,
	userService services.UserService,
	authService services.OAuthService,
	passwordService services.PasswordService,
) UserUseCase

Jump to

Keyboard shortcuts

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