package handling
import "github.com/go-kit/kit/examples/shipping/handling"
Package handling provides the use-case for registering incidents. Used by views facing the people handling the cargo along its route.
Index ¶
- Variables
- func MakeHandler(ctx context.Context, hs Service, logger kitlog.Logger) http.Handler
- type EventHandler
- type Service
Variables ¶
ErrInvalidArgument is returned when one or more arguments are invalid.
Functions ¶
func MakeHandler ¶
MakeHandler returns a handler for the handling service.
Types ¶
type EventHandler ¶
type EventHandler interface { CargoWasHandled(cargo.HandlingEvent) }
EventHandler provides a means of subscribing to registered handling events.
func NewEventHandler ¶
func NewEventHandler(s inspection.Service) EventHandler
NewEventHandler returns a new instance of a EventHandler.
type Service ¶
type Service interface { // RegisterHandlingEvent registers a handling event in the system, and // notifies interested parties that a cargo has been handled. RegisterHandlingEvent(completionTime time.Time, trackingID cargo.TrackingID, voyageNumber voyage.Number, unLocode location.UNLocode, eventType cargo.HandlingEventType) error }
Service provides handling operations.
func NewInstrumentingService ¶
func NewInstrumentingService(requestCount metrics.Counter, requestLatency metrics.TimeHistogram, s Service) Service
NewInstrumentingService returns an instance of an instrumenting Service.
func NewLoggingService ¶
NewLoggingService returns a new instance of a logging Service.
func NewService ¶
func NewService(r cargo.HandlingEventRepository, f cargo.HandlingEventFactory, h EventHandler) Service
NewService creates a handling event service with necessary dependencies.
Source Files ¶
endpoint.go instrumenting.go logging.go service.go transport.go
- Version
- v0.1.0
- Published
- Jun 7, 2016
- Platform
- js/wasm
- Imports
- 14 packages
- Last checked
- 2 minutes ago –
Tools for package owners.