city

package
v0.0.0-...-14e87fa Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2017 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type City

type City struct {
	Id       bson.ObjectId `json:"id" bson:"_id,omitempty"`
	Name     string        `json:"name"`
	District int           `json:"district"`
	Location GeoJson       `json:"location"`
}

func (*City) AllDistrict

func (c *City) AllDistrict(city string) ([]City, error)

func (*City) CreateIndex

func (c *City) CreateIndex(collectionName string) error

func (*City) GetConn

func (c *City) GetConn(mongoConnection *mgo.Session, redisConnection *redis.Client)

func (*City) GetNearestDistrict

func (c *City) GetNearestDistrict(cityName string, lat, lon float64, distance int64) (City, error)

get Near district in the city with given distance in meters

func (*City) InsertDistrict

func (c *City) InsertDistrict(city string, distric int, lat, lon float64) error

Inserting district to mongo database

func (*City) InsertLocationsBulk

func (c *City) InsertLocationsBulk(collectionName string, datas []interface{}) error

type GeoJson

type GeoJson struct {
	Type        string    `json:"type"`
	Coordinates []float64 `json:"coordinates"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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