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 BookHotelRequest

type BookHotelRequest struct {
	Hotel    string    `json:"hotel"`
	CheckIn  time.Time `json:"check_in"`
	CheckOut time.Time `json:"check_out"`
	Name     string    `json:"name"`
	Guests   int       `json:"guests"`
}

func (*BookHotelRequest) Validate

func (b *BookHotelRequest) Validate() error

type HotelConfirmation

type HotelConfirmation struct {
	Ref   string            `json:"ref"`
	Hotel *BookHotelRequest `json:"hotel"`
}

type HotelService

type HotelService interface {
	BookHotel(context.Context, *BookHotelRequest) (*HotelConfirmation, error)
	GetBooking(ctx context.Context, ref string) (*HotelConfirmation, error)
}

func NewHotelService

func NewHotelService() (HotelService, error)

Jump to

Keyboard shortcuts

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