service

package
v0.0.0-...-7a45337 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoSuchBooking = errors.New("no such booking")
)

Functions

This section is empty.

Types

type BookCarRentalRequest

type BookCarRentalRequest struct {
	Agent           string    `json:"agent"`
	PickUp          time.Time `json:"pick_up"`
	PickUpLocation  string    `json:"pick_up_location"`
	DropOff         time.Time `json:"drop_off"`
	DropOffLocation string    `json:"drop_off_location"`
	Name            string    `json:"name"`
	VehicleClass    string    `json:"vehicle_class"`
}

func (*BookCarRentalRequest) Validate

func (b *BookCarRentalRequest) Validate() error

type CarRentalConfirmation

type CarRentalConfirmation struct {
	Ref       string                `json:"ref"`
	CarRental *BookCarRentalRequest `json:"car_rental"`
}

type CarRentalService

type CarRentalService interface {
	BookCarRental(context.Context, *BookCarRentalRequest) (*CarRentalConfirmation, error)
	GetBooking(ctx context.Context, ref string) (*CarRentalConfirmation, error)
}

func NewCarRentalService

func NewCarRentalService() (CarRentalService, error)

Jump to

Keyboard shortcuts

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