Portability | GHC |
---|---|
Stability | experimental |
Maintainer | thu@hypered.be |
Safe Haskell | Safe-Infered |
This module provides bindings to the GitHub API v3.
- apiGetRequest :: ByteString -> String -> [(CI ByteString, ByteString)] -> IO (Request IO)
- apiPostRequest :: ByteString -> String -> ByteString -> IO (Request IO)
- apiGet :: FromJSON a => String -> String -> [(CI ByteString, ByteString)] -> IO (Maybe a)
- apiPost :: FromJSON a => String -> String -> ByteString -> IO (Maybe a)
- repositoryList :: String -> IO (Maybe [Repository])
- repositoryCreate :: String -> String -> Maybe String -> IO (Maybe Repository)
- data Repository = Repository {}
- data CreateRepository = CreateRepository {}
Documentation
apiGetRequest :: ByteString -> String -> [(CI ByteString, ByteString)] -> IO (Request IO)Source
Construct a request from a `username:password` bytestring (suitable for a
Basic Auth scheme), a URI (starting with a /
, e.g. `/user/repos`), and a
list of parameters.
apiPostRequest :: ByteString -> String -> ByteString -> IO (Request IO)Source
Construct a request from a `username:password` bytestring (suitable for a
Basic Auth scheme), a URI (starting with a /
, e.g. `/user/repos`), and a
body.
apiGet :: FromJSON a => String -> String -> [(CI ByteString, ByteString)] -> IO (Maybe a)Source
Execute a GET agains the specified URI (e.g. `/user/repos`) using the supplied `username:password` and parameters.
apiPost :: FromJSON a => String -> String -> ByteString -> IO (Maybe a)Source
Execute a POST agains the specified URI (e.g. `/user/repos`) using the supplied `username:password` and body.
repositoryList :: String -> IO (Maybe [Repository])Source
Return the list of repositories for a given `username:password` string.
repositoryCreate :: String -> String -> Maybe String -> IO (Maybe Repository)Source
Create a new repository from a given name and description.
data Repository Source
Represent a repository. TODO add missing fields.
data CreateRepository Source
Data needed to create a new repository.