usecase

package
v0.0.0-...-7fbc4b1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MAX_FILE_SIZE = 1024 * 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthUsecase

type AuthUsecase struct {
	// contains filtered or unexported fields
}

func NewAuthUsecase

func NewAuthUsecase(userStore repository.UserStore) *AuthUsecase

func (*AuthUsecase) AuthUser

func (u *AuthUsecase) AuthUser(ctx context.Context, email string, password string) (string, error)

type FileUsecase

type FileUsecase struct {
	// contains filtered or unexported fields
}

func NewFileUsecase

func NewFileUsecase(fileStore repository.FileStore, fileAccessStore repository.FileAccessStore, userStore repository.UserStore, s3Client *s3.Client) *FileUsecase

func (*FileUsecase) DownloadFile

func (u *FileUsecase) DownloadFile(ctx context.Context, hash string, secret string) (*s3.GetObjectOutput, string, error)

func (*FileUsecase) UploadFile

func (u *FileUsecase) UploadFile(ctx context.Context, secret string, multiPartFile *multipart.FileHeader) (string, error)

type JWTClaim

type JWTClaim struct {
	jwt.RegisteredClaims
	User JWTUser
}

type JWTUser

type JWTUser struct {
	ID        uint
	FirstName string
	LastName  string
	Email     string
	Role      uint
}

func GetContextUser

func GetContextUser(ctx context.Context) (*JWTUser, error)

type UserUsecase

type UserUsecase struct {
	// contains filtered or unexported fields
}

func NewUserUsecase

func NewUserUsecase(userStore repository.UserStore, fileStore repository.FileStore) *UserUsecase

func (*UserUsecase) CreateUser

func (u *UserUsecase) CreateUser(ctx context.Context, firstName string, lastName string, email string, password string) (*domain.User, error)

func (*UserUsecase) DeleteUserByID

func (u *UserUsecase) DeleteUserByID(ctx context.Context, id string) error

func (*UserUsecase) GetAllUsers

func (u *UserUsecase) GetAllUsers(ctx context.Context) ([]*domain.User, error)

func (*UserUsecase) GetUserByID

func (u *UserUsecase) GetUserByID(ctx context.Context, id string) (*domain.User, error)

Jump to

Keyboard shortcuts

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