{"id":17116450,"url":"https://github.com/dakimura/memctag","last_synced_at":"2025-03-24T00:52:25.846Z","repository":{"id":57751477,"uuid":"177688141","full_name":"dakimura/memctag","owner":"dakimura","description":"memcached client which can set tag(s) and delete by tag","archived":false,"fork":false,"pushed_at":"2019-03-26T08:03:44.000Z","size":5,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T07:26:55.948Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/dakimura.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":"2019-03-26T00:52:15.000Z","updated_at":"2019-04-20T04:32:20.000Z","dependencies_parsed_at":"2022-08-26T09:00:10.211Z","dependency_job_id":null,"html_url":"https://github.com/dakimura/memctag","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakimura%2Fmemctag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakimura%2Fmemctag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakimura%2Fmemctag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dakimura%2Fmemctag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dakimura","download_url":"https://codeload.github.com/dakimura/memctag/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245191621,"owners_count":20575248,"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-10-14T17:48:52.888Z","updated_at":"2025-03-24T00:52:25.823Z","avatar_url":"https://github.com/dakimura.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About\nThis is a memcached client library which can set tag(s) and delete by tag\n\n## Installing\n\n### Using *go get*\n\n    $ go get github.com/dakimura/memctag/memcache\n\n## Usage\n\n    package main\n\n    import (\n        \"fmt\"\n        \"github.com/bradfitz/gomemcache/memcache\"\n        memcacheWithTag \"github.com/dakimura/memctag/memcache\"\n    )\n\n\n    func main(){\n        // initialize memcached client\n        mc := memcacheWithTag.NewClient(\"127.0.0.1:11211\")\n\n        tags := []string{\"1-tag\", \"2-tag\"}\n        tag := []string{\"1-tag\"}\n\n        item := memcache.Item{Key: \"1:message\", Value: []byte(\"cache1\")}\n        item2 := memcache.Item{Key: \"2:message\", Value: []byte(\"cache2\")}\n        item3 := memcache.Item{Key: \"3:message\", Value: []byte(\"cache3\")}\n\n        // set cache with tag(s)\n        mc.SetWithTags(\u0026item, tags)\n        mc.SetWithTags(\u0026item2, tags)\n        mc.SetWithTags(\u0026item3, tag)\n\n        printCache(mc.GetWithTags(\"1:message\", tags)) //\"1-tag\", \"2-tag\"\n        printCache(mc.GetWithTags(\"2:message\", tags)) //\"1-tag\", \"2-tag\"\n        printCache(mc.GetWithTags(\"3:message\", tag))  //\"1-tag\"\n\n        // you can delete all caches which have been set with the tag\n        mc.Delete(\"2-tag\")\n\n        printCache(mc.GetWithTags(\"1:message\", tags)) // -\u003e cache miss\n        printCache(mc.GetWithTags(\"2:message\", tags)) // -\u003e cache miss\n        printCache(mc.GetWithTags(\"3:message\", tag))  // -\u003e \"cache3\"\n\n        // also you can delete it by the cache key\n        mc.Delete(\"3:message\")\n        printCache(mc.GetWithTags(\"3:message\", tag))\n\n    }\n\n    func printCache(item *memcache.Item, err error) {\n        if err != nil {\n            fmt.Println(err.Error())\n        } else {\n            fmt.Println(string(item.Value))\n        }\n    }\n\n## gomemcache functionalities\nThis library is a wrapper of gomemcache. You can use all functionalities in gomemcache.\n\nSee https://godoc.org/github.com/bradfitz/gomemcache/memcache\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdakimura%2Fmemctag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdakimura%2Fmemctag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdakimura%2Fmemctag/lists"}