{"id":13481338,"url":"https://github.com/melihmucuk/geocache","last_synced_at":"2025-08-22T05:32:14.607Z","repository":{"id":57496843,"uuid":"61626385","full_name":"melihmucuk/geocache","owner":"melihmucuk","description":"Geocache is an in-memory cache that is suitable for geolocation based applications.","archived":false,"fork":false,"pushed_at":"2016-06-21T16:53:18.000Z","size":7,"stargazers_count":144,"open_issues_count":0,"forks_count":16,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-08T23:22:33.587Z","etag":null,"topics":["cache","geocaches","geofence","geolocation","geolocation-cache","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/melihmucuk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-21T10:48:34.000Z","updated_at":"2025-02-11T21:32:40.000Z","dependencies_parsed_at":"2022-09-03T02:10:23.411Z","dependency_job_id":null,"html_url":"https://github.com/melihmucuk/geocache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/melihmucuk/geocache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melihmucuk%2Fgeocache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melihmucuk%2Fgeocache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melihmucuk%2Fgeocache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melihmucuk%2Fgeocache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/melihmucuk","download_url":"https://codeload.github.com/melihmucuk/geocache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/melihmucuk%2Fgeocache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271590359,"owners_count":24786207,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","geocaches","geofence","geolocation","geolocation-cache","golang"],"created_at":"2024-07-31T17:00:50.983Z","updated_at":"2025-08-22T05:32:14.281Z","avatar_url":"https://github.com/melihmucuk.png","language":"Go","funding_links":[],"categories":["Database","Geographic","\u003cspan id=\"数据库-database\"\u003e数据库 Database\u003c/span\u003e","位置信息与地理GEO处理库","數據庫","数据库"],"sub_categories":["Advanced Console UIs","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","SQL 查询语句构建库","高級控制台界面","高级控制台界面"],"readme":"# geocache [![GoDoc](https://godoc.org/github.com/melihmucuk/geocache?status.svg)](https://godoc.org/github.com/melihmucuk/geocache) [![Go Report Card](https://goreportcard.com/badge/melihmucuk/geocache)](https://goreportcard.com/report/melihmucuk/geocache) [![Build Status](http://img.shields.io/travis/melihmucuk/geocache.svg?style=flat)](https://travis-ci.org/melihmucuk/geocache)\n\ngeocache is an in-memory cache that is suitable for geolocation based applications. It uses geolocation as a key for storing items. You can specify range on initialization and thats it! You can store any object, it uses interface.\n\n### Installation\n\n`go get github.com/melihmucuk/geocache`\n\n### Usage\n\n![geolocation cache](http://i.imgur.com/O6UzVEW.png \"Geolocation Cache\")\n\n```go\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/melihmucuk/geocache\"\n)\n\nfunc main() {\n\tc, err := geocache.NewCache(5*time.Minute, 30*time.Second, geocache.WithIn1KM)\n\tgeoPoint := geocache.GeoPoint{Latitude: 40.9887, Longitude: 28.7817}\n\tif err != nil {\n\t\tfmt.Println(\"Error: \", err.Error())\n\t} else {\n\t\tc.Set(geoPoint, \"helloooo\", 2*time.Minute)\n\t\tv1, ok1 := c.Get(geocache.GeoPoint{Latitude: 41.2, Longitude: 29.3})\n\t\tv2, ok2 := c.Get(geocache.GeoPoint{Latitude: 41.2142, Longitude: 29.4234})\n\t\tv3, ok3 := c.Get(geocache.GeoPoint{Latitude: 40.9858, Longitude: 28.7852})\n\t\tv4, ok4 := c.Get(geocache.GeoPoint{Latitude: 40.9827, Longitude: 28.7883})\n\t\tfmt.Println(v1, ok1)\n\t\tfmt.Println(v2, ok2)\n\t\tfmt.Println(v3, ok3)\n\t\tfmt.Println(v4, ok4)\n\t}\n}\n\n```\n\noutputs:\n```\n\u003cnil\u003e, false\n\u003cnil\u003e, false\nhelloooo, true\nhelloooo, true\n```\n\n### Information\n\nYou can specify 8 different range. More info can be found [here](http://gis.stackexchange.com/questions/8650/how-to-measure-the-accuracy-of-latitude-and-longitude).\n\n* `WithIn11KM`\n\nThe first decimal place is worth up to 11.1 km `eg: 41.3, 29.6`\n\n* `WithIn1KM`\n\nThe second decimal place is worth up to 1.1 km `eg: 41.36, 29.63`\n\n* `WithIn110M`\n\nThe third decimal place is worth up to 110 m `eg: 41.367, 29.631`\n\n* `WithIn11M`\n\nThe fourth decimal place is worth up to 11 m `eg: 41.3674, 29.6316`\n\n* `WithIn1M`\n\nThe fifth decimal place is worth up to 1.1 m `eg: 41.36742, 29.63168`\n\n* `WithIn11CM`\n\nThe sixth decimal place is worth up to 0.11 m `eg: 41.367421, 29.631689`\n\n* `WithIn11MM`\n\nThe seventh decimal place is worth up to 11 mm `eg: 41.3674211, 29.6316893`\n\n* `WithIn1MM`\n\nThe eighth decimal place is worth up to 1.1 mm `eg: 41.36742115, 29.63168932`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelihmucuk%2Fgeocache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmelihmucuk%2Fgeocache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmelihmucuk%2Fgeocache/lists"}