{"id":36440816,"url":"https://github.com/xusenlin/gin-pagination","last_synced_at":"2026-01-11T21:57:07.510Z","repository":{"id":209383531,"uuid":"723905237","full_name":"xusenlin/gin-pagination","owner":"xusenlin","description":"gin-pagination","archived":false,"fork":false,"pushed_at":"2023-12-06T07:30:07.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-07T08:04:08.957Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xusenlin.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,"governance":null}},"created_at":"2023-11-27T02:11:15.000Z","updated_at":"2023-11-27T02:44:31.000Z","dependencies_parsed_at":"2023-11-27T03:39:23.092Z","dependency_job_id":"f1be1292-46ef-4b9f-bff7-01f10299fd59","html_url":"https://github.com/xusenlin/gin-pagination","commit_stats":null,"previous_names":["xusenlin/gin-pagination"],"tags_count":1,"template":null,"template_full_name":null,"purl":"pkg:github/xusenlin/gin-pagination","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusenlin%2Fgin-pagination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusenlin%2Fgin-pagination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusenlin%2Fgin-pagination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusenlin%2Fgin-pagination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xusenlin","download_url":"https://codeload.github.com/xusenlin/gin-pagination/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xusenlin%2Fgin-pagination/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28324579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T18:42:50.174Z","status":"ssl_error","status_checked_at":"2026-01-11T18:39:13.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-01-11T21:57:06.887Z","updated_at":"2026-01-11T21:57:07.495Z","avatar_url":"https://github.com/xusenlin.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gin-pagination\nPagination for Gin and Gorm\n\n## Install\n```\ngo get github.com/xusenlin/gin-pagination@v0.0.3-alpha\n```\n\n## Usage\n\n### init\n```golang\nimport (\n    ginPagination \"github.com/xusenlin/gin-pagination\"\n)\n//...Conn is *gorm.DB\nginPagination.Init(\u0026ginPagination.Config{\n    PageSizeMaxVal:     100,\n    PageSizeDefaultVal: 20,\n    DB:                 Conn,\n})\n```\n### pagination\n```golang\n\nfunc Find(c *gin.Context) {\n    \n    model := new(User)\n    pagination := ginPagination.New[*User](model, c)\n    \n    pagination.Like(\"name\").Eq(\"id\") //...more\n    \n    err := pagination.Query()\n    \n    if err != nil {\n        tools.SendErrJson(c, err)\n        return\n    }\n    \n    for idx := range pagination.List {\n        pagination.List[idx].Password = \"***\"\n    }\n    \n    tools.SendOkJson(c, \"search successful\", pagination)\n}\n```\n\n## Pagination struct\n```golang\ntype Pagination[T any] struct {\n\tList      []T   `json:\"list\"`\n\tTotal     int64 `json:\"total\"`\n\tPageNum   int   `json:\"pageNum\"`\n\tPageSize  int   `json:\"pageSize\"`\n\tTotalPage int   `json:\"totalPage\"`\n\tquery     *gorm.DB\n\tctx       *gin.Context\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxusenlin%2Fgin-pagination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxusenlin%2Fgin-pagination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxusenlin%2Fgin-pagination/lists"}