Documentation
¶
Index ¶
- Constants
- Variables
- func DistanceLonLat(lon1 float64, lat1 float64, lon2 float64, lat2 float64) float64
- func ValidatePoint(p *Point) error
- type Area
- func (*Area) Descriptor() ([]byte, []int)
- func (m *Area) GetPoints() []*Point
- func (*Area) ProtoMessage()
- func (m *Area) Reset()
- func (m *Area) String() string
- func (m *Area) XXX_DiscardUnknown()
- func (m *Area) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Area) XXX_Merge(src proto.Message)
- func (m *Area) XXX_Size() int
- func (m *Area) XXX_Unmarshal(b []byte) error
- type Areas
- func (*Areas) Descriptor() ([]byte, []int)
- func (m *Areas) GetValues() []*Area
- func (*Areas) ProtoMessage()
- func (m *Areas) Reset()
- func (m *Areas) String() string
- func (m *Areas) XXX_DiscardUnknown()
- func (m *Areas) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Areas) XXX_Merge(src proto.Message)
- func (m *Areas) XXX_Size() int
- func (m *Areas) XXX_Unmarshal(b []byte) error
- type OtherTime
- type Period
- func (*Period) Descriptor() ([]byte, []int)
- func (m *Period) GetFrom() *timestamp.Timestamp
- func (m *Period) GetOptions() []*RepeatOption
- func (m *Period) GetTo() *timestamp.Timestamp
- func (*Period) ProtoMessage()
- func (m *Period) Reset()
- func (m *Period) String() string
- func (m *Period) XXX_DiscardUnknown()
- func (m *Period) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Period) XXX_Merge(src proto.Message)
- func (m *Period) XXX_Size() int
- func (m *Period) XXX_Unmarshal(b []byte) error
- type Periods
- func (*Periods) Descriptor() ([]byte, []int)
- func (m *Periods) GetValues() []*Period
- func (*Periods) ProtoMessage()
- func (m *Periods) Reset()
- func (m *Periods) String() string
- func (m *Periods) XXX_DiscardUnknown()
- func (m *Periods) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Periods) XXX_Merge(src proto.Message)
- func (m *Periods) XXX_Size() int
- func (m *Periods) XXX_Unmarshal(b []byte) error
- type Place
- func (*Place) Descriptor() ([]byte, []int)
- func (m *Place) GetAreas() *Areas
- func (p *Place) GetCentralPoint() *Point
- func (m *Place) GetPoint() *Point
- func (m *Place) GetValue() isPlace_Value
- func (*Place) ProtoMessage()
- func (m *Place) Reset()
- func (m *Place) String() string
- func (p *Place) WithAreas(areas [][]*Point) *Place
- func (p *Place) WithPoint(point *Point) *Place
- func (m *Place) XXX_DiscardUnknown()
- func (m *Place) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Place) XXX_Merge(src proto.Message)
- func (*Place) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *Place) XXX_Size() int
- func (m *Place) XXX_Unmarshal(b []byte) error
- type Place_Areas
- type Place_Point
- type Point
- func (pt1 *Point) AddPoint(pt2 *Point) *Point
- func (*Point) Descriptor() ([]byte, []int)
- func (p1 *Point) Distance(p2 *Point) (float64, error)
- func (pt1 *Point) DividePoint(d float64) *Point
- func (m *Point) GetLatitude() float64
- func (m *Point) GetLongitude() float64
- func (m *Point) GetName() string
- func (p1 *Point) IsSamePoint(p2 *Point, r float64) bool
- func (*Point) ProtoMessage()
- func (m *Point) Reset()
- func (m *Point) String() string
- func (m *Point) XXX_DiscardUnknown()
- func (m *Point) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Point) XXX_Merge(src proto.Message)
- func (m *Point) XXX_Size() int
- func (m *Point) XXX_Unmarshal(b []byte) error
- type RepeatOption
- func (*RepeatOption) Descriptor() ([]byte, []int)
- func (m *RepeatOption) GetTimes() []uint32
- func (m *RepeatOption) GetWeekdays() []bool
- func (m *RepeatOption) GetWeeks() []bool
- func (*RepeatOption) ProtoMessage()
- func (m *RepeatOption) Reset()
- func (m *RepeatOption) String() string
- func (m *RepeatOption) XXX_DiscardUnknown()
- func (m *RepeatOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *RepeatOption) XXX_Merge(src proto.Message)
- func (m *RepeatOption) XXX_Size() int
- func (m *RepeatOption) XXX_Unmarshal(b []byte) error
- type Time
- func (*Time) Descriptor() ([]byte, []int)
- func (m *Time) GetOther() OtherTime
- func (m *Time) GetPeriods() *Periods
- func (m *Time) GetTimestamp() *timestamp.Timestamp
- func (m *Time) GetValue() isTime_Value
- func (*Time) ProtoMessage()
- func (m *Time) Reset()
- func (m *Time) String() string
- func (t *Time) WithOtherTime(other OtherTime) *Time
- func (t *Time) WithPeriods(periods []*Period) *Time
- func (t *Time) WithTimestamp(ts *timestamp.Timestamp) *Time
- func (m *Time) XXX_DiscardUnknown()
- func (m *Time) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Time) XXX_Merge(src proto.Message)
- func (*Time) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- func (m *Time) XXX_Size() int
- func (m *Time) XXX_Unmarshal(b []byte) error
- type Time_Other
- type Time_Periods
- type Time_Timestamp
Constants ¶
const ( MIN_LATITUDE = float64(-90) MAX_LATITUDE = float64(90) MIN_LONGITUDE = float64(-180) MAX_LONGITUDE = float64(180) )
Variables ¶
var OtherTime_name = map[int32]string{
0: "NONE",
1: "AS_SOON_AS",
}
var OtherTime_value = map[string]int32{
"NONE": 0,
"AS_SOON_AS": 1,
}
Functions ¶
func DistanceLonLat ¶
direct calc distance using lon/lat
func ValidatePoint ¶
ValidatePoint determins whether a Point is valid. Latitude is in range [-90, 90] and Longitude is in rage [-180, 180].
Types ¶
type Area ¶
type Area struct {
Points []*Point `protobuf:"bytes,1,rep,name=points,proto3" json:"points,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Area) Descriptor ¶
func (*Area) ProtoMessage ¶
func (*Area) ProtoMessage()
func (*Area) XXX_DiscardUnknown ¶
func (m *Area) XXX_DiscardUnknown()
func (*Area) XXX_Unmarshal ¶
type Areas ¶
type Areas struct {
Values []*Area `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Areas) Descriptor ¶
func (*Areas) ProtoMessage ¶
func (*Areas) ProtoMessage()
func (*Areas) XXX_DiscardUnknown ¶
func (m *Areas) XXX_DiscardUnknown()
func (*Areas) XXX_Marshal ¶
func (*Areas) XXX_Unmarshal ¶
type Period ¶
type Period struct {
From *timestamp.Timestamp `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"`
To *timestamp.Timestamp `protobuf:"bytes,2,opt,name=to,proto3" json:"to,omitempty"`
Options []*RepeatOption `protobuf:"bytes,3,rep,name=options,proto3" json:"options,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Period) Descriptor ¶
func (*Period) GetOptions ¶
func (m *Period) GetOptions() []*RepeatOption
func (*Period) ProtoMessage ¶
func (*Period) ProtoMessage()
func (*Period) XXX_DiscardUnknown ¶
func (m *Period) XXX_DiscardUnknown()
func (*Period) XXX_Marshal ¶
func (*Period) XXX_Unmarshal ¶
type Periods ¶
type Periods struct {
Values []*Period `protobuf:"bytes,1,rep,name=values,proto3" json:"values,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Periods) Descriptor ¶
func (*Periods) ProtoMessage ¶
func (*Periods) ProtoMessage()
func (*Periods) XXX_DiscardUnknown ¶
func (m *Periods) XXX_DiscardUnknown()
func (*Periods) XXX_Marshal ¶
func (*Periods) XXX_Unmarshal ¶
type Place ¶
type Place struct {
// Types that are valid to be assigned to Value:
// *Place_Point
// *Place_Areas
Value isPlace_Value `protobuf_oneof:"value"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Place) Descriptor ¶
func (*Place) GetCentralPoint ¶
func (*Place) ProtoMessage ¶
func (*Place) ProtoMessage()
func (*Place) WithAreas ¶
WithAreas makes []*Area from a given points and set to Place.Place_Areas.Areas.
func (*Place) XXX_DiscardUnknown ¶
func (m *Place) XXX_DiscardUnknown()
func (*Place) XXX_Marshal ¶
func (*Place) XXX_OneofFuncs ¶
func (*Place) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*Place) XXX_Unmarshal ¶
type Place_Areas ¶
type Place_Areas struct {
Areas *Areas `protobuf:"bytes,2,opt,name=areas,proto3,oneof"`
}
type Place_Point ¶
type Place_Point struct {
Point *Point `protobuf:"bytes,1,opt,name=point,proto3,oneof"`
}
type Point ¶
type Point struct {
Latitude float64 `protobuf:"fixed64,1,opt,name=latitude,proto3" json:"latitude,omitempty"`
Longitude float64 `protobuf:"fixed64,2,opt,name=longitude,proto3" json:"longitude,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Point) Descriptor ¶
func (*Point) DividePoint ¶
func (*Point) GetLatitude ¶
func (*Point) GetLongitude ¶
func (*Point) IsSamePoint ¶
IsSamePoint determins whether two points are same. If r is 0, matching is strict. Otherwise, matching is lenient. (consider as same if they are within r meters)
func (*Point) ProtoMessage ¶
func (*Point) ProtoMessage()
func (*Point) XXX_DiscardUnknown ¶
func (m *Point) XXX_DiscardUnknown()
func (*Point) XXX_Marshal ¶
func (*Point) XXX_Unmarshal ¶
type RepeatOption ¶
type RepeatOption struct {
Weeks []bool `protobuf:"varint,1,rep,packed,name=weeks,proto3" json:"weeks,omitempty"`
Weekdays []bool `protobuf:"varint,2,rep,packed,name=weekdays,proto3" json:"weekdays,omitempty"`
Times []uint32 `protobuf:"varint,3,rep,packed,name=times,proto3" json:"times,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*RepeatOption) Descriptor ¶
func (*RepeatOption) Descriptor() ([]byte, []int)
func (*RepeatOption) GetTimes ¶
func (m *RepeatOption) GetTimes() []uint32
func (*RepeatOption) GetWeekdays ¶
func (m *RepeatOption) GetWeekdays() []bool
func (*RepeatOption) GetWeeks ¶
func (m *RepeatOption) GetWeeks() []bool
func (*RepeatOption) ProtoMessage ¶
func (*RepeatOption) ProtoMessage()
func (*RepeatOption) Reset ¶
func (m *RepeatOption) Reset()
func (*RepeatOption) String ¶
func (m *RepeatOption) String() string
func (*RepeatOption) XXX_DiscardUnknown ¶
func (m *RepeatOption) XXX_DiscardUnknown()
func (*RepeatOption) XXX_Marshal ¶
func (m *RepeatOption) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*RepeatOption) XXX_Merge ¶
func (dst *RepeatOption) XXX_Merge(src proto.Message)
func (*RepeatOption) XXX_Size ¶
func (m *RepeatOption) XXX_Size() int
func (*RepeatOption) XXX_Unmarshal ¶
func (m *RepeatOption) XXX_Unmarshal(b []byte) error
type Time ¶
type Time struct {
// Types that are valid to be assigned to Value:
// *Time_Timestamp
// *Time_Periods
// *Time_Other
Value isTime_Value `protobuf_oneof:"value"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Time) Descriptor ¶
func (*Time) GetPeriods ¶
func (*Time) GetTimestamp ¶
func (*Time) ProtoMessage ¶
func (*Time) ProtoMessage()
func (*Time) WithOtherTime ¶
WithOtherTime set a given time to Time.Time_Other.Other.
func (*Time) WithPeriods ¶
WithPeriods set given periods to Time.Time_Periods.Periods.
func (*Time) WithTimestamp ¶
WithTimestamp set a given timestamp to Time.Time_Timestamp.Timestamp.
func (*Time) XXX_DiscardUnknown ¶
func (m *Time) XXX_DiscardUnknown()
func (*Time) XXX_OneofFuncs ¶
func (*Time) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
func (*Time) XXX_Unmarshal ¶
type Time_Other ¶
type Time_Other struct {
Other OtherTime `protobuf:"varint,3,opt,name=other,proto3,enum=api.common.OtherTime,oneof"`
}
type Time_Periods ¶
type Time_Periods struct {
Periods *Periods `protobuf:"bytes,2,opt,name=periods,proto3,oneof"`
}