endpoint

package
v0.0.0-...-99cece9 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignCargoToRouteEndpoint

func AssignCargoToRouteEndpoint(bookService booking.Service) endpoint.Endpoint

func CargosEndpoint

func CargosEndpoint(bookService booking.Service) endpoint.Endpoint

func ChangeDestinationEndpoint

func ChangeDestinationEndpoint(bookService booking.Service) endpoint.Endpoint

func LocationsEndpoint

func LocationsEndpoint(bookService booking.Service) endpoint.Endpoint

func MakeBookCargoEndpoint

func MakeBookCargoEndpoint(bookService booking.Service) endpoint.Endpoint

func MakeLoadCargoEndpoint

func MakeLoadCargoEndpoint(bookService booking.Service) endpoint.Endpoint

func RegisterHandlingEventEndpoint

func RegisterHandlingEventEndpoint(handlingService handling.Service) endpoint.Endpoint

Types

type AssignCargoToRouteRequest

type AssignCargoToRouteRequest struct {
	Id        shipping.TrackingID
	Itinerary shipping.Itinerary
}

type AssignCargoToRouteResponse

type AssignCargoToRouteResponse struct {
	Res bool `json:"res"`
}

type BookCargoRequest

type BookCargoRequest struct {
	Origin      shipping.UNLocode
	Destination shipping.UNLocode
	Deadline    time.Time
}

type BookCargoResponse

type BookCargoResponse struct {
	TrackingID shipping.TrackingID `json:"tracking_id"`
}

type CargoEndpoints

type CargoEndpoints struct {
	BookCargoEndpoint             endpoint.Endpoint
	LoadCargoEndpoint             endpoint.Endpoint
	AssignCargoToRouteEndpoint    endpoint.Endpoint
	ChangeDestinationEndpoint     endpoint.Endpoint
	CargosEndpoint                endpoint.Endpoint
	LocationsEndpoint             endpoint.Endpoint
	RegisterHandlingEventEndpoint endpoint.Endpoint
}

type CargosResponse

type CargosResponse struct {
	Cargos []booking.Cargo `json:"cargos"`
}

type ChangeDestinationRequest

type ChangeDestinationRequest struct {
	Id          shipping.TrackingID
	Destination shipping.UNLocode
}

type ChangeDestinationResponse

type ChangeDestinationResponse struct {
	Res bool `json:"res"`
}

type LoadCargoRequest

type LoadCargoRequest struct {
	Id shipping.TrackingID
}

type LoadCargoResponse

type LoadCargoResponse struct {
	Cargo booking.Cargo `json:"cargo"`
}

type LocationsRequest

type LocationsRequest struct {
}

type LocationsResponse

type LocationsResponse struct {
	Locations []booking.Location `json:"locations"`
}

type RegisterHandlingEventRequest

type RegisterHandlingEventRequest struct {
	Completed    time.Time
	Id           shipping.TrackingID
	VoyageNumber shipping.VoyageNumber
	UnLocode     shipping.UNLocode
	EventType    shipping.HandlingEventType
}

type RegisterHandlingEventResponse

type RegisterHandlingEventResponse struct {
	Res bool `json:"res"`
}

type Server

type Server struct {
	Booking  booking.Service
	Tracking tracking.Service
	Handling handling.Service

	Logger kitlog.Logger
	// contains filtered or unexported fields
}

Server holds the dependencies for a HTTP server.

func New

New returns a new HTTP server.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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