Documentation ¶
Index ¶
- Constants
- Variables
- func BuildIndexBuckets() error
- func CalculateAndStoreStatsByDateAndSpanStepping(t time.Time, spanStep, spanOverall time.Duration) error
- func CloseGZ(f F)
- func DeleteTestes() error
- func ExportPostGIS()
- func Float64bytesBig(float float64) []byte
- func Float64frombytesBig(bytes []byte) float64
- func GetDB(name string) *bolt.DB
- func GetMelody() *melody.Melody
- func GetQT() *quadtree.QuadTree
- func GetStats(t time.Time, d time.Duration) ([]byte, error)
- func InitBoltDB() error
- func InitMelody()
- func InitQT() error
- func NewQuery() *query
- func NewRouter() *mux.Router
- func RandStringRunes(n int) string
- func SetDBPath(whichdb, pathto string)
- func SetDevopLock(pathto string)
- func SetEdgeLock(pathto string)
- func SetForwardPopulate(arguments string)
- func SetLiveTracksGZ(pathto string)
- func SetLiveTracksGZDevop(pathto string)
- func SetLiveTracksGZEdge(pathto string)
- func SetMasterLock(pathto string)
- func SetPlacesLayer(b bool)
- func SetTestes(flagOption bool)
- func TrackToFeature(trackPointCurrent *trackPoint.TrackPoint) *geojson.Feature
- func TrackToPlace(tp *trackPoint.TrackPoint, visit note.NoteVisit) *geojson.Feature
- type F
- type IftttBodyCatVisit
- type LastKnown
- type Metadata
- type QueryFilterGoogleNearbyPhotos
- type QueryFilterPlaces
- type Route
- type Routes
- type VisitsResponse
Constants ¶
const ( DefaultEpsilon = 0.001 DefaultLimit = 1000 )
Variables ¶
var FeaturePlaceChan = make(chan *geojson.Feature, 100000)
var NotifyNewEdge = make(chan bool, 1000)
var NotifyNewPlace = make(chan bool, 1000)
Functions ¶
func BuildIndexBuckets ¶
func BuildIndexBuckets() error
BuildIndexBuckets populates name, lat, and long buckets from main "tracks" (time) bucket.
func CalculateAndStoreStatsByDateAndSpanStepping ¶
func CalculateAndStoreStatsByDateAndSpanStepping(t time.Time, spanStep, spanOverall time.Duration) error
NOTE: spanStep should be +, spanOverall can be +/- where '-' means backward-looking and '+' means forward looking relative to time t
func DeleteTestes ¶
func DeleteTestes() error
DeleteTestes wipes the entire database of all points with names prefixed with testes prefix. Saves an rm keystorke
func ExportPostGIS ¶
func ExportPostGIS()
func Float64bytesBig ¶
func Float64frombytesBig ¶
func InitBoltDB ¶
func InitBoltDB() error
InitBoltDB sets up initial stuff, like the file and necesary buckets
func InitMelody ¶
func InitMelody()
InitMelody sets up the websocket handler which currently only handles the dilapidated QT (QuadTree) business. Can probably safely be removed.
func InitQT ¶
func InitQT() error
InitQT initializes quadtree by iterating through all points and inserting them into in-memory (yikes!) qt
func RandStringRunes ¶
func SetDevopLock ¶
func SetDevopLock(pathto string)
func SetEdgeLock ¶
func SetEdgeLock(pathto string)
func SetForwardPopulate ¶
func SetForwardPopulate(arguments string)
SetForwardPopulate sets the 'downstream' urls that should be forwarded any request that this client receives for populating points. Forward requests will be sent as POST requests in identical JSON as they are received. NOTE that forwardPopulate is a []string, so all uri's should be given in comma-separated format.
func SetLiveTracksGZ ¶
func SetLiveTracksGZ(pathto string)
func SetLiveTracksGZDevop ¶
func SetLiveTracksGZDevop(pathto string)
func SetLiveTracksGZEdge ¶
func SetLiveTracksGZEdge(pathto string)
func SetMasterLock ¶
func SetMasterLock(pathto string)
func SetPlacesLayer ¶
func SetPlacesLayer(b bool)
func TrackToFeature ¶
func TrackToFeature(trackPointCurrent *trackPoint.TrackPoint) *geojson.Feature
func TrackToPlace ¶
func TrackToPlace(tp *trackPoint.TrackPoint, visit note.NoteVisit) *geojson.Feature
Types ¶
type IftttBodyCatVisit ¶
type LastKnown ¶
type LastKnown map[string]*trackPoint.TrackPoint
type QueryFilterGoogleNearbyPhotos ¶
type QueryFilterGoogleNearbyPhotos struct {
PhotoReference string `schema:"photoreference"`
}
type QueryFilterPlaces ¶
type QueryFilterPlaces struct { Uuids []string `schema:"uuids"` Names []string `schema:"names"` // start,end x arrive,depart,report StartArrivalT time.Time `schema:"startArrivalT"` EndArrivalT time.Time `schema:"endArrivalT"` StartDepartureT time.Time `schema:"startDepartureT"` EndDepartureT time.Time `schema:"endDepartureT"` StartReportedT time.Time `schema:"startReportedT"` EndReportedT time.Time `schema:"endReportedT"` ReverseChrono bool `schema:"rc"` // when true, oldest first; default to newest first // paginatables StartIndex int `schema:"startI"` // 0 indexed; EndIndex int `schema:"endI"` // diff end-start = per/pagination lim // for geo rect bounding, maybe LatMin *float64 `schema:"latmin"` LatMax *float64 `schema:"latmax"` LngMin *float64 `schema:"lngmin"` LngMax *float64 `schema:"lngmax"` BoundingBoxSW []float64 `schema:"bboxSW"` BoundingBoxNE []float64 `schema:"bboxNE"` IncludeStats bool `schema:"stats,omitempty"` GoogleNearby bool `schema:"googleNearby"` GoogleNearbyPhotos bool `schema:"googleNearbyPhotos"` }
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
type VisitsResponse ¶
type VisitsResponse struct { Visits []*note.NoteVisit `json:"visits"` Stats bolt.BucketStats `json"bucketStats,omitempty"` StatsTook time.Duration `json:"statsTook,omitempty"` // how long took to get bucket stats (for 10mm++ points, long time) Scanned int `json:"scanned"` // num visits checked before mtaching filters Matches int `json:"matches"` // num visits matching before paging/index filters }