notifier

package
v1.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package notifier is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fetcher added in v1.2.0

type Fetcher interface {
	GetChassisFromJSON() (map[string]string, error)
	GetRegionsFromJSON() (map[string]string, error)
	GetCarsFromJSON() (map[string][]string, error)
}

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

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

func (s *Service) GetCarBrandsList() []string

GetCarBrandsList retrieves the list of car brands.

func (*Service) GetCarChassisList added in v1.1.0

func (s *Service) GetCarChassisList() map[string]string

GetCarChassisList retrieves the list of car body types.

func (*Service) GetCarModelsList added in v1.1.0

func (s *Service) GetCarModelsList(brand string) ([]string, bool)

GetCarModelsList retrieves the list of car models for a given brand.

func (*Service) GetRegionsList

func (s *Service) GetRegionsList() map[string]string

GetRegionsList retrieves the list of regions.

func (*Service) RemoveAllSubscriptionsByUserID

func (s *Service) RemoveAllSubscriptionsByUserID(ctx context.Context, userID int64) error

RemoveAllSubscriptionsByUserID removes all subscriptions and associated listings for a given user.

func (*Service) RemoveSubscriptionByID

func (s *Service) RemoveSubscriptionByID(ctx context.Context, id string) error

RemoveSubscriptionByID removes subscription and associated listings for a given subscription id.

func (*Service) Start added in v1.2.0

func (s *Service) Start() error

Start begins the notification process.

func (*Service) UpsertUser

func (s *Service) UpsertUser(ctx context.Context, user ds.UserRequest) (ds.UserResponse, error)

UpsertUser creates or updates a user.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL