{"id":13366919,"url":"https://github.com/Gosuri/Go-store","last_synced_at":"2025-03-12T18:31:35.272Z","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-03-10T22:36:36.323Z","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,"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","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243271329,"owners_count":20264438,"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","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-30T00:01:34.175Z","updated_at":"2025-03-12T18:31:34.945Z","avatar_url":"https://github.com/gosuri.png","language":"Go","funding_links":[],"categories":["ORM"],"sub_categories":["高级控制台界面","高級控制台界面"],"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"}