Documentation
¶
Index ¶
- Variables
- type RideShare
- func (r *RideShare) CalcAmountDistance() (float64, error)
- func (r *RideShare) CalcAmountPrice() (uint32, error)
- func (r *RideShare) CalcAmountTime() (*durpb.Duration, error)
- func (*RideShare) Descriptor() ([]byte, []int)
- func (m *RideShare) GetAmountPrice() uint32
- func (m *RideShare) GetArrivePoint() *common.Place
- func (m *RideShare) GetArriveTime() *common.Time
- func (m *RideShare) GetDepartPoint() *common.Place
- func (m *RideShare) GetDepartTime() *common.Time
- func (m *RideShare) GetNumAdult() uint32
- func (m *RideShare) GetNumChild() uint32
- func (m *RideShare) GetRoutes() []*Route
- func (*RideShare) ProtoMessage()
- func (m *RideShare) Reset()
- func (m *RideShare) String() string
- func (m *RideShare) XXX_DiscardUnknown()
- func (m *RideShare) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *RideShare) XXX_Merge(src proto.Message)
- func (m *RideShare) XXX_Size() int
- func (m *RideShare) XXX_Unmarshal(b []byte) error
- type Route
- func (m *Route) CalcAmountDistance() (float64, error)
- func (m *Route) CalcAmountTime() (*durpb.Duration, error)
- func (*Route) Descriptor() ([]byte, []int)
- func (m *Route) GetAmountPrice() uint32
- func (m *Route) GetAmountSheets() uint32
- func (m *Route) GetAmountTime() *duration.Duration
- func (m *Route) GetArrivePoint() *common.Place
- func (m *Route) GetArriveTime() *common.Time
- func (m *Route) GetAvailableSheets() uint32
- func (m *Route) GetDepartPoint() *common.Place
- func (m *Route) GetDepartTime() *common.Time
- func (m *Route) GetDestination() string
- func (m *Route) GetPoints() []*common.Point
- func (m *Route) GetStatusType() StatusType
- func (m *Route) GetTrafficType() TrafficType
- func (m *Route) GetTransportLine() string
- func (m *Route) GetTransportName() string
- func (*Route) ProtoMessage()
- func (m *Route) Reset()
- func (m *Route) String() string
- func (m *Route) XXX_DiscardUnknown()
- func (m *Route) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Route) XXX_Merge(src proto.Message)
- func (m *Route) XXX_Size() int
- func (m *Route) XXX_Unmarshal(b []byte) error
- type StatusType
- type TrafficType
Constants ¶
This section is empty.
Variables ¶
var StatusType_name = map[int32]string{
0: "FREE",
1: "PICKUP",
2: "RIDE",
3: "FULL",
}
var StatusType_value = map[string]int32{
"FREE": 0,
"PICKUP": 1,
"RIDE": 2,
"FULL": 3,
}
var TrafficType_name = map[int32]string{
0: "TAXI",
1: "BUS",
2: "TRAIN",
}
var TrafficType_value = map[string]int32{
"TAXI": 0,
"BUS": 1,
"TRAIN": 2,
}
Functions ¶
This section is empty.
Types ¶
type RideShare ¶
type RideShare struct {}
func (*RideShare) CalcAmountDistance ¶
CalcAmountDistance returns sum of each Route's amount distance. If each Route has valid points, returns distance. Otherwise, returns -1.
func (*RideShare) CalcAmountPrice ¶
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 ¶
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) GetAmountPrice ¶
func (*RideShare) GetArrivePoint ¶
func (*RideShare) GetArriveTime ¶
func (*RideShare) GetDepartPoint ¶
func (*RideShare) GetDepartTime ¶
func (*RideShare) GetNumAdult ¶
func (*RideShare) GetNumChild ¶
func (*RideShare) ProtoMessage ¶
func (*RideShare) ProtoMessage()
func (*RideShare) XXX_DiscardUnknown ¶
func (m *RideShare) XXX_DiscardUnknown()
func (*RideShare) XXX_Marshal ¶
func (*RideShare) XXX_Unmarshal ¶
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 ¶
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 ¶
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) GetAmountPrice ¶
func (*Route) GetAmountSheets ¶
func (*Route) GetAmountTime ¶
func (*Route) GetArrivePoint ¶
func (*Route) GetArriveTime ¶
func (*Route) GetAvailableSheets ¶
func (*Route) GetDepartPoint ¶
func (*Route) GetDepartTime ¶
func (*Route) GetDestination ¶
func (*Route) GetStatusType ¶
func (m *Route) GetStatusType() StatusType
func (*Route) GetTrafficType ¶
func (m *Route) GetTrafficType() TrafficType
func (*Route) GetTransportLine ¶
func (*Route) GetTransportName ¶
func (*Route) ProtoMessage ¶
func (*Route) ProtoMessage()
func (*Route) XXX_DiscardUnknown ¶
func (m *Route) XXX_DiscardUnknown()
func (*Route) XXX_Marshal ¶
func (*Route) XXX_Unmarshal ¶
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