Skip to content

Commit fc2e3e7

Browse files
Remove FFI/private things from exports
1 parent 077742f commit fc2e3e7

File tree

4 files changed

+135
-4
lines changed

4 files changed

+135
-4
lines changed

src/Node/Http2/Server.purs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
1-
module Node.Http2.Server where
1+
module Node.Http2.Server
2+
( onCheckContinue
3+
, onConnection
4+
, onRequest
5+
, onSession
6+
, onSessionError
7+
, onStream
8+
, onTimeout
9+
, onUnknownProtocol
10+
, close
11+
, setTimeout
12+
, timeout
13+
, updateSettings
14+
) where
215

316
import Prelude
417

src/Node/Http2/Session.purs

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,51 @@
1-
module Node.Http2.Session where
1+
module Node.Http2.Session
2+
( onClose
3+
, onConnect
4+
, onError
5+
, onFrameError
6+
, onGoAway
7+
, onLocalSettings
8+
, onPing
9+
, onRemoteSettings
10+
, onStream
11+
, onTimeout
12+
, alpnProtocol
13+
, close
14+
, closed
15+
, connecting
16+
, destroy
17+
, destroyWithError
18+
, destroyWithCode
19+
, destroyWithErrorCode
20+
, destroyed
21+
, encrypted
22+
, goAway
23+
, goAwayCode
24+
, goAwayCodeLastStreamId
25+
, goAwayCodeLastStreamIdData
26+
, localSettings
27+
, originSet
28+
, pendingSettingsAck
29+
, ping
30+
, pingPayload
31+
, ref
32+
, remoteSettings
33+
, setLocalWindowSize
34+
, setTimeout
35+
, settings
36+
, socket
37+
, Http2SessionState
38+
, state
39+
, type_
40+
, unref
41+
, altsvc
42+
, origin
43+
, onAltsvc
44+
, onOrigin
45+
, RequestOptions
46+
, requestHeaders
47+
, requestHeadersOptions
48+
) where
249

350
import Prelude
451

src/Node/Http2/Stream.purs

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
1-
module Node.Http2.Stream where
1+
module Node.Http2.Stream
2+
( onAbort
3+
, onClose
4+
, onError
5+
, onFrameError
6+
, onReady
7+
, onTimeout
8+
, onTrailers
9+
, onWantTrailers
10+
, bufferSize
11+
, close
12+
, closed
13+
, destroyed
14+
, endAfterHeaders
15+
, id
16+
, pending
17+
, PriorityOptions
18+
, priority
19+
, rstCode
20+
, sentHeaders
21+
, sentInfoHeaders
22+
, sentTrailers
23+
, session
24+
, setTimeout
25+
, Http2StreamState
26+
, state
27+
, sendTrailers
28+
, additionalHeaders
29+
, headersSent
30+
, pushAllowed
31+
, PushStreamOptions
32+
, pushStream
33+
, pushStream'
34+
, RespondOptions
35+
, respond
36+
, RespondWithFdOptions
37+
, respondWithFd
38+
, RespondWithFileOptions
39+
, respondWithFile
40+
, onContinue
41+
, onHeaders
42+
, onPush
43+
, onResponse
44+
) where
245

346
import Prelude
447

src/Node/Http2/Types.purs

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,35 @@ foreign import data Http2Stream :: PeerType -> Type
1515

1616
foreign import data Headers :: Type
1717

18-
foreign import data Settings :: Type
18+
-- | `headerTableSize` <number> Specifies the maximum number of bytes used for header compression. The minimum allowed value is 0. The maximum allowed value is 232-1. Default: 4096.
19+
-- | `enablePush` <boolean> Specifies true if HTTP/2 Push Streams are to be permitted on the Http2Session instances. Default: true.
20+
-- | `initialWindowSize` <number> Specifies the sender's initial window size in bytes for stream-level flow control. The minimum allowed value is 0. The maximum allowed value is 232-1. Default: 65535.
21+
-- | `maxFrameSize` <number> Specifies the size in bytes of the largest frame payload. The minimum allowed value is 16,384. The maximum allowed value is 224-1. Default: 16384.
22+
-- | `maxConcurrentStreams` <number> Specifies the maximum number of concurrent streams permitted on an Http2Session. There is no default value which implies, at least theoretically, 232^1 streams may be open concurrently at any given time in an Http2Session. The minimum value is 0. The maximum allowed value is 232^1. Default: 4294967295.
23+
-- | `maxHeaderListSize` <number> Specifies the maximum size (uncompressed octets) of header list that will be accepted. The minimum allowed value is 0. The maximum allowed value is 232^1. Default: 65535.
24+
-- | `enableConnectProtocol`<boolean> Specifies true if the "Extended Connect Protocol" defined by RFC 8441 is to be enabled. This setting is only meaningful if sent by the server. Once the enableConnectProtocol setting has been enabled for a given Http2Session, it cannot be disabled. Default: false.
25+
-- |
26+
-- | Note: the `maxHeaderSize` alias is intentionally not supported
27+
type Settings =
28+
{ headerTableSize :: Number
29+
, enablePush :: Boolean
30+
, initialWindowSize :: Number
31+
, maxFrameSize :: Number
32+
, maxConcurrentStreams :: Number
33+
, maxHeaderListSize :: Number
34+
, enableConnectProtocol :: Boolean
35+
}
36+
37+
defaultSettings :: Settings
38+
defaultSettings =
39+
{ headerTableSize: 4096.0
40+
, enablePush: true
41+
, initialWindowSize: 65535.0
42+
, maxFrameSize: 16384.0
43+
, maxConcurrentStreams: 4_294_967_295.0
44+
, maxHeaderListSize: 65535.0
45+
, enableConnectProtocol: false
46+
}
1947

2048
foreign import data Http2SecureServer :: Type
2149

0 commit comments

Comments
 (0)