Documentation ¶
Overview ¶
Package types is a generated protocol buffer package.
It is generated from these files:
types.proto
It has these top-level messages:
Posting PostingList
Index ¶
- Constants
- Variables
- func Convert(from Val, to *Val) error
- func DateIndex(val time.Time) ([]string, error)
- func DefaultIndexKeys(val string) []string
- func EarthAngle(dist float64) s1.Angle
- func FilterGeoUids(uids *task.List, values []*task.Value, q *GeoQueryData) *task.List
- func FloatIndex(val float64) ([]string, error)
- func IndexGeoTokens(g geom.T) ([]string, error)
- func IndexTokens(sv Val) ([]string, error)
- func IntIndex(val int32) ([]string, error)
- func Intersects(l1 *s2.Loop, l2 *s2.Loop) bool
- func IsGeoFunc(str string) bool
- func Less(a, b Val) bool
- func Marshal(from Val, to *Val) error
- func ObjectValue(id TypeID, value interface{}) (*graph.Value, error)
- func Sort(sID TypeID, v []Val, ul *task.List, desc bool) error
- func TimeIndex(val time.Time) ([]string, error)
- func WithinCapPolygon(g1 *s2.Loop, g2 *s2.Cap) bool
- func WithinPolygon(g1 *s2.Loop, g2 *s2.Loop) bool
- type Area
- type GeoQueryData
- type Length
- type Posting
- func (*Posting) Descriptor() ([]byte, []int)
- func (m *Posting) Marshal() (data []byte, err error)
- func (m *Posting) MarshalTo(data []byte) (int, error)
- func (*Posting) ProtoMessage()
- func (m *Posting) Reset()
- func (m *Posting) Size() (n int)
- func (m *Posting) String() string
- func (m *Posting) Unmarshal(data []byte) error
- type PostingList
- func (*PostingList) Descriptor() ([]byte, []int)
- func (m *PostingList) GetPostings() []*Posting
- func (m *PostingList) Marshal() (data []byte, err error)
- func (m *PostingList) MarshalTo(data []byte) (int, error)
- func (*PostingList) ProtoMessage()
- func (m *PostingList) Reset()
- func (m *PostingList) Size() (n int)
- func (m *PostingList) String() string
- func (m *PostingList) Unmarshal(data []byte) error
- type Posting_ValType
- type QueryType
- type TypeID
- type Val
Constants ¶
const ( // MinCellLevel is the smallest cell level (largest cell size) used by indexing MinCellLevel = 5 // Approx 250km x 380km // MaxCellLevel is the largest cell leve (smallest cell size) used by indexing MaxCellLevel = 16 // Approx 120m x 180m // MaxCells is the maximum number of cells to use when indexing regions. MaxCells = 18 )
const ( BinaryID = TypeID(Posting_BINARY) Int32ID = TypeID(Posting_INT32) FloatID = TypeID(Posting_FLOAT) BoolID = TypeID(Posting_BOOL) DateTimeID = TypeID(Posting_DATETIME) StringID = TypeID(Posting_STRING) DateID = TypeID(Posting_DATE) GeoID = TypeID(Posting_GEO) UidID = TypeID(Posting_UID) )
Note: These ids are stored in the posting lists to indicate the type of the data. The order *cannot* be changed without breaking existing data. When adding a new type *always* add to the end of this list. Never delete anything from this list even if it becomes unused.
const EarthRadiusMeters = 1000 * 6371
EarthRadiusMeters is the radius of the earth in meters (in a spherical earth model).
Variables ¶
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") )
var Posting_ValType_name = map[int32]string{
0: "STRING",
1: "BINARY",
2: "INT32",
3: "FLOAT",
4: "BOOL",
5: "DATE",
6: "DATETIME",
7: "GEO",
8: "UID",
}
var Posting_ValType_value = map[string]int32{
"STRING": 0,
"BINARY": 1,
"INT32": 2,
"FLOAT": 3,
"BOOL": 4,
"DATE": 5,
"DATETIME": 6,
"GEO": 7,
"UID": 8,
}
Functions ¶
func DefaultIndexKeys ¶
DefaultIndexKeys tokenizes data as a string and return keys for indexing.
func EarthAngle ¶ added in v0.7.1
EarthAngle converts a to distance on earth in meters to an angle
func FilterGeoUids ¶ added in v0.7.1
FilterGeoUids filters the uids based on the corresponding values and GeoQueryData.
func IndexGeoTokens ¶ added in v0.7.1
IndexTokens returns the tokens to be used in a geospatial index for the given geometry. If the geometry is not supported it returns an error.
func IndexTokens ¶ added in v0.7.1
func Intersects ¶ added in v0.7.1
Intersects returns true if the two loops intersect.
func ObjectValue ¶ added in v0.7.1
func WithinCapPolygon ¶ added in v0.7.1
TODO(Ashwin): Improve this to make it more accurate.
Types ¶
type Area ¶ added in v0.7.1
type Area float64
Area denotes an area on Earth
type GeoQueryData ¶ added in v0.7.1
type GeoQueryData struct {
// contains filtered or unexported fields
}
GeoQueryData is internal data used by the geo query filter to additionally filter the geometries.
func GetGeoTokens ¶ added in v0.7.1
func GetGeoTokens(funcArgs []string) ([]string, *GeoQueryData, error)
GetGeoTokens returns the corresponding index keys based on the type of function.
func (GeoQueryData) MatchesFilter ¶ added in v0.7.1
func (q GeoQueryData) MatchesFilter(g geom.T) bool
MatchesFilter applies the query filter to a geo value
type Length ¶ added in v0.7.1
type Length float64
Length denotes a length on Earth
func EarthDistance ¶ added in v0.7.1
EarthDistance converts an angle to distance on earth in meters.
type Posting ¶ added in v0.7.1
type Posting struct { Uid uint64 `protobuf:"fixed64,1,opt,name=uid,proto3" json:"uid,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` ValType Posting_ValType `protobuf:"varint,3,opt,name=val_type,json=valType,proto3,enum=types.Posting_ValType" json:"val_type,omitempty"` Label string `protobuf:"bytes,4,opt,name=label,proto3" json:"label,omitempty"` Commit uint64 `protobuf:"varint,5,opt,name=commit,proto3" json:"commit,omitempty"` // TODO: op is only used temporarily. See if we can remove it from here. Op uint32 `protobuf:"varint,12,opt,name=op,proto3" json:"op,omitempty"` }
func (*Posting) Descriptor ¶ added in v0.7.1
func (*Posting) ProtoMessage ¶ added in v0.7.1
func (*Posting) ProtoMessage()
type PostingList ¶ added in v0.7.1
type PostingList struct { Postings []*Posting `protobuf:"bytes,1,rep,name=postings" json:"postings,omitempty"` Checksum []byte `protobuf:"bytes,2,opt,name=checksum,proto3" json:"checksum,omitempty"` Commit uint64 `protobuf:"varint,3,opt,name=commit,proto3" json:"commit,omitempty"` }
func (*PostingList) Descriptor ¶ added in v0.7.1
func (*PostingList) Descriptor() ([]byte, []int)
func (*PostingList) GetPostings ¶ added in v0.7.1
func (m *PostingList) GetPostings() []*Posting
func (*PostingList) Marshal ¶ added in v0.7.1
func (m *PostingList) Marshal() (data []byte, err error)
func (*PostingList) MarshalTo ¶ added in v0.7.1
func (m *PostingList) MarshalTo(data []byte) (int, error)
func (*PostingList) ProtoMessage ¶ added in v0.7.1
func (*PostingList) ProtoMessage()
func (*PostingList) Reset ¶ added in v0.7.1
func (m *PostingList) Reset()
func (*PostingList) Size ¶ added in v0.7.1
func (m *PostingList) Size() (n int)
func (*PostingList) String ¶ added in v0.7.1
func (m *PostingList) String() string
func (*PostingList) Unmarshal ¶ added in v0.7.1
func (m *PostingList) Unmarshal(data []byte) error
type Posting_ValType ¶ added in v0.7.1
type Posting_ValType int32
const ( Posting_STRING Posting_ValType = 0 Posting_BINARY Posting_ValType = 1 Posting_INT32 Posting_ValType = 2 Posting_FLOAT Posting_ValType = 3 Posting_BOOL Posting_ValType = 4 Posting_DATE Posting_ValType = 5 Posting_DATETIME Posting_ValType = 6 Posting_GEO Posting_ValType = 7 Posting_UID Posting_ValType = 8 )
func (Posting_ValType) EnumDescriptor ¶ added in v0.7.1
func (Posting_ValType) EnumDescriptor() ([]byte, []int)
func (Posting_ValType) String ¶ added in v0.7.1
func (x Posting_ValType) String() string
type QueryType ¶ added in v0.7.1
type QueryType byte
QueryType indicates the type of geo query.
const ( // QueryTypeWithin finds all points that are within the given geometry QueryTypeWithin QueryType = iota // QueryTypeContains finds all polygons that contain the given point QueryTypeContains // QueryTypeIntersects finds all objects that intersect the given geometry QueryTypeIntersects // QueryTypeNear finds all points that are within the given distance from the given point. QueryTypeNear )
type TypeID ¶
type TypeID Posting_ValType
func TypeForName ¶
TypeForName returns the type corresponding to the given name. If name is not recognized, it returns nil.