Documentation
¶
Overview ¶
Package notifier is a generated GoMock package.
Index ¶
- type Fetcher
- type MockFetcher
- type MockFetcherMockRecorder
- type MockRepository
- func (m *MockRepository) CreateSubscription(ctx context.Context, sub ds.SubscriptionRequest) (ds.SubscriptionResponse, error)
- func (m *MockRepository) DeleteListingsBySubscriptionIDs(ctx context.Context, ids []string) error
- func (m *MockRepository) DeleteSubscriptionByID(ctx context.Context, id string) error
- func (m *MockRepository) DeleteSubscriptionsByUserID(ctx context.Context, userID int64) error
- func (m *MockRepository) DeleteUserByID(ctx context.Context, id int64) error
- func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
- func (m *MockRepository) GetSubscriptionsByUserID(ctx context.Context, userID int64) ([]ds.SubscriptionResponse, error)
- func (m *MockRepository) UpsertUser(ctx context.Context, request ds.UserRequest) (ds.UserResponse, error)
- type MockRepositoryMockRecorder
- func (mr *MockRepositoryMockRecorder) CreateSubscription(ctx, sub any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) DeleteListingsBySubscriptionIDs(ctx, ids any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) DeleteSubscriptionByID(ctx, id any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) DeleteSubscriptionsByUserID(ctx, userID any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) DeleteUserByID(ctx, id any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) GetSubscriptionsByUserID(ctx, userID any) *gomock.Call
- func (mr *MockRepositoryMockRecorder) UpsertUser(ctx, request any) *gomock.Call
- type Repository
- type Service
- func (s *Service) CreateSubscription(ctx context.Context, subscription ds.SubscriptionRequest) (ds.SubscriptionResponse, error)
- func (s *Service) GetAllSubscriptionsByUserID(ctx context.Context, userID int64) ([]ds.SubscriptionResponse, error)
- func (s *Service) GetCarBrandsList() []string
- func (s *Service) GetCarChassisList() map[string]string
- func (s *Service) GetCarModelsList(brand string) ([]string, bool)
- func (s *Service) GetRegionsList() map[string]string
- func (s *Service) RemoveAllSubscriptionsByUserID(ctx context.Context, userID int64) error
- func (s *Service) RemoveSubscriptionByID(ctx context.Context, id string) error
- func (s *Service) Start() error
- func (s *Service) UpsertUser(ctx context.Context, user ds.UserRequest) (ds.UserResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockFetcher ¶ added in v1.2.0
type MockFetcher struct {
// contains filtered or unexported fields
}
MockFetcher is a mock of Fetcher interface.
func NewMockFetcher ¶ added in v1.2.0
func NewMockFetcher(ctrl *gomock.Controller) *MockFetcher
NewMockFetcher creates a new mock instance.
func (*MockFetcher) EXPECT ¶ added in v1.2.0
func (m *MockFetcher) EXPECT() *MockFetcherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockFetcher) GetCarsFromJSON ¶ added in v1.2.0
func (m *MockFetcher) GetCarsFromJSON() (map[string][]string, error)
GetCarsFromJSON mocks base method.
func (*MockFetcher) GetChassisFromJSON ¶ added in v1.2.0
func (m *MockFetcher) GetChassisFromJSON() (map[string]string, error)
GetChassisFromJSON mocks base method.
func (*MockFetcher) GetRegionsFromJSON ¶ added in v1.2.0
func (m *MockFetcher) GetRegionsFromJSON() (map[string]string, error)
GetRegionsFromJSON mocks base method.
type MockFetcherMockRecorder ¶ added in v1.2.0
type MockFetcherMockRecorder struct {
// contains filtered or unexported fields
}
MockFetcherMockRecorder is the mock recorder for MockFetcher.
func (*MockFetcherMockRecorder) GetCarsFromJSON ¶ added in v1.2.0
func (mr *MockFetcherMockRecorder) GetCarsFromJSON() *gomock.Call
GetCarsFromJSON indicates an expected call of GetCarsFromJSON.
func (*MockFetcherMockRecorder) GetChassisFromJSON ¶ added in v1.2.0
func (mr *MockFetcherMockRecorder) GetChassisFromJSON() *gomock.Call
GetChassisFromJSON indicates an expected call of GetChassisFromJSON.
func (*MockFetcherMockRecorder) GetRegionsFromJSON ¶ added in v1.2.0
func (mr *MockFetcherMockRecorder) GetRegionsFromJSON() *gomock.Call
GetRegionsFromJSON indicates an expected call of GetRegionsFromJSON.
type MockRepository ¶
type MockRepository struct {
// contains filtered or unexported fields
}
MockRepository is a mock of Repository interface.
func NewMockRepository ¶
func NewMockRepository(ctrl *gomock.Controller) *MockRepository
NewMockRepository creates a new mock instance.
func (*MockRepository) CreateSubscription ¶
func (m *MockRepository) CreateSubscription(ctx context.Context, sub ds.SubscriptionRequest) (ds.SubscriptionResponse, error)
CreateSubscription mocks base method.
func (*MockRepository) DeleteListingsBySubscriptionIDs ¶
func (m *MockRepository) DeleteListingsBySubscriptionIDs(ctx context.Context, ids []string) error
DeleteListingsBySubscriptionIDs mocks base method.
func (*MockRepository) DeleteSubscriptionByID ¶
func (m *MockRepository) DeleteSubscriptionByID(ctx context.Context, id string) error
DeleteSubscriptionByID mocks base method.
func (*MockRepository) DeleteSubscriptionsByUserID ¶
func (m *MockRepository) DeleteSubscriptionsByUserID(ctx context.Context, userID int64) error
DeleteSubscriptionsByUserID mocks base method.
func (*MockRepository) DeleteUserByID ¶
func (m *MockRepository) DeleteUserByID(ctx context.Context, id int64) error
DeleteUserByID mocks base method.
func (*MockRepository) EXPECT ¶
func (m *MockRepository) EXPECT() *MockRepositoryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRepository) GetSubscriptionsByUserID ¶
func (m *MockRepository) GetSubscriptionsByUserID(ctx context.Context, userID int64) ([]ds.SubscriptionResponse, error)
GetSubscriptionsByUserID mocks base method.
func (*MockRepository) UpsertUser ¶
func (m *MockRepository) UpsertUser(ctx context.Context, request ds.UserRequest) (ds.UserResponse, error)
UpsertUser mocks base method.
type MockRepositoryMockRecorder ¶
type MockRepositoryMockRecorder struct {
// contains filtered or unexported fields
}
MockRepositoryMockRecorder is the mock recorder for MockRepository.
func (*MockRepositoryMockRecorder) CreateSubscription ¶
func (mr *MockRepositoryMockRecorder) CreateSubscription(ctx, sub any) *gomock.Call
CreateSubscription indicates an expected call of CreateSubscription.
func (*MockRepositoryMockRecorder) DeleteListingsBySubscriptionIDs ¶
func (mr *MockRepositoryMockRecorder) DeleteListingsBySubscriptionIDs(ctx, ids any) *gomock.Call
DeleteListingsBySubscriptionIDs indicates an expected call of DeleteListingsBySubscriptionIDs.
func (*MockRepositoryMockRecorder) DeleteSubscriptionByID ¶
func (mr *MockRepositoryMockRecorder) DeleteSubscriptionByID(ctx, id any) *gomock.Call
DeleteSubscriptionByID indicates an expected call of DeleteSubscriptionByID.
func (*MockRepositoryMockRecorder) DeleteSubscriptionsByUserID ¶
func (mr *MockRepositoryMockRecorder) DeleteSubscriptionsByUserID(ctx, userID any) *gomock.Call
DeleteSubscriptionsByUserID indicates an expected call of DeleteSubscriptionsByUserID.
func (*MockRepositoryMockRecorder) DeleteUserByID ¶
func (mr *MockRepositoryMockRecorder) DeleteUserByID(ctx, id any) *gomock.Call
DeleteUserByID indicates an expected call of DeleteUserByID.
func (*MockRepositoryMockRecorder) GetSubscriptionsByUserID ¶
func (mr *MockRepositoryMockRecorder) GetSubscriptionsByUserID(ctx, userID any) *gomock.Call
GetSubscriptionsByUserID indicates an expected call of GetSubscriptionsByUserID.
func (*MockRepositoryMockRecorder) UpsertUser ¶
func (mr *MockRepositoryMockRecorder) UpsertUser(ctx, request any) *gomock.Call
UpsertUser indicates an expected call of UpsertUser.
type Repository ¶
type Repository interface { UpsertUser(ctx context.Context, request ds.UserRequest) (ds.UserResponse, error) CreateSubscription(ctx context.Context, sub ds.SubscriptionRequest) (ds.SubscriptionResponse, error) GetSubscriptionsByUserID(ctx context.Context, userID int64) ([]ds.SubscriptionResponse, error) DeleteListingsBySubscriptionIDs(ctx context.Context, ids []string) error DeleteSubscriptionsByUserID(ctx context.Context, userID int64) error DeleteUserByID(ctx context.Context, id int64) error DeleteSubscriptionByID(ctx context.Context, id string) error }
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service represents the notification service.
func NewService ¶
func NewService(l *logger.Logger, repo Repository, fetcher Fetcher) *Service
NewService creates a new instance of the notification service.
func (*Service) CreateSubscription ¶
func (s *Service) CreateSubscription( ctx context.Context, subscription ds.SubscriptionRequest, ) (ds.SubscriptionResponse, error)
CreateSubscription creates a new subscription.
func (*Service) GetAllSubscriptionsByUserID ¶
func (s *Service) GetAllSubscriptionsByUserID(ctx context.Context, userID int64) ([]ds.SubscriptionResponse, error)
GetAllSubscriptionsByUserID retrieves all subscriptions for a given user.
func (*Service) GetCarBrandsList ¶ added in v1.1.0
GetCarBrandsList retrieves the list of car brands.
func (*Service) GetCarChassisList ¶ added in v1.1.0
GetCarChassisList retrieves the list of car body types.
func (*Service) GetCarModelsList ¶ added in v1.1.0
GetCarModelsList retrieves the list of car models for a given brand.
func (*Service) GetRegionsList ¶
GetRegionsList retrieves the list of regions.
func (*Service) RemoveAllSubscriptionsByUserID ¶
RemoveAllSubscriptionsByUserID removes all subscriptions and associated listings for a given user.
func (*Service) RemoveSubscriptionByID ¶
RemoveSubscriptionByID removes subscription and associated listings for a given subscription id.
func (*Service) UpsertUser ¶
func (s *Service) UpsertUser(ctx context.Context, user ds.UserRequest) (ds.UserResponse, error)
UpsertUser creates or updates a user.