Documentation ¶
Overview ¶
package station implements ts-station-service from the original TrainTicket application
Index ¶
- type Station
- type StationService
- type StationServiceImpl
- func (s *StationServiceImpl) CreateStation(ctx context.Context, station Station) error
- func (s *StationServiceImpl) DeleteStation(ctx context.Context, id string) error
- func (s *StationServiceImpl) Exists(ctx context.Context, name string) (bool, error)
- func (s *StationServiceImpl) FindByID(ctx context.Context, id string) (Station, error)
- func (s *StationServiceImpl) FindByIDs(ctx context.Context, ids []string) ([]Station, error)
- func (s *StationServiceImpl) FindID(ctx context.Context, name string) (string, error)
- func (s *StationServiceImpl) FindIDs(ctx context.Context, names []string) ([]string, error)
- func (s *StationServiceImpl) UpdateStation(ctx context.Context, station Station) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StationService ¶
type StationService interface { // Creates a new station CreateStation(ctx context.Context, station Station) error // Check if a station exists Exists(ctx context.Context, name string) (bool, error) // Updates an existing station UpdateStation(ctx context.Context, station Station) (bool, error) // Deletes an existing station based on `id` DeleteStation(ctx context.Context, id string) error // Find a station based on `id` FindByID(ctx context.Context, id string) (Station, error) // Find all stations based on `ids` FindByIDs(ctx context.Context, ids []string) ([]Station, error) // Find the station `id` for the station with Name `name` FindID(ctx context.Context, name string) (string, error) // Find the station `ids` for stations with Names `names` FindIDs(ctx context.Context, names []string) ([]string, error) }
StationService manages all stations
type StationServiceImpl ¶
type StationServiceImpl struct {
// contains filtered or unexported fields
}
Implementation of the StationService
func NewStationServiceImpl ¶
func NewStationServiceImpl(ctx context.Context, db backend.NoSQLDatabase) (*StationServiceImpl, error)
Returns a new StationService object
func (*StationServiceImpl) CreateStation ¶
func (s *StationServiceImpl) CreateStation(ctx context.Context, station Station) error
func (*StationServiceImpl) DeleteStation ¶
func (s *StationServiceImpl) DeleteStation(ctx context.Context, id string) error
func (*StationServiceImpl) UpdateStation ¶
Click to show internal directories.
Click to hide internal directories.