Documentation
¶
Overview ¶
package stationfood implements ts-station-food-service from the original Train Ticket application
Index ¶
- type StationFoodService
- type StationFoodServiceImpl
- func (s *StationFoodServiceImpl) Cleanup(ctx context.Context) error
- func (s *StationFoodServiceImpl) CreateFoodStore(ctx context.Context, store StationFoodStore) error
- func (s *StationFoodServiceImpl) GetFoodStoreByID(ctx context.Context, id string) (StationFoodStore, error)
- func (s *StationFoodServiceImpl) GetFoodStoresByStationNames(ctx context.Context, stations []string) ([]StationFoodStore, error)
- func (s *StationFoodServiceImpl) ListFoodStores(ctx context.Context) ([]StationFoodStore, error)
- func (s *StationFoodServiceImpl) ListFoodStoresByStationName(ctx context.Context, station string) ([]StationFoodStore, error)
- type StationFoodStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StationFoodService ¶
type StationFoodService interface { // Creates a new food store CreateFoodStore(ctx context.Context, store StationFoodStore) error // List all food stores ListFoodStores(ctx context.Context) ([]StationFoodStore, error) // List all food stores at a given `station` ListFoodStoresByStationName(ctx context.Context, station string) ([]StationFoodStore, error) // List all food stores at all `stations` GetFoodStoresByStationNames(ctx context.Context, stations []string) ([]StationFoodStore, error) // Find a food store given its `id` GetFoodStoreByID(ctx context.Context, id string) (StationFoodStore, error) // Removes all food stores; Only used in testing Cleanup(ctx context.Context) error }
StationFoodService manages food stores across all stations
type StationFoodServiceImpl ¶
type StationFoodServiceImpl struct {
// contains filtered or unexported fields
}
Implementation of StationFoodService
func NewStationFoodServiceImpl ¶
func NewStationFoodServiceImpl(ctx context.Context, db backend.NoSQLDatabase) (*StationFoodServiceImpl, error)
Creates and returns a new StationFoodService object
func (*StationFoodServiceImpl) Cleanup ¶
func (s *StationFoodServiceImpl) Cleanup(ctx context.Context) error
func (*StationFoodServiceImpl) CreateFoodStore ¶
func (s *StationFoodServiceImpl) CreateFoodStore(ctx context.Context, store StationFoodStore) error
func (*StationFoodServiceImpl) GetFoodStoreByID ¶
func (s *StationFoodServiceImpl) GetFoodStoreByID(ctx context.Context, id string) (StationFoodStore, error)
func (*StationFoodServiceImpl) GetFoodStoresByStationNames ¶
func (s *StationFoodServiceImpl) GetFoodStoresByStationNames(ctx context.Context, stations []string) ([]StationFoodStore, error)
func (*StationFoodServiceImpl) ListFoodStores ¶
func (s *StationFoodServiceImpl) ListFoodStores(ctx context.Context) ([]StationFoodStore, error)
func (*StationFoodServiceImpl) ListFoodStoresByStationName ¶
func (s *StationFoodServiceImpl) ListFoodStoresByStationName(ctx context.Context, station string) ([]StationFoodStore, error)
Click to show internal directories.
Click to hide internal directories.