Documentation ¶
Index ¶
- type App
- type CampgroundsApp
- func (a CampgroundsApp) CancelBooking(ctx context.Context, cmd command.CancelBooking) error
- func (a CampgroundsApp) CreateBooking(ctx context.Context, cmd command.CreateBooking) error
- func (a CampgroundsApp) CreateCampsite(ctx context.Context, cmd command.CreateCampsite) error
- func (a CampgroundsApp) GetBooking(ctx context.Context, qry query.GetBooking) (*domain.Booking, error)
- func (a CampgroundsApp) GetCampsites(ctx context.Context, qry query.GetCampsites) ([]*domain.Campsite, error)
- func (a CampgroundsApp) GetVacantDates(ctx context.Context, qry query.GetVacantDates) ([]string, error)
- func (a CampgroundsApp) UpdateBooking(ctx context.Context, cmd command.UpdateBooking) error
- type MockApp
- func (_m *MockApp) CancelBooking(ctx context.Context, cmd command.CancelBooking) error
- func (_m *MockApp) CreateBooking(ctx context.Context, cmd command.CreateBooking) error
- func (_m *MockApp) CreateCampsite(ctx context.Context, cmd command.CreateCampsite) error
- func (_m *MockApp) GetBooking(ctx context.Context, qry query.GetBooking) (*domain.Booking, error)
- func (_m *MockApp) GetCampsites(ctx context.Context, qry query.GetCampsites) ([]*domain.Campsite, error)
- func (_m *MockApp) GetVacantDates(ctx context.Context, qry query.GetVacantDates) ([]string, error)
- func (_m *MockApp) UpdateBooking(ctx context.Context, cmd command.UpdateBooking) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App interface { CreateCampsite(ctx context.Context, cmd command.CreateCampsite) error CreateBooking(ctx context.Context, cmd command.CreateBooking) error UpdateBooking(ctx context.Context, cmd command.UpdateBooking) error CancelBooking(ctx context.Context, cmd command.CancelBooking) error GetCampsites(ctx context.Context, qry query.GetCampsites) ([]*domain.Campsite, error) GetBooking(ctx context.Context, qry query.GetBooking) (*domain.Booking, error) GetVacantDates(ctx context.Context, qry query.GetVacantDates) ([]string, error) }
type CampgroundsApp ¶
type CampgroundsApp struct {
// contains filtered or unexported fields
}
func New ¶
func New(campsites domain.CampsiteRepository, bookings domain.BookingRepository) *CampgroundsApp
func (CampgroundsApp) CancelBooking ¶
func (a CampgroundsApp) CancelBooking(ctx context.Context, cmd command.CancelBooking) error
func (CampgroundsApp) CreateBooking ¶
func (a CampgroundsApp) CreateBooking(ctx context.Context, cmd command.CreateBooking) error
func (CampgroundsApp) CreateCampsite ¶
func (a CampgroundsApp) CreateCampsite(ctx context.Context, cmd command.CreateCampsite) error
func (CampgroundsApp) GetBooking ¶
func (a CampgroundsApp) GetBooking( ctx context.Context, qry query.GetBooking, ) (*domain.Booking, error)
func (CampgroundsApp) GetCampsites ¶
func (a CampgroundsApp) GetCampsites( ctx context.Context, qry query.GetCampsites, ) ([]*domain.Campsite, error)
func (CampgroundsApp) GetVacantDates ¶
func (a CampgroundsApp) GetVacantDates( ctx context.Context, qry query.GetVacantDates, ) ([]string, error)
func (CampgroundsApp) UpdateBooking ¶
func (a CampgroundsApp) UpdateBooking(ctx context.Context, cmd command.UpdateBooking) error
type MockApp ¶
MockApp is an autogenerated mock type for the App type
func NewMockApp ¶
NewMockApp creates a new instance of MockApp. 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 (*MockApp) CancelBooking ¶
CancelBooking provides a mock function with given fields: ctx, cmd
func (*MockApp) CreateBooking ¶
CreateBooking provides a mock function with given fields: ctx, cmd
func (*MockApp) CreateCampsite ¶
CreateCampsite provides a mock function with given fields: ctx, cmd
func (*MockApp) GetBooking ¶
GetBooking provides a mock function with given fields: ctx, qry
func (*MockApp) GetCampsites ¶
func (_m *MockApp) GetCampsites(ctx context.Context, qry query.GetCampsites) ([]*domain.Campsite, error)
GetCampsites provides a mock function with given fields: ctx, qry
func (*MockApp) GetVacantDates ¶
GetVacantDates provides a mock function with given fields: ctx, qry
func (*MockApp) UpdateBooking ¶
UpdateBooking provides a mock function with given fields: ctx, cmd