driver

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package driver is generated code used to make or handle TChannel calls using Thrift.

Index

Constants

This section is empty.

Variables

View Source
var DriverFindNearestResult_Success_DEFAULT []*DriverLocation
View Source
var GoUnusedProtection__ int

Functions

func NewTChanDriverInheritedClient

func NewTChanDriverInheritedClient(thriftService string, client thrift.TChanClient) *tchanDriverClient

func NewTChanDriverServer

func NewTChanDriverServer(handler TChanDriver) thrift.TChanServer

NewTChanDriverServer wraps a handler for TChanDriver so it can be registered with a thrift.Server.

Types

type Driver

type Driver interface {
	// Parameters:
	//  - Location
	FindNearest(location string) (r []*DriverLocation, err error)
}

type DriverClient

type DriverClient struct {
	Transport       thrift.TTransport
	ProtocolFactory thrift.TProtocolFactory
	InputProtocol   thrift.TProtocol
	OutputProtocol  thrift.TProtocol
	SeqId           int32
}

func NewDriverClientProtocol

func NewDriverClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *DriverClient

func (*DriverClient) FindNearest

func (p *DriverClient) FindNearest(location string) (r []*DriverLocation, err error)

Parameters:

  • Location

type DriverFindNearestArgs

type DriverFindNearestArgs struct {
	Location string `thrift:"location,1" json:"location"`
}

Attributes:

  • Location

func NewDriverFindNearestArgs

func NewDriverFindNearestArgs() *DriverFindNearestArgs

func (*DriverFindNearestArgs) GetLocation

func (p *DriverFindNearestArgs) GetLocation() string

func (*DriverFindNearestArgs) Read

func (*DriverFindNearestArgs) String

func (p *DriverFindNearestArgs) String() string

func (*DriverFindNearestArgs) Write

func (p *DriverFindNearestArgs) Write(oprot thrift.TProtocol) error

type DriverFindNearestResult

type DriverFindNearestResult struct {
	Success []*DriverLocation `thrift:"success,0" json:"success,omitempty"`
}

Attributes:

  • Success

func NewDriverFindNearestResult

func NewDriverFindNearestResult() *DriverFindNearestResult

func (*DriverFindNearestResult) GetSuccess

func (p *DriverFindNearestResult) GetSuccess() []*DriverLocation

func (*DriverFindNearestResult) IsSetSuccess

func (p *DriverFindNearestResult) IsSetSuccess() bool

func (*DriverFindNearestResult) Read

func (*DriverFindNearestResult) String

func (p *DriverFindNearestResult) String() string

func (*DriverFindNearestResult) Write

type DriverLocation

type DriverLocation struct {
	DriverID string `thrift:"driver_id,1,required" json:"driver_id"`
	Location string `thrift:"location,2,required" json:"location"`
}

Attributes:

  • DriverID
  • Location

func NewDriverLocation

func NewDriverLocation() *DriverLocation

func (*DriverLocation) GetDriverID

func (p *DriverLocation) GetDriverID() string

func (*DriverLocation) GetLocation

func (p *DriverLocation) GetLocation() string

func (*DriverLocation) Read

func (p *DriverLocation) Read(iprot thrift.TProtocol) error

func (*DriverLocation) String

func (p *DriverLocation) String() string

func (*DriverLocation) Write

func (p *DriverLocation) Write(oprot thrift.TProtocol) error

type DriverProcessor

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

func NewDriverProcessor

func NewDriverProcessor(handler Driver) *DriverProcessor

func (*DriverProcessor) AddToProcessorMap

func (p *DriverProcessor) AddToProcessorMap(key string, processor thrift.TProcessorFunction)

func (*DriverProcessor) GetProcessorFunction

func (p *DriverProcessor) GetProcessorFunction(key string) (processor thrift.TProcessorFunction, ok bool)

func (*DriverProcessor) Process

func (p *DriverProcessor) Process(iprot, oprot thrift.TProtocol) (success bool, err thrift.TException)

func (*DriverProcessor) ProcessorMap

func (p *DriverProcessor) ProcessorMap() map[string]thrift.TProcessorFunction

type TChanDriver

type TChanDriver interface {
	FindNearest(ctx thrift.Context, location string) ([]*DriverLocation, error)
}

TChanDriver is the interface that defines the server handler and client interface.

func NewTChanDriverClient

func NewTChanDriverClient(client thrift.TChanClient) TChanDriver

NewTChanDriverClient creates a client that can be used to make remote calls.

Jump to

Keyboard shortcuts

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