Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProduct ¶
func DeleteProduct ¶
func DeleteProduct(id string)
func UpdateProduct ¶
Types ¶
type Cart ¶
type Product ¶
type Product struct { ID primitive.ObjectID `json:"_id,omitempty" bson:"_id,omitempty"` Name string `json:"name" bson:"name"` Price float64 `json:"price" bson:"price"` Amount float64 `json:"amount" bson:"amount"` Description string `json:"description,omitempty" bson:"description"` }
func GetAllProducts ¶
func GetAllProducts() []Product
type Reservation ¶
type Reservation struct { // ID primitive.ObjectID `json:"_id,omitempty"` // TODO: change to ObjectID ??? ID string `json:"id,omitempty"` Dates []time.Time `json:"dates"` Timestamp time.Time `json:"timestamp,omitempty"` // TODO: get from http request? Email string `json:"email"` Items map[string]int `json:"items"` }
type ReservationManager ¶
type ReservationManager struct { ReservedItems map[time.Time]map[string]int Reservations map[string]Reservation }
func NewReservationManager ¶
func NewReservationManager() *ReservationManager
func (ReservationManager) CreateReservation ¶
func (rm ReservationManager) CreateReservation(r Reservation) bool
func (ReservationManager) DeleteReservation ¶
func (rm ReservationManager) DeleteReservation(id string)
Click to show internal directories.
Click to hide internal directories.