rideshare

package module
v0.0.0-...-afd3805 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StatusType_name = map[int32]string{
	0: "FREE",
	1: "PICKUP",
	2: "RIDE",
	3: "FULL",
}
View Source
var StatusType_value = map[string]int32{
	"FREE":   0,
	"PICKUP": 1,
	"RIDE":   2,
	"FULL":   3,
}
View Source
var TrafficType_name = map[int32]string{
	0: "TAXI",
	1: "BUS",
	2: "TRAIN",
}
View Source
var TrafficType_value = map[string]int32{
	"TAXI":  0,
	"BUS":   1,
	"TRAIN": 2,
}

Functions

This section is empty.

Types

type RideShare

type RideShare struct {
	DepartPoint          *common.Place `protobuf:"bytes,1,opt,name=depart_point,json=departPoint,proto3" json:"depart_point,omitempty"`
	ArrivePoint          *common.Place `protobuf:"bytes,2,opt,name=arrive_point,json=arrivePoint,proto3" json:"arrive_point,omitempty"`
	DepartTime           *common.Time  `protobuf:"bytes,3,opt,name=depart_time,json=departTime,proto3" json:"depart_time,omitempty"`
	ArriveTime           *common.Time  `protobuf:"bytes,4,opt,name=arrive_time,json=arriveTime,proto3" json:"arrive_time,omitempty"`
	NumAdult             uint32        `protobuf:"varint,5,opt,name=num_adult,json=numAdult,proto3" json:"num_adult,omitempty"`
	NumChild             uint32        `protobuf:"varint,6,opt,name=num_child,json=numChild,proto3" json:"num_child,omitempty"`
	Routes               []*Route      `protobuf:"bytes,7,rep,name=routes,proto3" json:"routes,omitempty"`
	AmountPrice          uint32        `protobuf:"varint,8,opt,name=amount_price,json=amountPrice,proto3" json:"amount_price,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (*RideShare) CalcAmountDistance

func (r *RideShare) CalcAmountDistance() (float64, error)

CalcAmountDistance returns sum of each Route's amount distance. If each Route has valid points, returns distance. Otherwise, returns -1.

func (*RideShare) CalcAmountPrice

func (r *RideShare) CalcAmountPrice() (uint32, error)

CalcAmountPrice returns sum of each Route's amount price. If each Route has valid price, returns amount of price. Otherwise, returns 0.

func (*RideShare) CalcAmountTime

func (r *RideShare) CalcAmountTime() (*durpb.Duration, error)

CalcAmountTime returns sum of each Route's amount time. If each Route has valid timestamp, returns differens between first Route.DepartTime and last Route.ArriveTime. Otherwise, returns nil.

func (*RideShare) Descriptor

func (*RideShare) Descriptor() ([]byte, []int)

func (*RideShare) GetAmountPrice

func (m *RideShare) GetAmountPrice() uint32

func (*RideShare) GetArrivePoint

func (m *RideShare) GetArrivePoint() *common.Place

func (*RideShare) GetArriveTime

func (m *RideShare) GetArriveTime() *common.Time

func (*RideShare) GetDepartPoint

func (m *RideShare) GetDepartPoint() *common.Place

func (*RideShare) GetDepartTime

func (m *RideShare) GetDepartTime() *common.Time

func (*RideShare) GetNumAdult

func (m *RideShare) GetNumAdult() uint32

func (*RideShare) GetNumChild

func (m *RideShare) GetNumChild() uint32

func (*RideShare) GetRoutes

func (m *RideShare) GetRoutes() []*Route

func (*RideShare) ProtoMessage

func (*RideShare) ProtoMessage()

func (*RideShare) Reset

func (m *RideShare) Reset()

func (*RideShare) String

func (m *RideShare) String() string

func (*RideShare) XXX_DiscardUnknown

func (m *RideShare) XXX_DiscardUnknown()

func (*RideShare) XXX_Marshal

func (m *RideShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*RideShare) XXX_Merge

func (dst *RideShare) XXX_Merge(src proto.Message)

func (*RideShare) XXX_Size

func (m *RideShare) XXX_Size() int

func (*RideShare) XXX_Unmarshal

func (m *RideShare) XXX_Unmarshal(b []byte) error

type Route

type Route struct {
	TrafficType          TrafficType        `` /* 126-byte string literal not displayed */
	StatusType           StatusType         `protobuf:"varint,2,opt,name=status_type,json=statusType,proto3,enum=api.rideshare.StatusType" json:"status_type,omitempty"`
	TransportName        string             `protobuf:"bytes,3,opt,name=transport_name,json=transportName,proto3" json:"transport_name,omitempty"`
	TransportLine        string             `protobuf:"bytes,4,opt,name=transport_line,json=transportLine,proto3" json:"transport_line,omitempty"`
	Destination          string             `protobuf:"bytes,5,opt,name=destination,proto3" json:"destination,omitempty"`
	DepartPoint          *common.Place      `protobuf:"bytes,6,opt,name=depart_point,json=departPoint,proto3" json:"depart_point,omitempty"`
	ArrivePoint          *common.Place      `protobuf:"bytes,7,opt,name=arrive_point,json=arrivePoint,proto3" json:"arrive_point,omitempty"`
	DepartTime           *common.Time       `protobuf:"bytes,8,opt,name=depart_time,json=departTime,proto3" json:"depart_time,omitempty"`
	ArriveTime           *common.Time       `protobuf:"bytes,9,opt,name=arrive_time,json=arriveTime,proto3" json:"arrive_time,omitempty"`
	AmountTime           *duration.Duration `protobuf:"bytes,10,opt,name=amount_time,json=amountTime,proto3" json:"amount_time,omitempty"`
	AmountPrice          uint32             `protobuf:"varint,11,opt,name=amount_price,json=amountPrice,proto3" json:"amount_price,omitempty"`
	AmountSheets         uint32             `protobuf:"varint,12,opt,name=amount_sheets,json=amountSheets,proto3" json:"amount_sheets,omitempty"`
	AvailableSheets      uint32             `protobuf:"varint,13,opt,name=available_sheets,json=availableSheets,proto3" json:"available_sheets,omitempty"`
	Points               []*common.Point    `protobuf:"bytes,15,rep,name=points,proto3" json:"points,omitempty"`
	XXX_NoUnkeyedLiteral struct{}           `json:"-"`
	XXX_unrecognized     []byte             `json:"-"`
	XXX_sizecache        int32              `json:"-"`
}

func (*Route) CalcAmountDistance

func (m *Route) CalcAmountDistance() (float64, error)

CalcAmountDistance returns distance between DepartPoint and ArrivalPoint. If both point has valid Point, returns the distance(m) between both point. Otherwise, returns -1.

func (*Route) CalcAmountTime

func (m *Route) CalcAmountTime() (*durpb.Duration, error)

CalcAmountTime returns difference between ArriveTime and DepartTime. If both time has timestamp, CalcAmountTime returns protobuf Duration. Otherwise, CalcAmountTime returns nil.

func (*Route) Descriptor

func (*Route) Descriptor() ([]byte, []int)

func (*Route) GetAmountPrice

func (m *Route) GetAmountPrice() uint32

func (*Route) GetAmountSheets

func (m *Route) GetAmountSheets() uint32

func (*Route) GetAmountTime

func (m *Route) GetAmountTime() *duration.Duration

func (*Route) GetArrivePoint

func (m *Route) GetArrivePoint() *common.Place

func (*Route) GetArriveTime

func (m *Route) GetArriveTime() *common.Time

func (*Route) GetAvailableSheets

func (m *Route) GetAvailableSheets() uint32

func (*Route) GetDepartPoint

func (m *Route) GetDepartPoint() *common.Place

func (*Route) GetDepartTime

func (m *Route) GetDepartTime() *common.Time

func (*Route) GetDestination

func (m *Route) GetDestination() string

func (*Route) GetPoints

func (m *Route) GetPoints() []*common.Point

func (*Route) GetStatusType

func (m *Route) GetStatusType() StatusType

func (*Route) GetTrafficType

func (m *Route) GetTrafficType() TrafficType

func (*Route) GetTransportLine

func (m *Route) GetTransportLine() string

func (*Route) GetTransportName

func (m *Route) GetTransportName() string

func (*Route) ProtoMessage

func (*Route) ProtoMessage()

func (*Route) Reset

func (m *Route) Reset()

func (*Route) String

func (m *Route) String() string

func (*Route) XXX_DiscardUnknown

func (m *Route) XXX_DiscardUnknown()

func (*Route) XXX_Marshal

func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Route) XXX_Merge

func (dst *Route) XXX_Merge(src proto.Message)

func (*Route) XXX_Size

func (m *Route) XXX_Size() int

func (*Route) XXX_Unmarshal

func (m *Route) XXX_Unmarshal(b []byte) error

type StatusType

type StatusType int32
const (
	StatusType_FREE   StatusType = 0
	StatusType_PICKUP StatusType = 1
	StatusType_RIDE   StatusType = 2
	StatusType_FULL   StatusType = 3
)

func (StatusType) EnumDescriptor

func (StatusType) EnumDescriptor() ([]byte, []int)

func (StatusType) String

func (x StatusType) String() string

type TrafficType

type TrafficType int32
const (
	TrafficType_TAXI  TrafficType = 0
	TrafficType_BUS   TrafficType = 1
	TrafficType_TRAIN TrafficType = 2
)

func (TrafficType) EnumDescriptor

func (TrafficType) EnumDescriptor() ([]byte, []int)

func (TrafficType) String

func (x TrafficType) String() string

Jump to

Keyboard shortcuts

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