Documentation ¶
Overview ¶
Package usecase implements application business logic. Each logic group in own file.
Index ¶
- Variables
- type Prove
- type ProveRepo
- type ProveUseCase
- func (uc *ProveUseCase) BalanceAdd(ctx context.Context, s *entity.Balance) error
- func (uc *ProveUseCase) CardListUserID(ctx context.Context, u *entity.User) (*entity.CardList, error)
- func (uc *ProveUseCase) FindBalance(ctx context.Context) (*entity.Balance, error)
- func (uc *ProveUseCase) GetAdmin(u *entity.User) bool
- func (uc *ProveUseCase) GetBalance(ctx context.Context, s *entity.SolutionData) (float64, error)
- func (uc *ProveUseCase) GetSolution(ctx context.Context, s *entity.SolutionData) error
- func (uc *ProveUseCase) GroupList(ctx context.Context) (*entity.GroupList, error)
- func (uc *ProveUseCase) ReadService() error
- func (uc *ProveUseCase) Register(ctx context.Context, auth *entity.Authentication) error
- func (uc *ProveUseCase) SaveCard(ctx context.Context, c *entity.Card) error
- func (uc *ProveUseCase) SaveGroup(ctx context.Context, c *entity.Group) error
- func (uc *ProveUseCase) SavePass(ctx context.Context, c *entity.Pass) error
- func (uc *ProveUseCase) SaveService() error
- func (uc *ProveUseCase) SaveSolution(ctx context.Context, c *entity.Solution) error
- func (uc *ProveUseCase) SaveTask(ctx context.Context, c *entity.Task) error
- func (uc *ProveUseCase) SaveText(ctx context.Context, c *entity.Text) error
- func (uc *ProveUseCase) ShortLink(ctx context.Context, ind *entity.Prove) (*entity.Prove, error)
- func (uc *ProveUseCase) TaskKey(ctx context.Context, u *entity.User, t *entity.Task) (*entity.Task, error)
- func (uc *ProveUseCase) TaskList(ctx context.Context) (*entity.TaskList, error)
- func (uc *ProveUseCase) UserFindByID(ctx context.Context, s string) (*entity.Authentication, error)
- func (uc *ProveUseCase) UserFindByLogin(ctx context.Context, s string) (*entity.Authentication, error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Prove ¶
type Prove interface { SaveSolution(context.Context, *entity.Solution) error SaveGroup(context.Context, *entity.Group) error GroupList(context.Context) (*entity.GroupList, error) SaveTask(context.Context, *entity.Task) error TaskList(context.Context) (*entity.TaskList, error) TaskKey(context.Context, *entity.User, *entity.Task) (*entity.Task, error) GetSolution(context.Context, *entity.SolutionData) error GetBalance(context.Context, *entity.SolutionData) (float64, error) FindBalance(ctx context.Context) (*entity.Balance, error) BalanceAdd(context.Context, *entity.Balance) error GetAdmin(*entity.User) bool SaveText(context.Context, *entity.Text) error SavePass(context.Context, *entity.Pass) error SaveCard(context.Context, *entity.Card) error CardListUserID(ctx context.Context, u *entity.User) (*entity.CardList, error) Register(context.Context, *entity.Authentication) error UserFindByLogin(context.Context, string) (*entity.Authentication, error) UserFindByID(context.Context, string) (*entity.Authentication, error) ShortLink(context.Context, *entity.Prove) (*entity.Prove, error) ReadService() error SaveService() error }
Prove -.
type ProveRepo ¶
type ProveRepo interface { SaveSolution(context.Context, *entity.Solution) error SaveGroup(context.Context, *entity.Group) error GroupList(context.Context) (*entity.GroupList, error) SaveTask(context.Context, *entity.Task) error TaskList(context.Context) (*entity.TaskList, error) TaskKey(context.Context, *entity.User, *entity.Task) (*entity.Task, error) GetSolution(context.Context, *entity.SolutionData) error GetBalance(context.Context, *entity.SolutionData) (float64, error) Balance(context.Context) (*entity.Balance, error) BalanceAdd(context.Context, *entity.Balance) error GetAdmin(*entity.User) bool SaveText(context.Context, *entity.Text) error SavePass(context.Context, *entity.Pass) error SaveCard(context.Context, *entity.Card) error CardListGetUserID(context.Context, *entity.User) (*entity.CardList, error) Registry(context.Context, *entity.Authentication) error GetByLogin(context.Context, string) (*entity.Authentication, error) GetByID(context.Context, string) (*entity.Authentication, error) Post(context.Context, *entity.Prove) error Put(context.Context, *entity.Prove) error Get(context.Context, *entity.Prove) (*entity.Prove, error) GetAll(context.Context, *entity.User) (*entity.User, error) GetAllUrls() (entity.CountURLs, error) GetAllUsers() (entity.CountUsers, error) Delete(context.Context, *entity.User) error Read() error Save() error }
ProveRepo -.
type ProveUseCase ¶
type ProveUseCase struct {
// contains filtered or unexported fields
}
ProveUseCase -.
func (*ProveUseCase) BalanceAdd ¶
BalanceAdd пополнить баланс
func (*ProveUseCase) CardListUserID ¶
func (uc *ProveUseCase) CardListUserID(ctx context.Context, u *entity.User) (*entity.CardList, error)
CardListUserID возвращает все сохранённые карты пользователя
func (*ProveUseCase) FindBalance ¶
FindBalance получение текущего баланса пользователя
func (*ProveUseCase) GetBalance ¶
func (uc *ProveUseCase) GetBalance(ctx context.Context, s *entity.SolutionData) (float64, error)
GetBalance получить информацию о кредитоспособности, если вернёт err!=nil - кредит исчерпан
func (*ProveUseCase) GetSolution ¶
func (uc *ProveUseCase) GetSolution(ctx context.Context, s *entity.SolutionData) error
GetSolution вернёт решение задачи
func (*ProveUseCase) ReadService ¶
func (uc *ProveUseCase) ReadService() error
func (*ProveUseCase) Register ¶
func (uc *ProveUseCase) Register(ctx context.Context, auth *entity.Authentication) error
func (*ProveUseCase) SaveService ¶
func (uc *ProveUseCase) SaveService() error
func (*ProveUseCase) SaveSolution ¶
func (*ProveUseCase) ShortLink ¶
ShortLink принимает короткий URL и возвращает длинный (GET /api/{key})
func (*ProveUseCase) TaskKey ¶
func (uc *ProveUseCase) TaskKey(ctx context.Context, u *entity.User, t *entity.Task) (*entity.Task, error)
TaskKey возвращает ответ по задаче
func (*ProveUseCase) UserFindByID ¶
func (uc *ProveUseCase) UserFindByID(ctx context.Context, s string) (*entity.Authentication, error)
func (*ProveUseCase) UserFindByLogin ¶
func (uc *ProveUseCase) UserFindByLogin(ctx context.Context, s string) (*entity.Authentication, error)
Click to show internal directories.
Click to hide internal directories.