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 BookFlightRequest

type BookFlightRequest struct {
	Airline      string    `json:"airline"`
	FlightNumber string    `json:"flight_number"`
	Time         time.Time `json:"time"`
	Passengers   []string  `json:"passengers"`
}

func (*BookFlightRequest) Validate

func (b *BookFlightRequest) Validate() error

type FlightConfirmation

type FlightConfirmation struct {
	Ref    string             `json:"ref"`
	Flight *BookFlightRequest `json:"flight"`
}

type FlightService

type FlightService interface {
	BookFlight(context.Context, *BookFlightRequest) (*FlightConfirmation, error)
	GetBooking(ctx context.Context, ref string) (*FlightConfirmation, error)
}

func NewFlightService

func NewFlightService() (FlightService, error)

Jump to

Keyboard shortcuts

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