Documentation ¶
Index ¶
- type CounterRepository
- type KeyGenService
- type KeyGenService_Expecter
- type KeyGenService_GenerateKey_Call
- func (_c *KeyGenService_GenerateKey_Call) Return(_a0 string, _a1 error) *KeyGenService_GenerateKey_Call
- func (_c *KeyGenService_GenerateKey_Call) Run(run func(ctx context.Context)) *KeyGenService_GenerateKey_Call
- func (_c *KeyGenService_GenerateKey_Call) RunAndReturn(run func(context.Context) (string, error)) *KeyGenService_GenerateKey_Call
- type ShortenerService
- type ShortenerService_Expecter
- type ShortenerService_GetLongURL_Call
- func (_c *ShortenerService_GetLongURL_Call) Return(_a0 string, _a1 error) *ShortenerService_GetLongURL_Call
- func (_c *ShortenerService_GetLongURL_Call) Run(run func(ctx context.Context, key string)) *ShortenerService_GetLongURL_Call
- func (_c *ShortenerService_GetLongURL_Call) RunAndReturn(run func(context.Context, string) (string, error)) *ShortenerService_GetLongURL_Call
- type ShortenerService_Shorten_Call
- func (_c *ShortenerService_Shorten_Call) Return(_a0 string, _a1 error) *ShortenerService_Shorten_Call
- func (_c *ShortenerService_Shorten_Call) Run(run func(ctx context.Context, url string)) *ShortenerService_Shorten_Call
- func (_c *ShortenerService_Shorten_Call) RunAndReturn(run func(context.Context, string) (string, error)) *ShortenerService_Shorten_Call
- type URLRepository
- func (_m *URLRepository) EXPECT() *URLRepository_Expecter
- func (_m *URLRepository) GetKeyByLong(ctx context.Context, longURL string) (string, error)
- func (_m *URLRepository) GetLongByKey(ctx context.Context, key string) (string, error)
- func (_m *URLRepository) Save(ctx context.Context, url models.URL) error
- type URLRepository_Expecter
- func (_e *URLRepository_Expecter) GetKeyByLong(ctx interface{}, longURL interface{}) *URLRepository_GetKeyByLong_Call
- func (_e *URLRepository_Expecter) GetLongByKey(ctx interface{}, key interface{}) *URLRepository_GetLongByKey_Call
- func (_e *URLRepository_Expecter) Save(ctx interface{}, url interface{}) *URLRepository_Save_Call
- type URLRepository_GetKeyByLong_Call
- func (_c *URLRepository_GetKeyByLong_Call) Return(_a0 string, _a1 error) *URLRepository_GetKeyByLong_Call
- func (_c *URLRepository_GetKeyByLong_Call) Run(run func(ctx context.Context, longURL string)) *URLRepository_GetKeyByLong_Call
- func (_c *URLRepository_GetKeyByLong_Call) RunAndReturn(run func(context.Context, string) (string, error)) *URLRepository_GetKeyByLong_Call
- type URLRepository_GetLongByKey_Call
- func (_c *URLRepository_GetLongByKey_Call) Return(_a0 string, _a1 error) *URLRepository_GetLongByKey_Call
- func (_c *URLRepository_GetLongByKey_Call) Run(run func(ctx context.Context, key string)) *URLRepository_GetLongByKey_Call
- func (_c *URLRepository_GetLongByKey_Call) RunAndReturn(run func(context.Context, string) (string, error)) *URLRepository_GetLongByKey_Call
- type URLRepository_Save_Call
- func (_c *URLRepository_Save_Call) Return(_a0 error) *URLRepository_Save_Call
- func (_c *URLRepository_Save_Call) Run(run func(ctx context.Context, url models.URL)) *URLRepository_Save_Call
- func (_c *URLRepository_Save_Call) RunAndReturn(run func(context.Context, models.URL) error) *URLRepository_Save_Call
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CounterRepository ¶
type CounterRepository struct {
Count int64
}
func NewCounterRepository ¶
func NewCounterRepository() *CounterRepository
func (*CounterRepository) GetCounter ¶
func (c *CounterRepository) GetCounter(ctx context.Context) (int64, error)
type KeyGenService ¶
KeyGenService is an autogenerated mock type for the KeyGenService type
func NewKeyGenService ¶
func NewKeyGenService(t interface { mock.TestingT Cleanup(func()) }) *KeyGenService
NewKeyGenService creates a new instance of KeyGenService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*KeyGenService) EXPECT ¶
func (_m *KeyGenService) EXPECT() *KeyGenService_Expecter
func (*KeyGenService) GenerateKey ¶
func (_m *KeyGenService) GenerateKey(ctx context.Context) (string, error)
GenerateKey provides a mock function with given fields: ctx
type KeyGenService_Expecter ¶
type KeyGenService_Expecter struct {
// contains filtered or unexported fields
}
func (*KeyGenService_Expecter) GenerateKey ¶
func (_e *KeyGenService_Expecter) GenerateKey(ctx interface{}) *KeyGenService_GenerateKey_Call
GenerateKey is a helper method to define mock.On call
- ctx context.Context
type KeyGenService_GenerateKey_Call ¶
KeyGenService_GenerateKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GenerateKey'
func (*KeyGenService_GenerateKey_Call) Return ¶
func (_c *KeyGenService_GenerateKey_Call) Return(_a0 string, _a1 error) *KeyGenService_GenerateKey_Call
func (*KeyGenService_GenerateKey_Call) Run ¶
func (_c *KeyGenService_GenerateKey_Call) Run(run func(ctx context.Context)) *KeyGenService_GenerateKey_Call
func (*KeyGenService_GenerateKey_Call) RunAndReturn ¶
func (_c *KeyGenService_GenerateKey_Call) RunAndReturn(run func(context.Context) (string, error)) *KeyGenService_GenerateKey_Call
type ShortenerService ¶
ShortenerService is an autogenerated mock type for the ShortenerService type
func NewShortenerService ¶
func NewShortenerService(t interface { mock.TestingT Cleanup(func()) }) *ShortenerService
NewShortenerService creates a new instance of ShortenerService. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*ShortenerService) EXPECT ¶
func (_m *ShortenerService) EXPECT() *ShortenerService_Expecter
func (*ShortenerService) GetLongURL ¶
GetLongURL provides a mock function with given fields: ctx, key
type ShortenerService_Expecter ¶
type ShortenerService_Expecter struct {
// contains filtered or unexported fields
}
func (*ShortenerService_Expecter) GetLongURL ¶
func (_e *ShortenerService_Expecter) GetLongURL(ctx interface{}, key interface{}) *ShortenerService_GetLongURL_Call
GetLongURL is a helper method to define mock.On call
- ctx context.Context
- key string
func (*ShortenerService_Expecter) Shorten ¶
func (_e *ShortenerService_Expecter) Shorten(ctx interface{}, url interface{}) *ShortenerService_Shorten_Call
Shorten is a helper method to define mock.On call
- ctx context.Context
- url string
type ShortenerService_GetLongURL_Call ¶
ShortenerService_GetLongURL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLongURL'
func (*ShortenerService_GetLongURL_Call) Return ¶
func (_c *ShortenerService_GetLongURL_Call) Return(_a0 string, _a1 error) *ShortenerService_GetLongURL_Call
func (*ShortenerService_GetLongURL_Call) Run ¶
func (_c *ShortenerService_GetLongURL_Call) Run(run func(ctx context.Context, key string)) *ShortenerService_GetLongURL_Call
func (*ShortenerService_GetLongURL_Call) RunAndReturn ¶
func (_c *ShortenerService_GetLongURL_Call) RunAndReturn(run func(context.Context, string) (string, error)) *ShortenerService_GetLongURL_Call
type ShortenerService_Shorten_Call ¶
ShortenerService_Shorten_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Shorten'
func (*ShortenerService_Shorten_Call) Return ¶
func (_c *ShortenerService_Shorten_Call) Return(_a0 string, _a1 error) *ShortenerService_Shorten_Call
func (*ShortenerService_Shorten_Call) Run ¶
func (_c *ShortenerService_Shorten_Call) Run(run func(ctx context.Context, url string)) *ShortenerService_Shorten_Call
func (*ShortenerService_Shorten_Call) RunAndReturn ¶
func (_c *ShortenerService_Shorten_Call) RunAndReturn(run func(context.Context, string) (string, error)) *ShortenerService_Shorten_Call
type URLRepository ¶
URLRepository is an autogenerated mock type for the URLRepository type
func NewURLRepository ¶
func NewURLRepository(t interface { mock.TestingT Cleanup(func()) }) *URLRepository
NewURLRepository creates a new instance of URLRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*URLRepository) EXPECT ¶
func (_m *URLRepository) EXPECT() *URLRepository_Expecter
func (*URLRepository) GetKeyByLong ¶
GetKeyByLong provides a mock function with given fields: ctx, longURL
func (*URLRepository) GetLongByKey ¶
GetLongByKey provides a mock function with given fields: ctx, key
type URLRepository_Expecter ¶
type URLRepository_Expecter struct {
// contains filtered or unexported fields
}
func (*URLRepository_Expecter) GetKeyByLong ¶
func (_e *URLRepository_Expecter) GetKeyByLong(ctx interface{}, longURL interface{}) *URLRepository_GetKeyByLong_Call
GetKeyByLong is a helper method to define mock.On call
- ctx context.Context
- longURL string
func (*URLRepository_Expecter) GetLongByKey ¶
func (_e *URLRepository_Expecter) GetLongByKey(ctx interface{}, key interface{}) *URLRepository_GetLongByKey_Call
GetLongByKey is a helper method to define mock.On call
- ctx context.Context
- key string
func (*URLRepository_Expecter) Save ¶
func (_e *URLRepository_Expecter) Save(ctx interface{}, url interface{}) *URLRepository_Save_Call
Save is a helper method to define mock.On call
- ctx context.Context
- url models.URL
type URLRepository_GetKeyByLong_Call ¶
URLRepository_GetKeyByLong_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetKeyByLong'
func (*URLRepository_GetKeyByLong_Call) Return ¶
func (_c *URLRepository_GetKeyByLong_Call) Return(_a0 string, _a1 error) *URLRepository_GetKeyByLong_Call
func (*URLRepository_GetKeyByLong_Call) Run ¶
func (_c *URLRepository_GetKeyByLong_Call) Run(run func(ctx context.Context, longURL string)) *URLRepository_GetKeyByLong_Call
func (*URLRepository_GetKeyByLong_Call) RunAndReturn ¶
func (_c *URLRepository_GetKeyByLong_Call) RunAndReturn(run func(context.Context, string) (string, error)) *URLRepository_GetKeyByLong_Call
type URLRepository_GetLongByKey_Call ¶
URLRepository_GetLongByKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetLongByKey'
func (*URLRepository_GetLongByKey_Call) Return ¶
func (_c *URLRepository_GetLongByKey_Call) Return(_a0 string, _a1 error) *URLRepository_GetLongByKey_Call
func (*URLRepository_GetLongByKey_Call) Run ¶
func (_c *URLRepository_GetLongByKey_Call) Run(run func(ctx context.Context, key string)) *URLRepository_GetLongByKey_Call
func (*URLRepository_GetLongByKey_Call) RunAndReturn ¶
func (_c *URLRepository_GetLongByKey_Call) RunAndReturn(run func(context.Context, string) (string, error)) *URLRepository_GetLongByKey_Call
type URLRepository_Save_Call ¶
URLRepository_Save_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Save'
func (*URLRepository_Save_Call) Return ¶
func (_c *URLRepository_Save_Call) Return(_a0 error) *URLRepository_Save_Call
func (*URLRepository_Save_Call) Run ¶
func (_c *URLRepository_Save_Call) Run(run func(ctx context.Context, url models.URL)) *URLRepository_Save_Call
func (*URLRepository_Save_Call) RunAndReturn ¶
func (_c *URLRepository_Save_Call) RunAndReturn(run func(context.Context, models.URL) error) *URLRepository_Save_Call