stationfood

package
v0.0.0-...-9a5c20e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 5 Imported by: 1

README

stationfood

import "github.com/blueprint-uservices/blueprint/examples/train_ticket/workflow/stationfood"

package stationfood implements ts-station-food-service from the original Train Ticket application

Index

type StationFoodService

StationFoodService manages food stores across all stations

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
}

type StationFoodServiceImpl

Implementation of StationFoodService

type StationFoodServiceImpl struct {
    // contains filtered or unexported fields
}

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)

type StationFoodStore

type StationFoodStore struct {
    ID           string
    StationName  string
    StoreName    string
    Telephone    string
    BusinessTime string
    DeliveryFee  float64
    Foods        []food.Food
}

Generated by gomarkdoc

Documentation

Overview

package stationfood implements ts-station-food-service from the original Train Ticket application

Index

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)

type StationFoodStore

type StationFoodStore struct {
	ID           string
	StationName  string
	StoreName    string
	Telephone    string
	BusinessTime string
	DeliveryFee  float64
	Foods        []food.Food
}

Jump to

Keyboard shortcuts

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