{"id":17684355,"url":"https://github.com/shgopher/short","last_synced_at":"2025-05-12T21:23:01.438Z","repository":{"id":57643368,"uuid":"248777130","full_name":"shgopher/short","owner":"shgopher","description":"URL shortening service. 高性能短链接服务。","archived":false,"fork":false,"pushed_at":"2023-05-25T20:38:22.000Z","size":61,"stargazers_count":18,"open_issues_count":0,"forks_count":7,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-20T18:38:39.566Z","etag":null,"topics":["docker","gin","go","go-micro","k8s","mysql","redis","rocketmq","shortening-urls","url","vue"],"latest_commit_sha":null,"homepage":"","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/shgopher.png","metadata":{"files":{"readme":"README.md","changelog":"history.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-20T14:35:21.000Z","updated_at":"2024-09-17T04:20:03.000Z","dependencies_parsed_at":"2024-06-20T05:58:06.174Z","dependency_job_id":null,"html_url":"https://github.com/shgopher/short","commit_stats":null,"previous_names":["googege/short"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shgopher%2Fshort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shgopher%2Fshort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shgopher%2Fshort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shgopher%2Fshort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shgopher","download_url":"https://codeload.github.com/shgopher/short/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253823785,"owners_count":21969911,"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":["docker","gin","go","go-micro","k8s","mysql","redis","rocketmq","shortening-urls","url","vue"],"created_at":"2024-10-24T10:05:07.776Z","updated_at":"2025-05-12T21:23:01.418Z","avatar_url":"https://github.com/shgopher.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# short\n\nURL shortening service.\n\n## Usage\n[example](./example/example.go)\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/golang/glog\"\n\t\"github.com/googege/short\"\n\t\"os\"\n)\n\nvar (\n\tpath    = \"https://t.cn/\"\n\tlongURL = \"https://github.com/googege/GOFamily/blob/master/%E5%9F%BA%E7%A1%80%E7%9F%A5%E8%AF%86/%E7%AE%97%E6%B3%95/%E7%AE%97%E6%B3%95%E9%A2%98/leetcode/1.md\"\n)\n\nfunc main() {\n\tdb := short.NewMapDB()\n\t// add db engine to short.\n\ts := short.NewShort(db)\n\t//\n\tshortURL, err := s.ShortAdd(longURL)\n\tif err != nil {\n\t\tglog.Error(err)\n\t} else {\n\t\tfmt.Println(shortURL)\n\t}\n\t//\n\tlongURL, err = s.ShortFind(path + shortURL)\n\t// if http\n\t//http.Redirect(nil,nil,longURL,302\n\t//)\n\tif err != nil {\n\t\tglog.Error(err)\n\t} else {\n\t\tfmt.Println(\"longURL:\", longURL)\n\t}\n\t//\n\tshortURL, err = s.ShortFind(\"a\")\n\tif err != nil {\n\t\tglog.Error(err)\n\t} else {\n\t\tfmt.Println(\"short: \", shortURL)\n\t}\n\t//\n\tfile, err := os.Getwd()\n\tif err != nil {\n\t\tglog.Error(err)\n\t}\n\tif err = s.SetQR(path, 256, file+\"/text.png\"); err != nil {\n\t\tglog.Error(err)\n\t}\n}\n\n\n```\n\n## HERE\n微信公众号：科科人神\n\n关注我了解更多软件知识。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshgopher%2Fshort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshgopher%2Fshort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshgopher%2Fshort/lists"}