bolt

package
v0.0.0-...-a30d32d Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2016 License: MIT Imports: 7 Imported by: 0

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

func (s *BookingService) DeleteBooking(id bookit.BookingID) (*bookit.Booking, error)

DeleteBooking deletes the booking with given id

func (*BookingService) GetBooking

func (s *BookingService) GetBooking(id bookit.BookingID) (*bookit.Booking, error)

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?

func (*Client) Close

func (c *Client) Close() error

Close closes client connection to db

func (*Client) Open

func (c *Client) Open() error

Open client connection to database

Directories

Path Synopsis
Package internal is a generated protocol buffer package.
Package internal is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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