Documentation ¶
Overview ¶
Package shorturl is a generated GoMock package.
Index ¶
- func Handler(w http.ResponseWriter, r *http.Request, ctx config.AppContext)
- type CounterRepository
- type MockCounterRepository
- type MockCounterRepositoryMockRecorder
- type MockReadRepository
- type MockReadRepositoryMockRecorder
- type MockWriteRepository
- type MockWriteRepositoryMockRecorder
- type ReadRepository
- type RedirectIntent
- type RedirectService
- type Redirecter
- type RedisRepository
- type ShortIntent
- type Shortener
- type ShortenerService
- type WriteRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(w http.ResponseWriter, r *http.Request, ctx config.AppContext)
Types ¶
type CounterRepository ¶
type MockCounterRepository ¶
type MockCounterRepository struct {
// contains filtered or unexported fields
}
MockCounterRepository is a mock of CounterRepository interface.
func NewMockCounterRepository ¶
func NewMockCounterRepository(ctrl *gomock.Controller) *MockCounterRepository
NewMockCounterRepository creates a new mock instance.
func (*MockCounterRepository) EXPECT ¶
func (m *MockCounterRepository) EXPECT() *MockCounterRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockCounterRepository) NextPosition ¶
func (m *MockCounterRepository) NextPosition(ctx context.Context) (int64, error)
NextPosition mocks base method.
type MockCounterRepositoryMockRecorder ¶
type MockCounterRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockCounterRepositoryMockRecorder is the mock recorder for MockCounterRepository.
func (*MockCounterRepositoryMockRecorder) NextPosition ¶
func (mr *MockCounterRepositoryMockRecorder) NextPosition(ctx interface{}) *gomock.Call
NextPosition indicates an expected call of NextPosition.
type MockReadRepository ¶
type MockReadRepository struct {
// contains filtered or unexported fields
}
MockReadRepository is a mock of ReadRepository interface.
func NewMockReadRepository ¶
func NewMockReadRepository(ctrl *gomock.Controller) *MockReadRepository
NewMockReadRepository creates a new mock instance.
func (*MockReadRepository) EXPECT ¶
func (m *MockReadRepository) EXPECT() *MockReadRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockReadRepositoryMockRecorder ¶
type MockReadRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockReadRepositoryMockRecorder is the mock recorder for MockReadRepository.
func (*MockReadRepositoryMockRecorder) Find ¶
func (mr *MockReadRepositoryMockRecorder) Find(ctx, alias interface{}) *gomock.Call
Find indicates an expected call of Find.
type MockWriteRepository ¶
type MockWriteRepository struct {
// contains filtered or unexported fields
}
MockWriteRepository is a mock of WriteRepository interface.
func NewMockWriteRepository ¶
func NewMockWriteRepository(ctrl *gomock.Controller) *MockWriteRepository
NewMockWriteRepository creates a new mock instance.
func (*MockWriteRepository) Create ¶
func (m *MockWriteRepository) Create(ctx context.Context, url *url.URL, alias string) (string, error)
Create mocks base method.
func (*MockWriteRepository) EXPECT ¶
func (m *MockWriteRepository) EXPECT() *MockWriteRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockWriteRepositoryMockRecorder ¶
type MockWriteRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockWriteRepositoryMockRecorder is the mock recorder for MockWriteRepository.
func (*MockWriteRepositoryMockRecorder) Create ¶
func (mr *MockWriteRepositoryMockRecorder) Create(ctx, url, alias interface{}) *gomock.Call
Create indicates an expected call of Create.
type ReadRepository ¶
type RedirectIntent ¶
type RedirectIntent struct {
// contains filtered or unexported fields
}
type RedirectService ¶
type RedirectService struct {
ReadRepository
}
func (RedirectService) Run ¶
func (service RedirectService) Run(intent RedirectIntent) (string, error)
type Redirecter ¶
type Redirecter interface {
Run(intent ShortIntent) (string, error)
}
type RedisRepository ¶
type RedisRepository struct {
// contains filtered or unexported fields
}
func NewRedisRepository ¶
func NewRedisRepository(cfg config.RedisOptions) (RedisRepository, error)
func (RedisRepository) NextPosition ¶
func (repo RedisRepository) NextPosition(ctx context.Context) (int64, error)
type ShortIntent ¶
type ShortIntent struct {
// contains filtered or unexported fields
}
type Shortener ¶
type Shortener interface {
Run(intent ShortIntent) (string, error)
}
type ShortenerService ¶
type ShortenerService struct { CounterRepository WriteRepository }
func (ShortenerService) Run ¶
func (service ShortenerService) Run(intent ShortIntent) (string, error)