driver

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a remote client that implements driver.Interface

func NewClient

func NewClient(tracer opentracing.Tracer, logger log.Factory, hostPort string) *Client

NewClient creates a new driver.Client

func (*Client) FindNearest

func (c *Client) FindNearest(ctx context.Context, location string) ([]Driver, error)

FindNearest implements driver.Interface#FindNearest as an RPC

type Driver

type Driver struct {
	DriverID string
	Location string
}

Driver describes a driver and the current car location.

type Interface

type Interface interface {
	FindNearest(ctx context.Context, location string) ([]Driver, error)
}

Interface exposed by the Driver service.

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

Redis is a simulator of remote Redis cache

func (*Redis) FindDriverIDs

func (r *Redis) FindDriverIDs(ctx context.Context, location string) []string

FindDriverIDs finds IDs of drivers who are near the location.

func (*Redis) GetDriver

func (r *Redis) GetDriver(ctx context.Context, driverID string) (Driver, error)

GetDriver returns driver and the current car location

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server implements jaeger-demo-frontend service

func NewServer

func NewServer(hostPort string, tracer opentracing.Tracer, metricsFactory metrics.Factory, logger log.Factory) *Server

NewServer creates a new driver.Server

func (*Server) FindNearest

func (s *Server) FindNearest(ctx thrift.Context, location string) ([]*driver.DriverLocation, error)

FindNearest implements Thrift interface TChanDriver

func (*Server) Run

func (s *Server) Run() error

Run starts the Driver server

Directories

Path Synopsis
thrift-gen
driver
Package driver is generated code used to make or handle TChannel calls using Thrift.
Package driver is generated code used to make or handle TChannel calls using Thrift.

Jump to

Keyboard shortcuts

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