datastore

package
v0.0.0-...-9b4a50d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2017 License: MIT Imports: 4 Imported by: 0

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

Get return a specific booking

func (BookingStore) GetAll

func (b BookingStore) GetAll(ctx context.Context) ([]carservice.Booking, error)

GetAll return all bookings

Jump to

Keyboard shortcuts

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