{"id":37125303,"url":"https://github.com/faoztas/gocache","last_synced_at":"2026-01-14T14:29:25.469Z","repository":{"id":57649191,"uuid":"445817730","full_name":"faoztas/gocache","owner":"faoztas","description":"in-memory cache project","archived":false,"fork":false,"pushed_at":"2022-01-09T01:11:23.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T02:10:33.077Z","etag":null,"topics":["cache","go","golang","inmemory-cache"],"latest_commit_sha":null,"homepage":"https://gocache.herokuapp.com/","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/faoztas.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":"2022-01-08T12:49:02.000Z","updated_at":"2022-01-09T01:12:47.000Z","dependencies_parsed_at":"2022-09-21T13:51:38.559Z","dependency_job_id":null,"html_url":"https://github.com/faoztas/gocache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/faoztas/gocache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faoztas%2Fgocache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faoztas%2Fgocache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faoztas%2Fgocache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faoztas%2Fgocache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/faoztas","download_url":"https://codeload.github.com/faoztas/gocache/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/faoztas%2Fgocache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28423186,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T13:30:50.153Z","status":"ssl_error","status_checked_at":"2026-01-14T13:29:08.907Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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","go","golang","inmemory-cache"],"created_at":"2026-01-14T14:29:24.847Z","updated_at":"2026-01-14T14:29:25.452Z","avatar_url":"https://github.com/faoztas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoCache [![Go Report Card][report-card-img]][report-card] [![Go 1.17+][go-card-img]][go-card] [![MIT license][license-card-img]][license-card]\n[report-card]: https://goreportcard.com/report/github.com/faoztas/gocache\n[report-card-img]: https://goreportcard.com/badge/github.com/faoztas/gocache\n[go-card]: https://golang.org/dl/\n[go-card-img]: https://img.shields.io/badge/go-1.17-5.svg\n[license-card]: https://opensource.org/licenses/MIT\n[license-card-img]: https://img.shields.io/badge/license-MIT-brightgreen.svg\n\nGoCache is an in-memory cache project. GoCache has an RWMutex and endless storage Job. GoCache is written with the go standard library.\n\nto try: [GoCache](https://gocache.herokuapp.com/)\n\n### Prerequisites\n\n* Go 1.17+\n\n## Installation\n\nYou can clone this repo, then Run and Build.\n\n```bash\n$ cd $GOPATH\n$ mkdir github.com\n$ cd github.com\n$ git clone https://github.com/faoztas/gocache.git\n$ cd gocache                # env.json template is filled.\n$ go mod tidy               # This command allows you to fetch all the dependencies that you need for testing in your module.\n$ go build -o gocache       # Or $ go run .\n$ ./gocache\n```\n\n## API Usage\n\n### Get Key\n\nReturn JSON data from cache about value by key.\n\n**Request:**\n\n```\nGET {{url}}/get?key=hello\n```\n\n**Response:** 200 OK\n\n```json\n{\n  \"data\": \"world!\",\n  \"message\": \"\"\n}\n```\n\n**Response:** 400 Bad Request\n\n```json\n{\n  \"data\": null,\n  \"message\": \"missing key\"\n}\n```\n\n**Response:** 404 Not Found\n\n```json\n{\n  \"data\": null,\n  \"message\": \"record not found\"\n}\n```\n\n### Set Key\n\nSave value by key. Return JSON data from cache about value by key.\n\n**Request:**\n\n```\nPOST {{url}}/set?key=hello\n```\n\n**Request Body:**\n\n```\nworld!\n```\n\n**Response:** 200 OK\n\n```json\n{\n  \"data\": \"world!\",\n  \"message\": \"\"\n}\n```\n\n**Response:** 400 Bad Request\n\n```json\n{\n  \"data\": null,\n  \"message\": \"missing key\"\n}\n```\n\n### Delete Key\n\nReturn JSON data about delete status by key.\n\n**Request:**\n\n```\nDELETE {{url}}/delete?key=hello\n```\n\n**Response:** 200 OK\n\n```json\n{\n  \"data\": true,\n  \"message\": \"\"\n}\n```\n\n**Response:** 400 Bad Request\n\n```json\n{\n  \"data\": null,\n  \"message\": \"missing key\"\n}\n```\n\n**Response:** 404 Not Found\n\n```json\n{\n  \"data\": null,\n  \"message\": \"record not found\"\n}\n```\n\n### Flush Keys\n\nReturn JSON data about flush status.\n\n**Request:**\n\n```\nDELETE {{url}}/flush\n```\n\n**Response:** 200 OK\n\n```json\n{\n  \"data\": true,\n  \"message\": \"\"\n}\n```\n\n### General Errors\n\nUsing wrong method\n\n**Request:**\n\n```\nGET {{url}}/flush\n```\n\n**Response:** 404 Not Found\n\n```json\n{\n  \"data\": null,\n  \"message\": \"prefix /flush not found in GET method\"\n}\n```\n\nUsing wrong path\n\n**Request:**\n\n```\nGET {{url}}/\n```\n\n**Response:** 404 Not Found\n\n```json\n{\n  \"data\": null,\n  \"message\": \"not found\"\n}\n```\n\n## Docker\n\n**build:**\n\n```bash\n$ docker build . -t gocache\n```\n\n**run:**\n\n```bash\n$ docker run -dp 8000:8000 -i -t gocache\n```\n\n## Test\n\nRun the tests\n\n```bash\n$ go test ./... -v\n$ go test -cover ./... -v  # run tests with code coverage\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaoztas%2Fgocache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffaoztas%2Fgocache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffaoztas%2Fgocache/lists"}