Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
153
Issues
153
List
Board
Labels
Milestones
Merge Requests
12
Merge Requests
12
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
haskell-gargantext
Commits
aebaa330
Commit
aebaa330
authored
Jan 31, 2019
by
Nicolas Pouillard
Committed by
Alexandre Delanoë
Jan 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
NgramsPatches: overall structure, missing many instances
parent
cfbbf557
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
194 additions
and
27 deletions
+194
-27
package.yaml
package.yaml
+1
-0
Ngrams.hs
src/Gargantext/API/Ngrams.hs
+180
-23
Node.hs
src/Gargantext/API/Node.hs
+3
-2
Settings.hs
src/Gargantext/API/Settings.hs
+8
-0
Utils.hs
src/Gargantext/Database/Utils.hs
+1
-1
stack.yaml
stack.yaml
+1
-1
No files found.
package.yaml
View file @
aebaa330
...
...
@@ -165,6 +165,7 @@ library:
-
transformers-base
-
unordered-containers
-
uuid
-
validity
-
vector
-
wai
-
wai-cors
...
...
src/Gargantext/API/Ngrams.hs
View file @
aebaa330
This diff is collapsed.
Click to expand it.
src/Gargantext/API/Node.hs
View file @
aebaa330
...
...
@@ -46,7 +46,7 @@ import Data.Time (UTCTime)
import
GHC.Generics
(
Generic
)
import
Servant
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
TableNgramsApiGet
,
tableNgramsPatch
,
getTableNgrams
)
import
Gargantext.API.Ngrams
(
TabType
(
..
),
TableNgramsApi
,
TableNgramsApiGet
,
tableNgramsPatch
,
getTableNgrams
,
HasRepoVar
(
..
)
)
import
Gargantext.Prelude
import
Gargantext.Database.Types.Node
import
Gargantext.Database.Utils
-- (Cmd, CmdM)
...
...
@@ -72,7 +72,8 @@ import Gargantext.Database.Types.Node (CorpusId, ContactId)
import
Test.QuickCheck
(
elements
)
import
Test.QuickCheck.Arbitrary
(
Arbitrary
,
arbitrary
)
type
GargServer
api
=
forall
env
m
.
CmdM
env
ServantErr
m
=>
ServerT
api
m
type
GargServer
api
=
forall
env
m
.
(
CmdM
env
ServantErr
m
,
HasRepoVar
env
)
=>
ServerT
api
m
-------------------------------------------------------------------
-- TODO-ACCESS: access by admin only.
...
...
src/Gargantext/API/Settings.hs
View file @
aebaa330
...
...
@@ -45,10 +45,12 @@ import Web.HttpApiData (parseUrlPiece)
import
qualified
Jose.Jwk
as
Jose
import
qualified
Jose.Jwa
as
Jose
import
Control.Concurrent
import
Control.Monad.Logger
import
Control.Lens
import
Gargantext.Prelude
import
Gargantext.Database.Utils
(
databaseParameters
,
HasConnection
(
..
))
import
Gargantext.API.Ngrams
(
NgramsRepo
,
HasRepoVar
(
..
),
initRepo
)
import
Gargantext.API.Orchestrator.Types
type
PortNumber
=
Int
...
...
@@ -128,6 +130,7 @@ data Env = Env
{
_env_settings
::
!
Settings
,
_env_logger
::
!
LoggerSet
,
_env_conn
::
!
Connection
,
_env_repo_var
::
!
(
MVar
NgramsRepo
)
,
_env_manager
::
!
Manager
,
_env_self_url
::
!
BaseUrl
,
_env_scrapers
::
!
ScrapersEnv
...
...
@@ -139,6 +142,9 @@ makeLenses ''Env
instance
HasConnection
Env
where
connection
=
env_conn
instance
HasRepoVar
Env
where
repoVar
=
env_repo_var
data
MockEnv
=
MockEnv
{
_menv_firewall
::
!
FireWall
}
...
...
@@ -155,12 +161,14 @@ newEnv port file = do
self_url
<-
parseBaseUrl
$
"http://0.0.0.0:"
<>
show
port
param
<-
databaseParameters
file
conn
<-
connect
param
repo_var
<-
newMVar
initRepo
scrapers_env
<-
newJobEnv
defaultSettings
manager
logger
<-
newStderrLoggerSet
defaultBufSize
pure
$
Env
{
_env_settings
=
settings
,
_env_logger
=
logger
,
_env_conn
=
conn
,
_env_repo_var
=
repo_var
,
_env_manager
=
manager
,
_env_scrapers
=
scrapers_env
,
_env_self_url
=
self_url
...
...
src/Gargantext/Database/Utils.hs
View file @
aebaa330
...
...
@@ -68,7 +68,7 @@ runCmd :: Connection -> Cmd err a -> IO (Either err a)
runCmd
conn
m
=
runExceptT
$
runReaderT
m
conn
-- Use only for dev
runCmdDevWith
::
FilePath
->
Cmd
ServantE
rr
a
->
IO
a
runCmdDevWith
::
Show
err
=>
FilePath
->
Cmd
e
rr
a
->
IO
a
runCmdDevWith
fp
f
=
do
conn
<-
connectGargandb
fp
either
(
fail
.
show
)
pure
=<<
runCmd
conn
f
...
...
stack.yaml
View file @
aebaa330
...
...
@@ -34,4 +34,4 @@ extra-deps:
-
servant-flatten-0.2
-
servant-multipart-0.11.2
-
stemmer-0.5.2
-
validity-0.
8
.0.0
# patches-{map,class}
-
validity-0.
9
.0.0
# patches-{map,class}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment