{"id":21423282,"url":"https://github.com/teng231/dumbcache","last_synced_at":"2026-01-19T09:34:45.382Z","repository":{"id":57631755,"uuid":"410252170","full_name":"teng231/dumbcache","owner":"teng231","description":"Simple cache list, count data using redis for microservice.","archived":false,"fork":false,"pushed_at":"2022-06-06T08:25:32.000Z","size":36,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-14T09:12:23.266Z","etag":null,"topics":["cache-control","distributed-storage","golang","redis"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teng231.png","metadata":{"files":{"readme":"README.MD","changelog":"CHANGELOGS.MD","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":"2021-09-25T11:16:27.000Z","updated_at":"2021-11-01T03:07:00.000Z","dependencies_parsed_at":"2022-09-04T22:34:29.119Z","dependency_job_id":null,"html_url":"https://github.com/teng231/dumbcache","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/teng231/dumbcache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teng231%2Fdumbcache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teng231%2Fdumbcache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teng231%2Fdumbcache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teng231%2Fdumbcache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teng231","download_url":"https://codeload.github.com/teng231/dumbcache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teng231%2Fdumbcache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565001,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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-control","distributed-storage","golang","redis"],"created_at":"2024-11-22T21:15:48.221Z","updated_at":"2026-01-19T09:34:41.278Z","avatar_url":"https://github.com/teng231.png","language":"Go","readme":"# Dumbcache\n[![Go](https://github.com/teng231/dumbcache/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/teng231/dumbcache/actions/workflows/go.yml)\n[![Go Reference](https://pkg.go.dev/badge/github.com/princjef/gomarkdoc.svg)](https://pkg.go.dev/github.com/teng231/dumbcache)\n\nCache list, count with filter param golang, using struct, hashkey\n\n### Structure\n\nwe hash your request object to md5 hashing and add a prefix count or list.\ndata storage to redis using get/set with expire time.(default by 2 mins)\n\n\n### Installing\n\n```bash\ngo get github.com/teng231/dumbcache\n```\n\n### Example\n* LIST\n``` go\nfunc ListData() {\n\td := \u0026DumbCache{}\n\terr := d.Connect(\"localhost:6379\", \"\", 0, 5*time.Second, 5*time.Minute)\n\tif err != nil {\n\t\tlog.Print(1, err)\n\t}\n\tdata := []*Partner{}\n\terr = d.List(\u0026PartnerRequest{Id: 10, Limit: 2}, \u0026data, func() (interface{}, error) {\n        list, err := db.ListPartners(req)\n\t\treturn list, err\n\t})\n\tif err != nil {\n\t\tlog.Print(err)\n\t}\n\tlog.Print(data)\n}\n```\n\n* Count\n``` go\nfunc CountData(t *testing.T) {\n\td := \u0026DumbCache{}\n\terr := d.Connect(\"localhost:6379\", \"\", 0, 5*time.Second, 5*time.Minute)\n\tif err != nil {\n\t\tlog.Print(1, err)\n\t}\n\tvar c int64 = 0\n\terr = d.Count(\u0026PartnerRequest{Id: 10, Limit: 3}, \u0026c, func() (int64, error) {\n\t\tcount, err := db.CountPartners(req)\n\t\treturn count, err\n\t})\n\tif err != nil {\n\t\tlog.Print(err)\n\t}\n\tlog.Print(c)\n}\n```\n* CalcInt\n``` go\nfunc CalcData(t *testing.T) {\n\td := \u0026DumbCache{}\n\terr := d.Connect(\"localhost:6379\", \"\", 0, 5*time.Second, 5*time.Minute)\n\tif err != nil {\n\t\tlog.Print(1, err)\n\t}\n\tvar c int64 = 0\n\terr = d.CalcInt(\u0026PartnerRequest{Id: 10, Limit: 3}, \u0026c, func() (int64, error) {\n\t\tcount, err := db.SumPartners(req)\n\t\treturn count, err\n\t})\n\tif err != nil {\n\t\tlog.Print(err)\n\t}\n\tlog.Print(c)\n}\n```\n\n* Expire\n``` go\nfunc Expire() {\n\td := \u0026DumbCache{}\n\terr := d.Connect(\"localhost:6379\", \"\", 0, 5*time.Second, 5*time.Minute)\n\tif err != nil {\n\t\tlog.Print(1, err)\n\t}\n\tvar c int64 = 0\n\terr = d.Expire(\u0026PartnerRequest{Id: 10, Limit: 3})\n\tif err != nil {\n\t\tlog.Print(err)\n\t}\n\tlog.Print(c)\n}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteng231%2Fdumbcache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteng231%2Fdumbcache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteng231%2Fdumbcache/lists"}