Back to godoc.org

Package driver

v1.15.1
Latest Go to latest

The highest tagged major version is .

Published: Nov 7, 2019 | License: Apache-2.0 | Module: github.com/Klarrio/jaeger

Index

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

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier