Documentation ¶
Index ¶
- Variables
- type Coordinate
- type DeliveryMethod
- type Item
- type Order
- type OrderStatus
- type Participant
- type ParticipantStatus
- type Venue
- type WoltServer
- func (ws *WoltServer) AddParticipant(orderID string, name string) (string, error)
- func (ws *WoltServer) AddParticipantItem(orderID, participantID string, itemAmount int) error
- func (ws *WoltServer) Addr() string
- func (ws *WoltServer) ChangeParticipantStatus(orderID, participantID string, status ParticipantStatus) error
- func (ws *WoltServer) CreateOrder(host, venueID string, location Coordinate) (shortID, ID string)
- func (ws *WoltServer) CreateVenue(location Coordinate) string
- func (ws *WoltServer) GetOrder(orderID string) (*Order, error)
- func (ws *WoltServer) GetVenue(venueID string) (*Venue, error)
- func (ws *WoltServer) RegisterEndpoint(pattern string, handler http.HandlerFunc)
- func (ws *WoltServer) Start()
- func (ws *WoltServer) Stop()
- func (ws *WoltServer) UpdateOrderStatus(orderID string, status OrderStatus) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoSuchOrder = fmt.Errorf("no such order. Make sure you created an order first")
View Source
var ErrNoSuchParticipant = fmt.Errorf("no such participant. Make sure you created a participant in that order fist")
View Source
var ErrNoSuchVenue = fmt.Errorf("no such venue. Make sure you created a venue fist")
Functions ¶
This section is empty.
Types ¶
type Coordinate ¶
type DeliveryMethod ¶
type DeliveryMethod string
const ( DeliveryMethodHome DeliveryMethod = "homedelivery" DeliveryMethodTakeaways DeliveryMethod = "takeaway" )
type Order ¶
type Order struct { ID string ShortID string VenueID string Host string Status OrderStatus Location Coordinate DeliveryMethod DeliveryMethod Participants []*Participant // contains filtered or unexported fields }
func (*Order) AddParticipant ¶
func (o *Order) AddParticipant(name string) *Participant
func (*Order) ParticipantByID ¶
func (o *Order) ParticipantByID(id string) (*Participant, bool)
type OrderStatus ¶
type OrderStatus string
const ( StatusActive OrderStatus = "active" StatusCanceled OrderStatus = "cancelled" StatusPendingTrans OrderStatus = "pending_transaction" StatusPurchased OrderStatus = "purchased" )
type Participant ¶
type Participant struct { FirstName string ID string Status ParticipantStatus Items []Item // contains filtered or unexported fields }
func (*Participant) AddItem ¶
func (p *Participant) AddItem(amount int)
type ParticipantStatus ¶
type ParticipantStatus string
const ( ParticipantStatusReady ParticipantStatus = "ready" ParticipantStatusJoined ParticipantStatus = "joined" )
type Venue ¶
type Venue struct { ID string Location Coordinate }
type WoltServer ¶
type WoltServer struct {
// contains filtered or unexported fields
}
func NewWoltServer ¶
func NewWoltServer(t *testing.T) *WoltServer
func (*WoltServer) AddParticipant ¶
func (ws *WoltServer) AddParticipant(orderID string, name string) (string, error)
func (*WoltServer) AddParticipantItem ¶
func (ws *WoltServer) AddParticipantItem(orderID, participantID string, itemAmount int) error
func (*WoltServer) Addr ¶
func (ws *WoltServer) Addr() string
func (*WoltServer) ChangeParticipantStatus ¶
func (ws *WoltServer) ChangeParticipantStatus(orderID, participantID string, status ParticipantStatus) error
func (*WoltServer) CreateOrder ¶
func (ws *WoltServer) CreateOrder(host, venueID string, location Coordinate) (shortID, ID string)
func (*WoltServer) CreateVenue ¶
func (ws *WoltServer) CreateVenue(location Coordinate) string
func (*WoltServer) RegisterEndpoint ¶
func (ws *WoltServer) RegisterEndpoint(pattern string, handler http.HandlerFunc)
func (*WoltServer) Start ¶
func (ws *WoltServer) Start()
func (*WoltServer) Stop ¶
func (ws *WoltServer) Stop()
func (*WoltServer) UpdateOrderStatus ¶
func (ws *WoltServer) UpdateOrderStatus(orderID string, status OrderStatus) error
Click to show internal directories.
Click to hide internal directories.