{"id":15055388,"url":"https://github.com/jaredallard/gitlab","last_synced_at":"2026-01-14T16:39:44.659Z","repository":{"id":295433265,"uuid":"985553610","full_name":"jaredallard/gitlab","owner":"jaredallard","description":"go-gitlab wrapper that supports mocking","archived":false,"fork":true,"pushed_at":"2025-05-18T02:41:16.000Z","size":699,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-29T01:29:25.781Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"1Password/gitlab","license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaredallard.png","metadata":{},"created_at":"2025-05-18T02:40:22.000Z","updated_at":"2025-05-18T02:40:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jaredallard/gitlab","commit_stats":null,"previous_names":["jaredallard/gitlab"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaredallard/gitlab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredallard%2Fgitlab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredallard%2Fgitlab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredallard%2Fgitlab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredallard%2Fgitlab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaredallard","download_url":"https://codeload.github.com/jaredallard/gitlab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaredallard%2Fgitlab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28426119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T16:32:27.303Z","status":"ssl_error","status_checked_at":"2026-01-14T16:28:36.419Z","response_time":107,"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":["gitlab","go","golang","golang-library"],"created_at":"2024-09-24T21:41:44.593Z","updated_at":"2026-01-14T16:39:44.654Z","avatar_url":"https://github.com/jaredallard.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# gitlab\n\n\u003ca href=\"https://github.com/1password/gitlab/releases\"\u003e\n  \u003cimg alt=\"Latest Version\" src=\"https://img.shields.io/github/v/release/1password/gitlab?style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/1password/gitlab/blob/main/LICENSE\"\u003e\n  \u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/1password/gitlab?style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/1password/gitlab/actions/workflows/tests.yaml\"\u003e\n  \u003cimg alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/1password/gitlab/tests.yaml?style=for-the-badge\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://app.codecov.io/gh/1password/gitlab\"\u003e\n  \u003cimg alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/1password/gitlab?style=for-the-badge\"\u003e\n\u003c/a\u003e\n\n\u003cbr /\u003e\n\nWrapper for [go-gitlab]\n([gitlab.com/gitlab-org/api/client-go](gitlab.com/gitlab-org/api/client-go))\nthat supports mocking.\n\n## Usage\n\nSee our [Go docs](https://pkg.go.dev/github.com/1password/gitlab) as\nwell as the upstream [go-gitlab] documentation which this package\nprovides.\n\n### Differences\n\nDue to the original [go-gitlab] `Client` struct using embedded structs\ninstead of interfaces, you must use the `NewClient` call from this\npackage.\n\nExample:\n\n```go\ngl, err := gitlab.NewClient()\nif err != nil {\n  // handle err\n}\n\n// Original\ngl.MergeRequests.GetMergeRequest()\n\n// New\ngl.MergeRequests().GetMergeRequest()\n```\n\nYou will also need to dereference `gitlab.Client` as it is now and\ninterface instead of a struct.\n\n```go\n// Original\ntype MyStruct {\n  gl *gitlab.Client\n}\n\n// New\ntype MyStruct {\n  gl gitlab.Client\n}\n```\n\n### Using the mocks\n\nAll of the mocks are generated via [mockgen] under the hood. You can\naccess them on the `MockClient` type.\n\nExample:\n\n```go\nfunc TestCanGetMergeRequest(t *testing.T) {\n  gl := gitlab.NewMockClient(t)\n\n  // Should be called once w/ the given arguments and return the given\n  // result.\n  gl.MergeRequestsServiceMock.EXPECT().\n    GetMergeRequest(1, 1, \u0026gitlab.GetMergeRequestsOptions{}).\n    Return(\u0026gitlab.MergeRequest{\n      ID: 1,\n    }, nil, nil)\n\n  mr, _, err := gl.MergeRequests().GetMergeRequest(1, 1, \u0026gitlab.GetMergeRequestsOptions{})\n  assert.NilError(t, err)\n  assert.Equal(t, mr.ID, 1)\n}\n```\n\n## Development\n\nAll of the code in this repository is generated through the\n`tools/codegen` CLI. To change anything, you must add it to that CLI\ntool.\n\nThe templates used can be found in the `embed` directory in the same CLI\ndirectory.\n\nWhen you bump dependency versions — specifically, the client-go package — be\nsure to run `mise generate` to pull in the latest changes to the package.\n\n## Special Thanks\n\nHuge special thanks to the [mockgen] and [ifacemaker] project for making\nthis possible and saving me a lot of pain w/ the ast package :)\n\n## License\n\nLGPL-3.0\n\n[go-gitlab]: gitlab.com/gitlab-org/api/client-go\n[mockgen]: https://pkg.go.dev/go.uber.org/mock/mockgen\n[ifacemaker]: https://github.com/vburenin/ifacemaker@latest\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredallard%2Fgitlab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaredallard%2Fgitlab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaredallard%2Fgitlab/lists"}