GitLab has a REST web API. It returns JSON strings.
gitlab-haskell library lifts the GitLab API into Haskell. Rather than working with JSON strings,
gitlab-haskell parses GitLab API results into Haskell types e.g. when querying branches, the type you'll be working with is:
Other GitLab types include
MergeRequest. The documentation for all GitLab types is on hackage.
GitLab actions are executed using the
Internally, this creates a single connection manager, whichs keeps track of open connections for keep-alive and is shared between multiple concurrent requests required to execute the GitLab action.
A simple example is to get all forks of a given project with a name:
projectForks to obtain all forks:
Some more examples of the
gitlab-haskell API are:
-- projects. allProjects :: GitLab [Project] projectsWithName :: Text -> GitLab [Project] userProjects :: User -> GitLab (Maybe [Project]) projectOfIssue :: Issue -> GitLab Project projectCISuccess :: Project -> GitLab Bool projectDiffs :: Project -> Text -> GitLab [Diff] -- branches. branches :: Project -> GitLab [Branch] -- commits. projectCommits :: Project -> GitLab [Commit] -- groups. addUserToGroup :: Text -> AccessLevel -> User -> GitLab (Either Status Member) -- issues. projectOpenedIssues :: Project -> GitLab [Issue] userIssues :: User -> GitLab [Issue] -- merge requests. mergeRequests :: Project -> GitLab [MergeRequest] acceptMergeRequest :: Project -> Int -> GitLab (Either Status MergeRequest) -- repository files. repositoryFiles :: Project -> FilePath -> Text -> GitLab (Maybe RepositoryFile)
The complete API is documented on hackage: http://hackage.haskell.org/package/gitlab-haskell
If you have issues using
gitlab-haskell or find bugs, please report them here: https://gitlab.com/robstewart57/gitlab-haskell