{"id":13413509,"url":"https://github.com/Wing924/hostutils","last_synced_at":"2025-03-14T19:32:30.154Z","repository":{"id":32528674,"uuid":"104833107","full_name":"Wing924/hostutils","owner":"Wing924","description":"A golang library for packing and unpacking hosts list","archived":false,"fork":false,"pushed_at":"2024-06-05T02:09:44.000Z","size":36,"stargazers_count":13,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T06:46:28.763Z","etag":null,"topics":["go","golang","golang-package","utility"],"latest_commit_sha":null,"homepage":null,"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/Wing924.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-26T03:47:32.000Z","updated_at":"2024-12-20T15:01:43.000Z","dependencies_parsed_at":"2024-06-19T01:52:26.879Z","dependency_job_id":"20f86716-2d83-4464-a54f-c1c13f9d7274","html_url":"https://github.com/Wing924/hostutils","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/Wing924%2Fhostutils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wing924%2Fhostutils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wing924%2Fhostutils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wing924%2Fhostutils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wing924","download_url":"https://codeload.github.com/Wing924/hostutils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243635500,"owners_count":20322950,"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","golang","golang-package","utility"],"created_at":"2024-07-30T20:01:41.983Z","updated_at":"2025-03-14T19:32:29.834Z","avatar_url":"https://github.com/Wing924.png","language":"Go","readme":"# hostutils\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Go Report Card](https://goreportcard.com/badge/github.com/Wing924/hostutils/v2)](https://goreportcard.com/report/github.com/Wing924/hostutils/v2)\n[![codecov](https://codecov.io/gh/Wing924/hostutils/branch/master/graph/badge.svg)](https://codecov.io/gh/Wing924/hostutils)\n[![GoDoc](https://godoc.org/github.com/Wing924/hostutils/v2?status.svg)](https://pkg.go.dev/github.com/Wing924/hostutils/v2)\n\nA golang library for packing and unpacking hosts list\n\n## Install\n\n```bash\ngo get github.com/Wing924/hostutils/v2\n```\n\n## Examples\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n\n    \"github.com/Wing924/hostutils/v2\"\n)\n\nfunc main() {\n  // Pack\n  pack1 := hostutils.Pack([]string{\"example101z.com\", \"example102z.com\", \"example103z.com\"})\n  fmt.Println(pack1) // [example[101-103]z.com]\n\n  pack2 := hostutils.Pack([]string{\"example101z.com\", \"example102z.com\", \"example201z.com\"})\n  fmt.Println(pack2) // [example[101-102,201]z.com]\n\n  pack3 := hostutils.Pack([]string{\"example01z.com example02z.com\"})\n  fmt.Println(pack3) // [example[01-02]z.com]\n\n  // Unpack\n  unpack1 := hostutils.Unpack([]string{\"example[101-103]z.com\"})\n  fmt.Println(unpack1) // [example101z.com example102z.com example103z.com]\n\n  unpack2 := hostutils.Unpack([]string{\"example[1-2][101-102]z.com\"})\n  fmt.Println(unpack2) // [example1101z.com example1102z.com example2101z.com example2102z.com]\n}\n```\n\n## Functions\n\n```\nfunc Normalize(hosts []string) (packedHosts []string)\n    Normalize Unpack and pack hosts\n\nfunc NormalizeString(hosts string) (packedHosts []string)\n    NormalizeString Unpack and pack hosts\n\nfunc Pack(hosts []string) (packedHosts []string)\n    Pack Pack full hosts list into short abbreviated hosts.\n\nfunc PackString(hosts string) (packedHosts []string)\n    PackString Pack space septated full hosts list into short abbreviated\n    hosts.\n\nfunc Unpack(packedHosts []string) (hosts []string)\n    Unpack Unpack short abbreviated hosts into full hosts list.\n\nfunc UnpackString(packedHosts string) (hosts []string)\n    Unpack Unpack space septated short abbreviated hosts into full hosts\n    list.\n```\n","funding_links":[],"categories":["Miscellaneous","杂项","其他杂项","Uncategorized","\u003cspan id=\"其他-miscellaneous\"\u003e其他 Miscellaneous\u003c/span\u003e","Microsoft Office","其他"],"sub_categories":["Uncategorized","未分类的","暂未分类","Advanced Console UIs","Strings","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","交流","暂未分类这些库被放在这里是因为其他类别似乎都不适合。"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWing924%2Fhostutils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FWing924%2Fhostutils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FWing924%2Fhostutils/lists"}