Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBookingNotFound is used when a specific booking request is not found ErrBookingNotFound = errors.New("booking not found") )
Functions ¶
This section is empty.
Types ¶
type BookingStore ¶
type BookingStore struct {
// contains filtered or unexported fields
}
BookingStore is a database wrapper
func NewBookingStore ¶
func NewBookingStore(db *sql.DB) *BookingStore
NewBookingStore create a new datastore with underlying sql.DB
func (BookingStore) Add ¶
func (b BookingStore) Add(ctx context.Context, booking carservice.Booking) (int64, error)
Add inserts a new booking
func (BookingStore) Get ¶
func (b BookingStore) Get(ctx context.Context, id int64) (carservice.Booking, error)
Get return a specific booking
func (BookingStore) GetAll ¶
func (b BookingStore) GetAll(ctx context.Context) ([]carservice.Booking, error)
GetAll return all bookings
Click to show internal directories.
Click to hide internal directories.