{"id":17726634,"url":"https://github.com/thedevsaddam/snapshot","last_synced_at":"2025-03-14T06:32:26.032Z","repository":{"id":57496634,"uuid":"98566113","full_name":"thedevsaddam/snapshot","owner":"thedevsaddam","description":"Robust, Persistent, Key-Value (KV) store purely written in Golang","archived":false,"fork":false,"pushed_at":"2019-08-25T01:43:06.000Z","size":8,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-20T17:33:49.841Z","etag":null,"topics":["go-key-value","golang-key-value","key-value-database","key-value-store","kv"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/thedevsaddam/snapshot","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/thedevsaddam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-27T17:59:46.000Z","updated_at":"2024-06-20T17:33:49.841Z","dependencies_parsed_at":"2022-08-28T17:50:59.642Z","dependency_job_id":null,"html_url":"https://github.com/thedevsaddam/snapshot","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedevsaddam%2Fsnapshot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedevsaddam%2Fsnapshot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedevsaddam%2Fsnapshot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thedevsaddam%2Fsnapshot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thedevsaddam","download_url":"https://codeload.github.com/thedevsaddam/snapshot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243538060,"owners_count":20307100,"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":["go-key-value","golang-key-value","key-value-database","key-value-store","kv"],"created_at":"2024-10-25T17:06:20.633Z","updated_at":"2025-03-14T06:32:23.761Z","avatar_url":"https://github.com/thedevsaddam.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Snapshot\n\n\n[![Build Status](https://travis-ci.org/thedevsaddam/snapshot.svg?branch=master)](https://travis-ci.org/thedevsaddam/snapshot)\n![Project status](https://img.shields.io/badge/version-0.1-green.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/thedevsaddam/snapshot)](https://goreportcard.com/report/github.com/thedevsaddam/snapshot)\n[![GoDoc](https://godoc.org/github.com/thedevsaddam/govalidator?status.svg)](https://godoc.org/github.com/thedevsaddam/snapshot)\n![License](https://img.shields.io/dub/l/vibe-d.svg)\n\nRobust, Persistent, Key-Value (KV) store purely written in Golang\n\n### Installation\n```bash\n$ go get github.com/thedevsaddam/snapshot\n```\n\n### Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/thedevsaddam/snapshot\"\n\t\"time\"\n)\n\n//make a type to use\ntype User struct {\n\tName, Occupation string\n\tCreatedAt        time.Time\n}\n\nfunc main() {\n\n\t//create a snapshot collection\n\tuserCollection, err := snapshot.New(\"users\")\n\tif err != nil {\n\t\tfmt.Println(err)\n\t}\n\n\t//add item to collection\n\tuserCollection.Put(\"john\", User{Name: \"John Doe\", Occupation: \"Software Engineer\", CreatedAt: time.Now()})\n\tuserCollection.Put(\"jane\", User{Name: \"Jane Doe\", Occupation: \"UI/UX Designer\", CreatedAt: time.Now()})\n\n\t//get an item from collection\n\tjohn := User{}\n\tuserCollection.Get(\"john\", \u0026john)\n\tfmt.Printf(\"%s is a %s\\n\", john.Name, john.Occupation) //John Doe is a Software Engineer\n\n\t//check an item is exist in a collection\n\tfmt.Println(userCollection.Has(\"john\")) //true\n\tfmt.Println(userCollection.Has(\"tom\"))  //false\n\n\t//get all the item keys list\n\tfmt.Println(userCollection.List())\n\n\t//get total item count\n\tfmt.Println(userCollection.TotalItem())\n\n\t//remove a key from collection\n\tuserCollection.Remove(\"john\")\n\n\t//remove all the keys with collection\n\tuserCollection.Flush()\n\n}\n\n```\n\n\n### License\nThe **snapshot** is a open-source software licensed under the [MIT License](LICENSE.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedevsaddam%2Fsnapshot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthedevsaddam%2Fsnapshot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthedevsaddam%2Fsnapshot/lists"}