on master help sign in
LICENSEmode 100644 → 100755
since splitsnapshots
unifiedsplit

Only the mode changed.

Procfilemode 100644 → 100755

Only the mode changed.

Setup.hsmode 100644 → 100755

Only the mode changed.

app.jsonmode 100644 → 100755

Only the mode changed.

app/Main.hsmode 100644 → 100755

Only the mode changed.

docs.mdmode 100644 → 100755

Only the mode changed.

docs/Docs.hsmode 100644 → 100755

Only the mode changed.

package.yamlmode 100644 → 100755

Only the mode changed.

readme.mdmode 100644 → 100755+74−86
@@ -6,10 +6,6 @@ _url: [`https://websuck1t.herokuapp.com`](https://websuck1t.herokuapp.com)_
6
6
7## GET /posts/all
7## GET /posts/all
8
8
9−_start with: [`https://websuck1t.herokuapp.com/posts/all`](https://websuck1t.herokuapp.com/posts/all)_
10−
11−Use this _url_ to get the token every time when application begins and previous session was closed
12−
13### Response:
9### Response:
14
10
15- Status code 200
11- Status code 200
@@ -58,48 +54,12 @@ Use this _url_ to get the token every time when application begins and previous
58 ]
54 ]
59}
55}
60```
56```
61−### Captures:
62−- «token» to further use it in subscription to web socket
63−
64−- «response» to start with the given number of posts in table
65−
66−## WebSocket /posts/subscribe/:token
67−
68−You access the web socket with the web socket protocol. I. e. `https://` -> `ws://`.
69−
70−Open a web socket from the given `token` for receiving events about new and deleted posts with `ws://websuck1t.herokuapp.com/posts/subscribe/{token}`
71−
72−#### Returns error `498` if the supplied token has expired or is invalid.
73−
74−### Captures:
75−
76−- *token*: The token, received with the previous request.
77
57
78−### Response:
79−
80−```javascript
81−{
82− «token»: 1828,
83− «response»: {
84− «deleted»: [
85− 1819,
86− 1835,
87− 1843
88− ],
89− «added»: [
90− 1844,
91− 1845,
92− 1846
93− ]
94− }
95−}
96−```
97−
98−## GET /posts/:id
58+## GET /users/:id
99
59
100−_url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp.com/posts/1)_
60+Retrieves a user with the given `id`.
101
61
102−#### If there is no post with the given `id`, the method returns error `404`.
62+#### If there is no user with the given `id`, the method returns error `404`.
103
63
104### Captures:
64### Captures:
105
65
@@ -118,9 +78,11 @@ _url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp
118
78
119```javascript
79```javascript
120{
80{
121− «postBody»: «This is the post body»,
81+ "userName": {
122− «postAuthor»: 4,
82+ "secondName": "Leonidovich",
123− «postId»: 1
83+ "firstName": "Seva"
84+ },
85+ "userId": 1
124}
86}
125```
87```
126
88
@@ -128,9 +90,11 @@ _url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp
128
90
129```javascript
91```javascript
130{
92{
131− «postBody»: «This is another post body»,
93+ "userName": {
132− «postAuthor»: 4,
94+ "secondName": "Barovich",
133− «postId»: 1
95+ "firstName": "Foo"
96+ },
97+ "userId": 42
134}
98}
135```
99```
136
100
@@ -138,9 +102,11 @@ _url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp
138
102
139```javascript
103```javascript
140{
104{
141− «postBody»: «This is the post body»,
105+ "userName": {
142− «postAuthor»: 7,
106+ "secondName": "Fooovich",
143− «postId»: 1
107+ "firstName": "Bar"
108+ },
109+ "userId": 69
144}
110}
145```
111```
146
112
@@ -148,30 +114,50 @@ _url: [`https://websuck1t.herokuapp.com/posts/{id}`](https://websuck1t.herokuapp
148
114
149```javascript
115```javascript
150{
116{
151− «postBody»: «This is another post body»,
117+ "userName": {
152− «postAuthor»: 7,
118+ "secondName": "Quixovich",
153− «postId»: 1
119+ "firstName": "Qux"
120+ },
121+ "userId": 8
154}
122}
155```
123```
156
124
157−- Example (`application/json`):
125+## WebSocket /posts/subscribe/:token
126+
127+You access the web socket with the web socket protocol. I. e. `https://` -> `ws://`.
128+
129+Open a web socket from the given `token` for receiving events about new and deleted posts.
130+
131+#### Returns error `498` if the supplied token has expired or is invalid.
132+
133+
134+### Captures:
135+
136+- *token*: The token, received with the previous request.
137+
138+### Response:
158
139
159```javascript
140```javascript
160{
141{
161− «postBody»: «This is the post body»,
142+ "token": 1828,
162− «postAuthor»: 92,
143+ "response": {
163− «postId»: 1
144+ "deleted": [
145+ 1819,
146+ 1835,
147+ 1843
148+ ],
149+ "added": [
150+ 1844,
151+ 1845,
152+ 1846
153+ ]
154+ }
164}
155}
165```
156```
166
157
158+## GET /posts/:id
167
159
168−## GET /users/:id
169−
170−_url: [`https://websuck1t.herokuapp.com/users/{id}`](https://websuck1t.herokuapp.com/users/1)_
171−
172−Retrieves a user with the given `id`.
173−
174−#### If there is no user with the given `id`, the method returns error `404`.
160+#### If there is no post with the given `id`, the method returns error `404`.
175
161
176### Captures:
162### Captures:
177
163
@@ -190,11 +176,9 @@ Retrieves a user with the given `id`.
190
176
191```javascript
177```javascript
192{
178{
193− "userName": {
179+ "postBody": "This is the post body",
194− "secondName": "Leonidovich",
180+ "postAuthor": 4,
195− "firstName": "Seva"
181+ "postId": 1
196− },
197− "userId": 1
198}
182}
199```
183```
200
184
@@ -202,11 +186,9 @@ Retrieves a user with the given `id`.
202
186
203```javascript
187```javascript
204{
188{
205− "userName": {
189+ "postBody": "This is another post body",
206− "secondName": "Barovich",
190+ "postAuthor": 4,
207− "firstName": "Foo"
191+ "postId": 1
208− },
209− "userId": 42
210}
192}
211```
193```
212
194
@@ -214,11 +196,9 @@ Retrieves a user with the given `id`.
214
196
215```javascript
197```javascript
216{
198{
217− "userName": {
199+ "postBody": "This is the post body",
218− "secondName": "Fooovich",
200+ "postAuthor": 7,
219− "firstName": "Bar"
201+ "postId": 1
220− },
221− "userId": 69
222}
202}
223```
203```
224
204
@@ -226,10 +206,18 @@ Retrieves a user with the given `id`.
226
206
227```javascript
207```javascript
228{
208{
229− "userName": {
209+ "postBody": "This is another post body",
230− "secondName": "Quixovich",
210+ "postAuthor": 7,
231− "firstName": "Qux"
211+ "postId": 1
232− },
212+}
233− "userId": 8
213+```
214+
215+- Example (`application/json`):
216+
217+```javascript
218+{
219+ "postBody": "This is the post body",
220+ "postAuthor": 92,
221+ "postId": 1
234}
222}
235```
223```
src/Data/CyclicBuffer.hsmode 100644 → 100755

Only the mode changed.

src/Data/Error.hsmode 100644 → 100755

Only the mode changed.

src/Foo/Data.hsmode 100644 → 100755+2−2
@@ -85,7 +85,7 @@ createConfig :: IO Config
85createConfig = do
85createConfig = do
86 mng <- newManager tlsManagerSettings
86 mng <- newManager tlsManagerSettings
87 cfg <- atomically $ Config <$> newTVar 0 <*> newTVar 0 <*> newTVar M.empty <*> newTVar M.empty <*> return mng <*> newTVar M.empty <*> newTVar 0 <*> newTVar (CB.empty 20)
87 cfg <- atomically $ Config <$> newTVar 0 <*> newTVar 0 <*> newTVar M.empty <*> newTVar M.empty <*> return mng <*> newTVar M.empty <*> newTVar 0 <*> newTVar (CB.empty 20)
88− forkIO . forever $ threadDelay 7000000 >> (runHandler . createApp cfg $ startAddingPosts 20 cfg >>= uncurry sendUpdate)
88+ forkIO . forever $ threadDelay 2000000 >> (runHandler . createApp cfg $ startAddingPosts 20 cfg >>= uncurry sendUpdate)
89 return cfg
89 return cfg
90
90
91type Token = Int
91type Token = Int
@@ -165,7 +165,7 @@ startAddingPosts lim cfg = do
165 let us = users cfg
165 let us = users cfg
166 let ps = posts cfg
166 let ps = posts cfg
167
167
168− a <- liftIO $ loremBacon (manager cfg) (Just AllMeat) (Just lim) (Just False)
168+ a <- liftIO $ loremBacon (manager cfg) (Just AllMeat) (Just lim) (Just 0)
169 g <- liftIO newStdGen
169 g <- liftIO newStdGen
170 let rns = randoms g
170 let rns = randoms g
171
171
src/Lib.hsmode 100644 → 100755

Only the mode changed.

src/Network/Bacon.hsmode 100644 → 100755+3−3
@@ -21,15 +21,15 @@ instance ToHttpApiData LoremType where
21 toQueryParam MeatAndFiller = "meat-and-filler"
21 toQueryParam MeatAndFiller = "meat-and-filler"
22 toQueryParam AllMeat = "all-meat"
22 toQueryParam AllMeat = "all-meat"
23
23
24−type API = QueryParam "type" LoremType :> QueryParam "paras" Int :> QueryParam "start-with-lorem" Bool :> Get '[JSON] [Text]
24+type API = QueryParam "type" LoremType :> QueryParam "paras" Int :> QueryParam "start-with-lorem" Int :> Get '[JSON] [Text]
25
25
26clientAPI :: Proxy API
26clientAPI :: Proxy API
27clientAPI = Proxy
27clientAPI = Proxy
28
28
29−loremBacon' :: Maybe LoremType -> Maybe Int -> Maybe Bool -> ClientM [Text]
29+loremBacon' :: Maybe LoremType -> Maybe Int -> Maybe Int -> ClientM [Text]
30loremBacon' = client clientAPI
30loremBacon' = client clientAPI
31
31
32−loremBacon :: Manager -> Maybe LoremType -> Maybe Int -> Maybe Bool -> IO (Maybe [Text])
32+loremBacon :: Manager -> Maybe LoremType -> Maybe Int -> Maybe Int -> IO (Maybe [Text])
33loremBacon mng a b c = do
33loremBacon mng a b c = do
34 let env = mkClientEnv mng (BaseUrl Https "baconipsum.com" 443 "api")
34 let env = mkClientEnv mng (BaseUrl Https "baconipsum.com" 443 "api")
35 res <- runClientM (loremBacon' a b c) env
35 res <- runClientM (loremBacon' a b c) env
stack.yamlmode 100644 → 100755

Only the mode changed.

swagger/Swagger.hsmode 100644 → 100755

Only the mode changed.

test/Spec.hsmode 100644 → 100755

Only the mode changed.