handling

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2016 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package handling provides the use-case for registering incidents. Used by views facing the people handling the cargo along its route.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidArgument = errors.New("invalid argument")

ErrInvalidArgument is returned when one or more arguments are invalid.

Functions

func MakeHandler

func MakeHandler(ctx context.Context, hs Service, logger kitlog.Logger) http.Handler

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(completed time.Time, id cargo.TrackingID, voyageNumber voyage.Number,
		unLocode location.UNLocode, eventType cargo.HandlingEventType) error
}

Service provides handling operations.

func NewInstrumentingService

func NewInstrumentingService(counter metrics.Counter, latency metrics.Histogram, s Service) Service

NewInstrumentingService returns an instance of an instrumenting Service.

func NewLoggingService

func NewLoggingService(logger log.Logger, s Service) Service

NewLoggingService returns a new instance of a logging Service.

func NewService

NewService creates a handling event service with necessary dependencies.

Jump to

Keyboard shortcuts

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