kit: github.com/go-kit/kit/examples/shipping/handling Index | Files

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

Package Files

endpoint.go instrumenting.go logging.go service.go transport.go

Variables

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

ErrInvalidArgument is returned when one or more arguments are invalid.

func MakeHandler Uses

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

MakeHandler returns a handler for the handling service.

type EventHandler Uses

type EventHandler interface {
    CargoWasHandled(cargo.HandlingEvent)
}

EventHandler provides a means of subscribing to registered handling events.

func NewEventHandler Uses

func NewEventHandler(s inspection.Service) EventHandler

NewEventHandler returns a new instance of a EventHandler.

type Service Uses

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 Uses

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

NewInstrumentingService returns an instance of an instrumenting Service.

func NewLoggingService Uses

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

NewLoggingService returns a new instance of a logging Service.

func NewService Uses

func NewService(r cargo.HandlingEventRepository, f cargo.HandlingEventFactory, h EventHandler) Service

NewService creates a handling event service with necessary dependencies.

Package handling imports 14 packages (graph) and is imported by 7 packages. Updated 2017-05-26. Refresh now. Tools for package owners.