{"id":17145129,"url":"https://github.com/crufter/paging","last_synced_at":"2025-03-24T10:23:02.103Z","repository":{"id":3419655,"uuid":"4470779","full_name":"crufter/paging","owner":"crufter","description":"A simple paging script written in Go, for use with template engines like mustache, or the builting template package of Go.","archived":false,"fork":false,"pushed_at":"2012-07-28T11:49:15.000Z","size":112,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T03:56:07.189Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"google/material-design-icons","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/crufter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-28T13:26:44.000Z","updated_at":"2014-11-08T20:37:41.000Z","dependencies_parsed_at":"2022-08-20T10:40:54.713Z","dependency_job_id":null,"html_url":"https://github.com/crufter/paging","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/crufter%2Fpaging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crufter%2Fpaging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crufter%2Fpaging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crufter%2Fpaging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crufter","download_url":"https://codeload.github.com/crufter/paging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245249574,"owners_count":20584565,"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-14T21:04:38.620Z","updated_at":"2025-03-24T10:23:02.077Z","avatar_url":"https://github.com/crufter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Paging\n======\n\nA simple paging script written in Go, for use with template engines like mustache, or the builting template package of Go.\n\nUsage\n======\nThe Paging(current_page, page_count, visible int, url_str string)  function will return a []paging.Pelem.\nThe visible parameter controls how many paging \"link\" can be seen before and after the current page.\nThe first and the last page will be always in the list.\n```\npackage main\n\nimport(\n\t\"github.com/opesun/paging\"\n)\n\nfunc main() {\n\tx, _ := paging.P(1, 5, 2, \"http://www.opesun.com?cat=embedded\")\n\tpaging.Print(x)\n\tfmt.Println(\"---\")\n\tpaging.PrintWithUrl(x)\n}\n```\n\nThe above example will output\n```\n[1] 2 3 ... 5\n---\n[1] http://www.opesun.com?cat=embedded\u0026page=1\n2\thttp://www.opesun.com?cat=embedded\u0026page=2\n3\thttp://www.opesun.com?cat=embedded\u0026page=3\n...\n5\thttp://www.opesun.com?cat=embedded\u0026page=5\n```\n\nUnfortunately the get parameters will be ordered randomly in the url since the net/url package url.Value type does not keep the order of the parameters, since it uses\na map internally.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrufter%2Fpaging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrufter%2Fpaging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrufter%2Fpaging/lists"}