Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookingService ¶
type BookingService struct {
// contains filtered or unexported fields
}
BookingService to set client
func (*BookingService) CreateBooking ¶
func (s *BookingService) CreateBooking(b *bookit.Booking) error
CreateBooking - creates a new booking and saves to bookings bucket
func (*BookingService) DeleteBooking ¶
DeleteBooking deletes the booking with given id
func (*BookingService) GetBooking ¶
GetBooking - Receiver is a pointer to booking service struct which implements client GetBooking takes a bookit.BookingID to use in call to db, return the bookit.Booking
func (*BookingService) UpdateBooking ¶
func (s *BookingService) UpdateBooking(b *bookit.Booking) error
UpdateBooking takes a booking with updated values and replace the one in db. Returns an id to confirm what booking was updated and an error
type Client ¶
type Client struct { // Filename to the BoltDB database. Path string // Returns the current time. Now func() time.Time // contains filtered or unexported fields }
Client represents a client to the underlying BoltDB data store.
func NewClient ¶
func NewClient() *Client
NewClient initiates a new client and it to the bookingService
func (*Client) BookingService ¶
func (c *Client) BookingService() bookit.BookingService
BookingService returns the service associated with the client TODO: generalize so it is not bound specifically to booking service? or one for each service?