{"id":13413673,"url":"https://github.com/gosuri/go-store","last_synced_at":"2025-09-02T00:42:38.128Z","repository":{"id":29143866,"uuid":"32673998","full_name":"gosuri/go-store","owner":"gosuri","description":"A simple and fast Redis backed key-value store library for Go","archived":false,"fork":false,"pushed_at":"2017-02-23T15:11:42.000Z","size":156,"stargazers_count":113,"open_issues_count":1,"forks_count":9,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-08-30T09:32:02.113Z","etag":null,"topics":[],"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/gosuri.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.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":"2015-03-22T12:07:29.000Z","updated_at":"2025-02-26T03:33:28.000Z","dependencies_parsed_at":"2022-09-26T17:41:23.337Z","dependency_job_id":null,"html_url":"https://github.com/gosuri/go-store","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/gosuri/go-store","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuri%2Fgo-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuri%2Fgo-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuri%2Fgo-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuri%2Fgo-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gosuri","download_url":"https://codeload.github.com/gosuri/go-store/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gosuri%2Fgo-store/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273213950,"owners_count":25065059,"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-09-01T02:00:09.058Z","response_time":120,"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":[],"created_at":"2024-07-30T20:01:46.085Z","updated_at":"2025-09-02T00:42:38.088Z","avatar_url":"https://github.com/gosuri.png","language":"Go","funding_links":[],"categories":["ORM","\u003cspan id=\"orm\"\u003eORM\u003c/span\u003e","网络相关库","Relational Databases"],"sub_categories":["HTTP Clients","HTTP客户端","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","ORM","Advanced Console UIs","OpenGL","交流"],"readme":"store [![GoDoc](https://godoc.org/github.com/gosuri/go-store?status.svg)](https://godoc.org/github.com/gosuri/go-store) [![Build Status](https://travis-ci.org/gosuri/go-store.svg?branch=master)](https://travis-ci.org/gosuri/go-store)\n=======\n\nstore is a data-store library for [Go](http://golang.org) that provides a set of platform-independent interfaces to persist and retrieve data.\n\nIts primary goal is to wrap existing implementations of such primitives, such as those in package redis, into shared public interfaces that abstract functionality, plus some other related primitives.\n\nIt currently supports [Redis](http://redis.io) from the [redis](redis/) package.\n\n**NOTE**: This library is currently under **active development** and not ready for production use.\n\nExample\n-------\n\nThe below example stores, lists and fetches the saved records\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  \"github.com/gosuri/go-store/redis\"\n)\n\ntype hacker struct {\n  Id        string\n  Name      string\n  Birthyear int\n}\n\nfunc (h *hacker) Key() string {\n  return h.Id\n}\n\nfunc (h *hacker) SetKey(k string) {\n  h.Id = k\n}\n\nfunc main() {\n  store, err := redis.NewStore(\"\", \"\")\n  if err != nil {\n    panic(err) // handle error\n  }\n\n  // Save a hacker in the store with a auto-generated uuid\n  if err := store.Write(\u0026hacker{Name: \"Alan Turing\", Birthyear: 1912}); err != nil {\n    panic(err) // handle error\n  }\n\n  var hackers []hacker\n  // Populate hackers slice with ids of all hackers in the store\n  store.List(\u0026hackers)\n\n  alan := hackers[0]\n  store.Read(\u0026alan)\n  fmt.Println(\"Hello,\", alan.Name)\n\n  fmt.Println(\"Listing all\", len(hackers), \"hackers\")\n  // Fetches all hackers with names from the store\n  store.ReadMultiple(hackers)\n  for _, h := range hackers {\n    fmt.Printf(\"%s (%d) (%s)\\n\", h.Name, h.Birthyear, h.Id)\n  }\n}\n```\n\nRoadmap\n-------\n\nBelow are items I am and plan on working on in the near future. Contributions are welcome.\n\nFeature | Status\n--- | ---\nSave multiple records in a single call using pipelining | **implementing**\nQuery (using finders) and indexing |\n\nContributing\n------------\n\n### Dependency management\n\nUsers who import `store` into their package main are responsible to organize and maintain all of their dependencies to ensure code compatibility and build reproducibility.\nStore makes no direct use of dependency management tools like [Godep](https://github.com/tools/godep).\n\nWe will use a variety of continuous integration providers to find and fix compatibility problems as soon as they occur.\n\nRunning Testing\n----------------\n\n```\n$ make test\n```\n\nBenchmarks\n----------\n\n```\n$ make benchmark\n...\nBenchmarkRedisWrite      10000  104302 ns/op\nBenchmarkRead            20000  65870 ns/op\nBenchmarkRead1k          20     67325041 ns/op\nBenchmarkRedisList1k     50     27598338 ns/op\nBenchmarkRedisList10k    30     71845057 ns/op\nBenchmarkReadMultiple1k  200    7453783 ns/op\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgosuri%2Fgo-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgosuri%2Fgo-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgosuri%2Fgo-store/lists"}