gitlab-haskell: A Haskell library for the GitLab web API
This Haskell library queries and updates the database of a GitLab instance using the GitLab web API: https://docs.gitlab.com/ee/api/
It also features an API for writing Gitlab file hook applications
Run all GitLab actions with runGitLab
:
runGitLab :: => GitLabServerConfig -- ^ the GitLab server details -> GitLab a -- ^ the GitLab action -> IO a
For example:
myProjects <- runGitLab (defaultGitLabServer { url = "https://gitlab.example.com" , token="my_token"} ) (searchUser "joe" >>= userProjects . fromJust)
Which uses the functions:
searchUser :: Text -> GitLab (Maybe User) userProjects :: User -> GitLab (Maybe [Project]) projectCommits :: Project -> GitLab [Commit]
This library can also be used to develop rule based GitLab file hooks that react in real time to GitLab events with:
receive :: [Rule] -> GitLab ()
class (FromJSON a) => SystemHook a where match :: String -> (a -> GitLab ()) -> Rule matchIf :: String -> (a -> GitLab Bool) -> (a -> GitLab ()) -> Rule
For more details about the file hooks support: https://www.macs.hw.ac.uk/~rs46/posts/2020-06-06-gitlab-system-hooks.html
Unsurprisingly, this library is maintained on GitLab: https://gitlab.com/robstewart57/gitlab-haskell
[Skip to Readme]
Downloads
- gitlab-haskell-0.2.5.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates