driver

package
v0.0.0-...-5e45501 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeHTTPHandler

func MakeHTTPHandler(s Service, logger *logrus.Logger) http.Handler

MakeHTTPHandler creates an http handler

func SetEventHandler

func SetEventHandler(lookup string, s Service, logger *logrus.Logger)

SetEventHandler to process NSQ events

Types

type Location

type Location struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	UpdatedAt string  `json:"updated_at"`
}

Location response model

type Middleware

type Middleware func(Service) Service

Middleware describes a service middleware

func LoggingMiddleware

func LoggingMiddleware(logger *logrus.Logger) Middleware

LoggingMiddleware create a new logging middleware

type Service

type Service interface {
	GetLocations(id string, minute int) (*[]Location, error)
	CreateLocation(event *locationCreatedEvent) error
}

Service is a simple interface for driver locations

func NewService

func NewService(s store.RedisStore) Service

NewService factory method

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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