Copyright | (c) CNRS 2017 |
---|---|
License | AGPL + CECILL v3 |
Maintainer | team@gargantext.org |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Gargantext.Core.Text.Corpus.API
Description
Synopsis
- data ExternalAPIs
- newtype RawQuery = RawQuery {
- getRawQuery :: Text
- newtype Limit = Limit {}
- data GetCorpusError
- get :: ExternalAPIs -> Lang -> RawQuery -> Maybe APIKey -> Maybe AuthKey -> Text -> Maybe Limit -> IO (Either GetCorpusError (Maybe Integer, ConduitT () HyperdataDocument IO ()))
- externalAPIs :: [ExternalAPIs]
Documentation
data ExternalAPIs #
Main Types TODO IsidoreAuth
Instances
A raw query, as typed by the user from the frontend.
Constructors
RawQuery | |
Fields
|
Instances
A limit to the number of results we want to retrieve.
Instances
FromJSON Limit # | |
ToJSON Limit # | |
Defined in Gargantext.Core.Text.Corpus.Query | |
Num Limit # | |
Show Limit # | |
Eq Limit # | |
FromHttpApiData Limit # | |
Defined in Gargantext.Core.Text.Corpus.Query | |
ToHttpApiData Limit # | |
Defined in Gargantext.Core.Text.Corpus.Query Methods toUrlPiece :: Limit -> Text # toEncodedUrlPiece :: Limit -> Builder # toHeader :: Limit -> ByteString # toQueryParam :: Limit -> Text # | |
ToParamSchema Limit # | |
Defined in Gargantext.Core.Text.Corpus.Query Methods toParamSchema :: forall (t :: SwaggerKind Type). Proxy Limit -> ParamSchema t # | |
ToSchema Limit # | |
Defined in Gargantext.Core.Text.Corpus.Query Methods declareNamedSchema :: Proxy Limit -> Declare (Definitions Schema) NamedSchema # |
data GetCorpusError #
Constructors
InvalidInputQuery !RawQuery !Text | We couldn't parse the user input query into something meaningful. |
ExternalAPIError !ExternalAPIs !ClientError | The external service returned an error. |
Instances
Show GetCorpusError # | |
Defined in Gargantext.Core.Text.Corpus.API Methods showsPrec :: Int -> GetCorpusError -> ShowS # show :: GetCorpusError -> String # showList :: [GetCorpusError] -> ShowS # | |
ToHumanFriendlyError GetCorpusError # | |
Defined in Gargantext.Core.Text.Corpus.API Methods mkHumanFriendly :: GetCorpusError -> Text # | |
Eq GetCorpusError # | |
Defined in Gargantext.Core.Text.Corpus.API Methods (==) :: GetCorpusError -> GetCorpusError -> Bool # (/=) :: GetCorpusError -> GetCorpusError -> Bool # |
Arguments
:: ExternalAPIs | |
-> Lang | A user-selected language in which documents needs to be retrieved.
If the provider doesn't support the search filtered by language, or if the language
is not important, the frontend will simply send |
-> RawQuery | |
-> Maybe APIKey | |
-> Maybe AuthKey | |
-> Text | |
-> Maybe Limit | |
-> IO (Either GetCorpusError (Maybe Integer, ConduitT () HyperdataDocument IO ())) |
Get External API metadata main function
externalAPIs :: [ExternalAPIs] #