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)
Click to show internal directories.
Click to hide internal directories.