Documentation ¶
Overview ¶
Package usecase acts as a bridge between the repository and the business logic
Index ¶
- func New(repo interfaces.RepoInterface, algorithm string, cache *redis.Client) interfaces.UseCaseInterface
- type UseCase
- func (uc *UseCase) DeleteClient(name string) error
- func (uc *UseCase) GetClient(name string) (models.Client, error)
- func (uc *UseCase) RegisterClient(client models.Client) (models.Client, error)
- func (uc *UseCase) UpdateClient(updateClient models.Client) error
- func (uc *UseCase) VerifyLimit(name string) (*interfaces.Result, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(repo interfaces.RepoInterface, algorithm string, cache *redis.Client) interfaces.UseCaseInterface
New function instantiates a new usecase
Types ¶
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
UseCase struct
func (*UseCase) DeleteClient ¶
DeleteClient function deletes an existing client
func (*UseCase) RegisterClient ¶
RegisterClient function creates a new client which was supplied as the argument
func (*UseCase) UpdateClient ¶
UpdateClient function updates the client limits
func (*UseCase) VerifyLimit ¶
func (uc *UseCase) VerifyLimit(name string) (*interfaces.Result, error)
VerifyLimit functions validates the rate limit of the specified client
Click to show internal directories.
Click to hide internal directories.