{"id":20875004,"url":"https://github.com/servicestack/gistcafe-go","last_synced_at":"2025-03-12T16:16:03.899Z","repository":{"id":57559532,"uuid":"324690860","full_name":"ServiceStack/gistcafe-go","owner":"ServiceStack","description":"gist.cafe utils for Go","archived":false,"fork":false,"pushed_at":"2020-12-27T15:34:59.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-09T22:07:07.541Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ServiceStack.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":"2020-12-27T05:06:53.000Z","updated_at":"2020-12-27T15:35:01.000Z","dependencies_parsed_at":"2022-08-28T14:10:14.949Z","dependency_job_id":null,"html_url":"https://github.com/ServiceStack/gistcafe-go","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceStack%2Fgistcafe-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceStack%2Fgistcafe-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceStack%2Fgistcafe-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ServiceStack%2Fgistcafe-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ServiceStack","download_url":"https://codeload.github.com/ServiceStack/gistcafe-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243249011,"owners_count":20260768,"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-11-18T06:40:54.723Z","updated_at":"2025-03-12T16:16:03.878Z","avatar_url":"https://github.com/ServiceStack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Useful utils for [gist.cafe](https://gist.cafe) Go Apps.\n\n## Usage\n\nSimple usage example:\n\n```go\npackage main\n\nimport (\n\t\"encoding/json\"\n\t\"fmt\"\n\t\"io/ioutil\"\n\t\"log\"\n\t\"net/http\"\n\t\"sort\"\n\n\t\"github.com/servicestack/gistcafe-go/inspect\"\n)\n\ntype GithubRepo struct {\n\tName        string `json:\"name\"`\n\tDescription string `json:\"description\"`\n\tHomepage    string `json:\"homepage\"`\n\tLang        string `json:\"language\"`\n\tWatchers    int    `json:\"watchers_count\"`\n\tForks       int    `json:\"forks\"`\n}\n\nfunc main() {\n\torgName := \"golang\"\n\turl := fmt.Sprintf(\"https://api.github.com/orgs/%s/repos\", orgName)\n\tclient := http.Client{}\n\treq, err := http.NewRequest(http.MethodGet, url, nil)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\treq.Header.Set(\"User-Agent\", \"gist.cafe\")\n\tres, getErr := client.Do(req)\n\tif getErr != nil {\n\t\tlog.Fatal(getErr)\n\t}\n\tdefer res.Body.Close()\n\n\tbody, readErr := ioutil.ReadAll(res.Body)\n\tif readErr != nil {\n\t\tlog.Fatal(readErr)\n\t}\n\n\tvar orgRepos []GithubRepo\n\tjsonErr := json.Unmarshal(body, \u0026orgRepos)\n\tif jsonErr != nil {\n\t\tlog.Fatal(jsonErr)\n\t}\n\n\tsort.Slice(orgRepos, func(i, j int) bool {\n\t\treturn orgRepos[i].Watchers \u003e orgRepos[j].Watchers\n\t})\n\n\tinspect.PrintDump(orgRepos[0:3])\n\n\tinspect.TableOptions{Headers: []string{\"Name\", \"Lang\", \"Watchers\", \"Forks\"}}.PrintDumpTable(orgRepos[0:10])\n\n\tinspect.Vars(map[string]interface{}{\"orgRepos\": orgRepos})\n}\n```\n\nWhich outputs:\n\n```\n[\n    {\n        name: go,\n        description: The Go programming language,\n        homepage: https://golang.org,\n        language: Go,\n        watchers_count: 80228,\n        forks: 11669\n    },\n    {\n        name: groupcache,\n        description: groupcache is a caching and cache-filling library, intended as a replacement for memcached in many cases.,\n        homepage: ,\n        language: Go,\n        watchers_count: 9556,\n        forks: 1086\n    },\n    {\n        name: protobuf,\n        description: Go support for Google's protocol buffers,\n        homepage: ,\n        language: Go,\n        watchers_count: 7311,\n        forks: 1348\n    }\n]\n+------------+------+----------+-------+\n|    NAME    | LANG | WATCHERS | FORKS |\n+------------+------+----------+-------+\n| go         | Go   |    80228 | 11669 |\n| groupcache | Go   |     9556 |  1086 |\n| protobuf   | Go   |     7311 |  1348 |\n| mock       | Go   |     4996 |   395 |\n| tools      | Go   |     4824 |  1637 |\n| mobile     | Go   |     4377 |   560 |\n| lint       | Go   |     3764 |   504 |\n| oauth2     | Go   |     3423 |   715 |\n| glog       | Go   |     2634 |   720 |\n| net        | Go   |     2254 |   915 |\n+------------+------+----------+-------+\n```\n\nWhilst `inspect.vars()` lets you view variables in [gist.cafe](https://gist.cafe) viewer:\n\n![](https://raw.githubusercontent.com/ServiceStack/gist-cafe/main/docs/images/vars-orgRepos-nodejs.png)\n\nView and execute Dart gists with [gist.cafe](https://gist.cafe), e.g: [gist.cafe/58d4e2d53d8982ae108198e91fee4a69](https://gist.cafe/58d4e2d53d8982ae108198e91fee4a69).\n\n## Features and bugs\n\nPlease file feature requests and bugs at the [issue tracker](https://github.com/ServiceStack/gistcafe-node/issues).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fservicestack%2Fgistcafe-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fservicestack%2Fgistcafe-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fservicestack%2Fgistcafe-go/lists"}