Documentation ¶
Index ¶
- func New(repo repository.Repository, logger *zap.SugaredLogger) *useCaseURL
- type URLData
- type UseCase
- type UseCaseMock
- func (mmCreate *UseCaseMock) Create(ctx context.Context, fullURL *URLData) (up1 *URLData, err error)
- func (mmCreate *UseCaseMock) CreateAfterCounter() uint64
- func (mmCreate *UseCaseMock) CreateBeforeCounter() uint64
- func (mmGetStat *UseCaseMock) GetStat(ctx context.Context, id int) (up1 *URLData, err error)
- func (mmGetStat *UseCaseMock) GetStatAfterCounter() uint64
- func (mmGetStat *UseCaseMock) GetStatBeforeCounter() uint64
- func (m *UseCaseMock) MinimockCreateDone() bool
- func (m *UseCaseMock) MinimockCreateInspect()
- func (m *UseCaseMock) MinimockFinish()
- func (m *UseCaseMock) MinimockGetStatDone() bool
- func (m *UseCaseMock) MinimockGetStatInspect()
- func (m *UseCaseMock) MinimockRedirectDone() bool
- func (m *UseCaseMock) MinimockRedirectInspect()
- func (m *UseCaseMock) MinimockWait(timeout mm_time.Duration)
- func (mmRedirect *UseCaseMock) Redirect(ctx context.Context, token string) (up1 *URLData, err error)
- func (mmRedirect *UseCaseMock) RedirectAfterCounter() uint64
- func (mmRedirect *UseCaseMock) RedirectBeforeCounter() uint64
- type UseCaseMockCreateExpectation
- type UseCaseMockCreateParams
- type UseCaseMockCreateResults
- type UseCaseMockGetStatExpectation
- type UseCaseMockGetStatParams
- type UseCaseMockGetStatResults
- type UseCaseMockRedirectExpectation
- type UseCaseMockRedirectParams
- type UseCaseMockRedirectResults
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(repo repository.Repository, logger *zap.SugaredLogger) *useCaseURL
Types ¶
type UseCaseMock ¶
type UseCaseMock struct { CreateMock mUseCaseMockCreate GetStatMock mUseCaseMockGetStat RedirectMock mUseCaseMockRedirect // contains filtered or unexported fields }
UseCaseMock implements UseCase
func NewUseCaseMock ¶
func NewUseCaseMock(t minimock.Tester) *UseCaseMock
NewUseCaseMock returns a mock for UseCase
func (*UseCaseMock) Create ¶
func (mmCreate *UseCaseMock) Create(ctx context.Context, fullURL *URLData) (up1 *URLData, err error)
Create implements UseCase
func (*UseCaseMock) CreateAfterCounter ¶
func (mmCreate *UseCaseMock) CreateAfterCounter() uint64
CreateAfterCounter returns a count of finished UseCaseMock.Create invocations
func (*UseCaseMock) CreateBeforeCounter ¶
func (mmCreate *UseCaseMock) CreateBeforeCounter() uint64
CreateBeforeCounter returns a count of UseCaseMock.Create invocations
func (*UseCaseMock) GetStatAfterCounter ¶
func (mmGetStat *UseCaseMock) GetStatAfterCounter() uint64
GetStatAfterCounter returns a count of finished UseCaseMock.GetStat invocations
func (*UseCaseMock) GetStatBeforeCounter ¶
func (mmGetStat *UseCaseMock) GetStatBeforeCounter() uint64
GetStatBeforeCounter returns a count of UseCaseMock.GetStat invocations
func (*UseCaseMock) MinimockCreateDone ¶
func (m *UseCaseMock) MinimockCreateDone() bool
MinimockCreateDone returns true if the count of the Create invocations corresponds the number of defined expectations
func (*UseCaseMock) MinimockCreateInspect ¶
func (m *UseCaseMock) MinimockCreateInspect()
MinimockCreateInspect logs each unmet expectation
func (*UseCaseMock) MinimockFinish ¶
func (m *UseCaseMock) MinimockFinish()
MinimockFinish checks that all mocked methods have been called the expected number of times
func (*UseCaseMock) MinimockGetStatDone ¶
func (m *UseCaseMock) MinimockGetStatDone() bool
MinimockGetStatDone returns true if the count of the GetStat invocations corresponds the number of defined expectations
func (*UseCaseMock) MinimockGetStatInspect ¶
func (m *UseCaseMock) MinimockGetStatInspect()
MinimockGetStatInspect logs each unmet expectation
func (*UseCaseMock) MinimockRedirectDone ¶
func (m *UseCaseMock) MinimockRedirectDone() bool
MinimockRedirectDone returns true if the count of the Redirect invocations corresponds the number of defined expectations
func (*UseCaseMock) MinimockRedirectInspect ¶
func (m *UseCaseMock) MinimockRedirectInspect()
MinimockRedirectInspect logs each unmet expectation
func (*UseCaseMock) MinimockWait ¶
func (m *UseCaseMock) MinimockWait(timeout mm_time.Duration)
MinimockWait waits for all mocked methods to be called the expected number of times
func (*UseCaseMock) Redirect ¶
func (mmRedirect *UseCaseMock) Redirect(ctx context.Context, token string) (up1 *URLData, err error)
Redirect implements UseCase
func (*UseCaseMock) RedirectAfterCounter ¶
func (mmRedirect *UseCaseMock) RedirectAfterCounter() uint64
RedirectAfterCounter returns a count of finished UseCaseMock.Redirect invocations
func (*UseCaseMock) RedirectBeforeCounter ¶
func (mmRedirect *UseCaseMock) RedirectBeforeCounter() uint64
RedirectBeforeCounter returns a count of UseCaseMock.Redirect invocations
type UseCaseMockCreateExpectation ¶
type UseCaseMockCreateExpectation struct { Counter uint64 // contains filtered or unexported fields }
UseCaseMockCreateExpectation specifies expectation struct of the UseCase.Create
func (*UseCaseMockCreateExpectation) Then ¶
func (e *UseCaseMockCreateExpectation) Then(up1 *URLData, err error) *UseCaseMock
Then sets up UseCase.Create return parameters for the expectation previously defined by the When method
type UseCaseMockCreateParams ¶
type UseCaseMockCreateParams struct {
// contains filtered or unexported fields
}
UseCaseMockCreateParams contains parameters of the UseCase.Create
type UseCaseMockCreateResults ¶
type UseCaseMockCreateResults struct {
// contains filtered or unexported fields
}
UseCaseMockCreateResults contains results of the UseCase.Create
type UseCaseMockGetStatExpectation ¶
type UseCaseMockGetStatExpectation struct { Counter uint64 // contains filtered or unexported fields }
UseCaseMockGetStatExpectation specifies expectation struct of the UseCase.GetStat
func (*UseCaseMockGetStatExpectation) Then ¶
func (e *UseCaseMockGetStatExpectation) Then(up1 *URLData, err error) *UseCaseMock
Then sets up UseCase.GetStat return parameters for the expectation previously defined by the When method
type UseCaseMockGetStatParams ¶
type UseCaseMockGetStatParams struct {
// contains filtered or unexported fields
}
UseCaseMockGetStatParams contains parameters of the UseCase.GetStat
type UseCaseMockGetStatResults ¶
type UseCaseMockGetStatResults struct {
// contains filtered or unexported fields
}
UseCaseMockGetStatResults contains results of the UseCase.GetStat
type UseCaseMockRedirectExpectation ¶
type UseCaseMockRedirectExpectation struct { Counter uint64 // contains filtered or unexported fields }
UseCaseMockRedirectExpectation specifies expectation struct of the UseCase.Redirect
func (*UseCaseMockRedirectExpectation) Then ¶
func (e *UseCaseMockRedirectExpectation) Then(up1 *URLData, err error) *UseCaseMock
Then sets up UseCase.Redirect return parameters for the expectation previously defined by the When method
type UseCaseMockRedirectParams ¶
type UseCaseMockRedirectParams struct {
// contains filtered or unexported fields
}
UseCaseMockRedirectParams contains parameters of the UseCase.Redirect
type UseCaseMockRedirectResults ¶
type UseCaseMockRedirectResults struct {
// contains filtered or unexported fields
}
UseCaseMockRedirectResults contains results of the UseCase.Redirect