Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- type AuthDomainBasicAuthCallback = AuthDomainBasic -> ServerMessage -> Text -> Text -> IO Bool
- type AuthDomainBasicAuthCallback_WithClosures = AuthDomainBasic -> ServerMessage -> Text -> Text -> Ptr () -> IO Bool
- type C_AuthDomainBasicAuthCallback = Ptr AuthDomainBasic -> Ptr ServerMessage -> CString -> CString -> Ptr () -> IO CInt
- drop_closures_AuthDomainBasicAuthCallback :: AuthDomainBasicAuthCallback -> AuthDomainBasicAuthCallback_WithClosures
- dynamic_AuthDomainBasicAuthCallback :: (HasCallStack, MonadIO m, IsAuthDomainBasic a, IsServerMessage b) => FunPtr C_AuthDomainBasicAuthCallback -> a -> b -> Text -> Text -> Ptr () -> m Bool
- genClosure_AuthDomainBasicAuthCallback :: MonadIO m => AuthDomainBasicAuthCallback -> m (GClosure C_AuthDomainBasicAuthCallback)
- mk_AuthDomainBasicAuthCallback :: C_AuthDomainBasicAuthCallback -> IO (FunPtr C_AuthDomainBasicAuthCallback)
- noAuthDomainBasicAuthCallback :: Maybe AuthDomainBasicAuthCallback
- noAuthDomainBasicAuthCallback_WithClosures :: Maybe AuthDomainBasicAuthCallback_WithClosures
- wrap_AuthDomainBasicAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback)) -> AuthDomainBasicAuthCallback_WithClosures -> C_AuthDomainBasicAuthCallback
- type AuthDomainDigestAuthCallback = AuthDomainDigest -> ServerMessage -> Text -> IO (Maybe Text)
- type AuthDomainDigestAuthCallback_WithClosures = AuthDomainDigest -> ServerMessage -> Text -> Ptr () -> IO (Maybe Text)
- type C_AuthDomainDigestAuthCallback = Ptr AuthDomainDigest -> Ptr ServerMessage -> CString -> Ptr () -> IO CString
- drop_closures_AuthDomainDigestAuthCallback :: AuthDomainDigestAuthCallback -> AuthDomainDigestAuthCallback_WithClosures
- dynamic_AuthDomainDigestAuthCallback :: (HasCallStack, MonadIO m, IsAuthDomainDigest a, IsServerMessage b) => FunPtr C_AuthDomainDigestAuthCallback -> a -> b -> Text -> Ptr () -> m (Maybe Text)
- genClosure_AuthDomainDigestAuthCallback :: MonadIO m => AuthDomainDigestAuthCallback -> m (GClosure C_AuthDomainDigestAuthCallback)
- mk_AuthDomainDigestAuthCallback :: C_AuthDomainDigestAuthCallback -> IO (FunPtr C_AuthDomainDigestAuthCallback)
- noAuthDomainDigestAuthCallback :: Maybe AuthDomainDigestAuthCallback
- noAuthDomainDigestAuthCallback_WithClosures :: Maybe AuthDomainDigestAuthCallback_WithClosures
- wrap_AuthDomainDigestAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback)) -> AuthDomainDigestAuthCallback_WithClosures -> C_AuthDomainDigestAuthCallback
- type AuthDomainFilter = AuthDomain -> ServerMessage -> IO Bool
- type AuthDomainFilter_WithClosures = AuthDomain -> ServerMessage -> Ptr () -> IO Bool
- type C_AuthDomainFilter = Ptr AuthDomain -> Ptr ServerMessage -> Ptr () -> IO CInt
- drop_closures_AuthDomainFilter :: AuthDomainFilter -> AuthDomainFilter_WithClosures
- dynamic_AuthDomainFilter :: (HasCallStack, MonadIO m, IsAuthDomain a, IsServerMessage b) => FunPtr C_AuthDomainFilter -> a -> b -> Ptr () -> m Bool
- genClosure_AuthDomainFilter :: MonadIO m => AuthDomainFilter -> m (GClosure C_AuthDomainFilter)
- mk_AuthDomainFilter :: C_AuthDomainFilter -> IO (FunPtr C_AuthDomainFilter)
- noAuthDomainFilter :: Maybe AuthDomainFilter
- noAuthDomainFilter_WithClosures :: Maybe AuthDomainFilter_WithClosures
- wrap_AuthDomainFilter :: Maybe (Ptr (FunPtr C_AuthDomainFilter)) -> AuthDomainFilter_WithClosures -> C_AuthDomainFilter
- type AuthDomainGenericAuthCallback = AuthDomain -> ServerMessage -> Text -> IO Bool
- type AuthDomainGenericAuthCallback_WithClosures = AuthDomain -> ServerMessage -> Text -> Ptr () -> IO Bool
- type C_AuthDomainGenericAuthCallback = Ptr AuthDomain -> Ptr ServerMessage -> CString -> Ptr () -> IO CInt
- drop_closures_AuthDomainGenericAuthCallback :: AuthDomainGenericAuthCallback -> AuthDomainGenericAuthCallback_WithClosures
- dynamic_AuthDomainGenericAuthCallback :: (HasCallStack, MonadIO m, IsAuthDomain a, IsServerMessage b) => FunPtr C_AuthDomainGenericAuthCallback -> a -> b -> Text -> Ptr () -> m Bool
- genClosure_AuthDomainGenericAuthCallback :: MonadIO m => AuthDomainGenericAuthCallback -> m (GClosure C_AuthDomainGenericAuthCallback)
- mk_AuthDomainGenericAuthCallback :: C_AuthDomainGenericAuthCallback -> IO (FunPtr C_AuthDomainGenericAuthCallback)
- noAuthDomainGenericAuthCallback :: Maybe AuthDomainGenericAuthCallback
- noAuthDomainGenericAuthCallback_WithClosures :: Maybe AuthDomainGenericAuthCallback_WithClosures
- wrap_AuthDomainGenericAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback)) -> AuthDomainGenericAuthCallback_WithClosures -> C_AuthDomainGenericAuthCallback
- type C_LoggerFilter = Ptr Logger -> Ptr Message -> Ptr () -> IO CUInt
- type LoggerFilter = Logger -> Message -> IO LoggerLogLevel
- type LoggerFilter_WithClosures = Logger -> Message -> Ptr () -> IO LoggerLogLevel
- drop_closures_LoggerFilter :: LoggerFilter -> LoggerFilter_WithClosures
- dynamic_LoggerFilter :: (HasCallStack, MonadIO m, IsLogger a, IsMessage b) => FunPtr C_LoggerFilter -> a -> b -> Ptr () -> m LoggerLogLevel
- genClosure_LoggerFilter :: MonadIO m => LoggerFilter -> m (GClosure C_LoggerFilter)
- mk_LoggerFilter :: C_LoggerFilter -> IO (FunPtr C_LoggerFilter)
- noLoggerFilter :: Maybe LoggerFilter
- noLoggerFilter_WithClosures :: Maybe LoggerFilter_WithClosures
- wrap_LoggerFilter :: Maybe (Ptr (FunPtr C_LoggerFilter)) -> LoggerFilter_WithClosures -> C_LoggerFilter
- type C_LoggerPrinter = Ptr Logger -> CUInt -> Int8 -> CString -> Ptr () -> IO ()
- type LoggerPrinter = Logger -> LoggerLogLevel -> Int8 -> Text -> IO ()
- type LoggerPrinter_WithClosures = Logger -> LoggerLogLevel -> Int8 -> Text -> Ptr () -> IO ()
- drop_closures_LoggerPrinter :: LoggerPrinter -> LoggerPrinter_WithClosures
- dynamic_LoggerPrinter :: (HasCallStack, MonadIO m, IsLogger a) => FunPtr C_LoggerPrinter -> a -> LoggerLogLevel -> Int8 -> Text -> Ptr () -> m ()
- genClosure_LoggerPrinter :: MonadIO m => LoggerPrinter -> m (GClosure C_LoggerPrinter)
- mk_LoggerPrinter :: C_LoggerPrinter -> IO (FunPtr C_LoggerPrinter)
- noLoggerPrinter :: Maybe LoggerPrinter
- noLoggerPrinter_WithClosures :: Maybe LoggerPrinter_WithClosures
- wrap_LoggerPrinter :: Maybe (Ptr (FunPtr C_LoggerPrinter)) -> LoggerPrinter_WithClosures -> C_LoggerPrinter
- type C_MessageHeadersForeachFunc = CString -> CString -> Ptr () -> IO ()
- type MessageHeadersForeachFunc = Text -> Text -> IO ()
- type MessageHeadersForeachFunc_WithClosures = Text -> Text -> Ptr () -> IO ()
- drop_closures_MessageHeadersForeachFunc :: MessageHeadersForeachFunc -> MessageHeadersForeachFunc_WithClosures
- dynamic_MessageHeadersForeachFunc :: (HasCallStack, MonadIO m) => FunPtr C_MessageHeadersForeachFunc -> Text -> Text -> Ptr () -> m ()
- genClosure_MessageHeadersForeachFunc :: MonadIO m => MessageHeadersForeachFunc -> m (GClosure C_MessageHeadersForeachFunc)
- mk_MessageHeadersForeachFunc :: C_MessageHeadersForeachFunc -> IO (FunPtr C_MessageHeadersForeachFunc)
- noMessageHeadersForeachFunc :: Maybe MessageHeadersForeachFunc
- noMessageHeadersForeachFunc_WithClosures :: Maybe MessageHeadersForeachFunc_WithClosures
- wrap_MessageHeadersForeachFunc :: Maybe (Ptr (FunPtr C_MessageHeadersForeachFunc)) -> MessageHeadersForeachFunc_WithClosures -> C_MessageHeadersForeachFunc
- type C_ServerCallback = Ptr Server -> Ptr ServerMessage -> CString -> Ptr (GHashTable CString CString) -> Ptr () -> IO ()
- type ServerCallback = Server -> ServerMessage -> Text -> Maybe (Map Text Text) -> IO ()
- type ServerCallback_WithClosures = Server -> ServerMessage -> Text -> Maybe (Map Text Text) -> Ptr () -> IO ()
- drop_closures_ServerCallback :: ServerCallback -> ServerCallback_WithClosures
- dynamic_ServerCallback :: (HasCallStack, MonadIO m, IsServer a, IsServerMessage b) => FunPtr C_ServerCallback -> a -> b -> Text -> Maybe (Map Text Text) -> Ptr () -> m ()
- genClosure_ServerCallback :: MonadIO m => ServerCallback -> m (GClosure C_ServerCallback)
- mk_ServerCallback :: C_ServerCallback -> IO (FunPtr C_ServerCallback)
- noServerCallback :: Maybe ServerCallback
- noServerCallback_WithClosures :: Maybe ServerCallback_WithClosures
- wrap_ServerCallback :: Maybe (Ptr (FunPtr C_ServerCallback)) -> ServerCallback_WithClosures -> C_ServerCallback
- type C_ServerWebsocketCallback = Ptr Server -> Ptr ServerMessage -> CString -> Ptr WebsocketConnection -> Ptr () -> IO ()
- type ServerWebsocketCallback = Server -> ServerMessage -> Text -> WebsocketConnection -> IO ()
- type ServerWebsocketCallback_WithClosures = Server -> ServerMessage -> Text -> WebsocketConnection -> Ptr () -> IO ()
- drop_closures_ServerWebsocketCallback :: ServerWebsocketCallback -> ServerWebsocketCallback_WithClosures
- dynamic_ServerWebsocketCallback :: (HasCallStack, MonadIO m, IsServer a, IsServerMessage b, IsWebsocketConnection c) => FunPtr C_ServerWebsocketCallback -> a -> b -> Text -> c -> Ptr () -> m ()
- genClosure_ServerWebsocketCallback :: MonadIO m => ServerWebsocketCallback -> m (GClosure C_ServerWebsocketCallback)
- mk_ServerWebsocketCallback :: C_ServerWebsocketCallback -> IO (FunPtr C_ServerWebsocketCallback)
- noServerWebsocketCallback :: Maybe ServerWebsocketCallback
- noServerWebsocketCallback_WithClosures :: Maybe ServerWebsocketCallback_WithClosures
- wrap_ServerWebsocketCallback :: Maybe (Ptr (FunPtr C_ServerWebsocketCallback)) -> ServerWebsocketCallback_WithClosures -> C_ServerWebsocketCallback
Signals
AuthDomainBasicAuthCallback
type AuthDomainBasicAuthCallback Source #
= AuthDomainBasic |
|
-> ServerMessage |
|
-> Text |
|
-> Text |
|
-> IO Bool | Returns: |
Callback used by AuthDomainBasic
for authentication purposes.
The application should verify that username
and password
and valid
and return True
or False
.
If you are maintaining your own password database (rather than using the password to authenticate against some other system like PAM or a remote server), you should make sure you know what you are doing. In particular, don't store cleartext passwords, or easily-computed hashes of cleartext passwords, even if you don't care that much about the security of your server, because users will frequently use the same password for multiple sites, and so compromising any site with a cleartext (or easily-cracked) password database may give attackers access to other more-interesting sites as well.
type AuthDomainBasicAuthCallback_WithClosures Source #
= AuthDomainBasic |
|
-> ServerMessage |
|
-> Text |
|
-> Text |
|
-> Ptr () |
|
-> IO Bool | Returns: |
Callback used by AuthDomainBasic
for authentication purposes.
The application should verify that username
and password
and valid
and return True
or False
.
If you are maintaining your own password database (rather than using the password to authenticate against some other system like PAM or a remote server), you should make sure you know what you are doing. In particular, don't store cleartext passwords, or easily-computed hashes of cleartext passwords, even if you don't care that much about the security of your server, because users will frequently use the same password for multiple sites, and so compromising any site with a cleartext (or easily-cracked) password database may give attackers access to other more-interesting sites as well.
type C_AuthDomainBasicAuthCallback = Ptr AuthDomainBasic -> Ptr ServerMessage -> CString -> CString -> Ptr () -> IO CInt Source #
Type for the callback on the (unwrapped) C side.
drop_closures_AuthDomainBasicAuthCallback :: AuthDomainBasicAuthCallback -> AuthDomainBasicAuthCallback_WithClosures Source #
A simple wrapper that ignores the closure arguments.
dynamic_AuthDomainBasicAuthCallback Source #
:: (HasCallStack, MonadIO m, IsAuthDomainBasic a, IsServerMessage b) | |
=> FunPtr C_AuthDomainBasicAuthCallback | |
-> a |
|
-> b |
|
-> Text |
|
-> Text |
|
-> Ptr () |
|
-> m Bool | Returns: |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_AuthDomainBasicAuthCallback :: MonadIO m => AuthDomainBasicAuthCallback -> m (GClosure C_AuthDomainBasicAuthCallback) Source #
Wrap the callback into a GClosure
.
mk_AuthDomainBasicAuthCallback :: C_AuthDomainBasicAuthCallback -> IO (FunPtr C_AuthDomainBasicAuthCallback) Source #
Generate a function pointer callable from C code, from a C_AuthDomainBasicAuthCallback
.
noAuthDomainBasicAuthCallback :: Maybe AuthDomainBasicAuthCallback Source #
A convenience synonym for
.Nothing
:: Maybe
AuthDomainBasicAuthCallback
noAuthDomainBasicAuthCallback_WithClosures :: Maybe AuthDomainBasicAuthCallback_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
AuthDomainBasicAuthCallback_WithClosures
wrap_AuthDomainBasicAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainBasicAuthCallback)) -> AuthDomainBasicAuthCallback_WithClosures -> C_AuthDomainBasicAuthCallback Source #
Wrap a AuthDomainBasicAuthCallback
into a C_AuthDomainBasicAuthCallback
.
AuthDomainDigestAuthCallback
type AuthDomainDigestAuthCallback Source #
= AuthDomainDigest |
|
-> ServerMessage |
|
-> Text |
|
-> IO (Maybe Text) | Returns: the encoded password, or |
Callback used by AuthDomainDigest
for authentication purposes.
The application should look up username
in its password database,
and return the corresponding encoded password (see
AuthDomainDigest.encode_password
.
type AuthDomainDigestAuthCallback_WithClosures Source #
= AuthDomainDigest |
|
-> ServerMessage |
|
-> Text |
|
-> Ptr () |
|
-> IO (Maybe Text) | Returns: the encoded password, or |
Callback used by AuthDomainDigest
for authentication purposes.
The application should look up username
in its password database,
and return the corresponding encoded password (see
AuthDomainDigest.encode_password
.
type C_AuthDomainDigestAuthCallback = Ptr AuthDomainDigest -> Ptr ServerMessage -> CString -> Ptr () -> IO CString Source #
Type for the callback on the (unwrapped) C side.
drop_closures_AuthDomainDigestAuthCallback :: AuthDomainDigestAuthCallback -> AuthDomainDigestAuthCallback_WithClosures Source #
A simple wrapper that ignores the closure arguments.
dynamic_AuthDomainDigestAuthCallback Source #
:: (HasCallStack, MonadIO m, IsAuthDomainDigest a, IsServerMessage b) | |
=> FunPtr C_AuthDomainDigestAuthCallback | |
-> a |
|
-> b |
|
-> Text |
|
-> Ptr () |
|
-> m (Maybe Text) | Returns: the encoded password, or |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_AuthDomainDigestAuthCallback :: MonadIO m => AuthDomainDigestAuthCallback -> m (GClosure C_AuthDomainDigestAuthCallback) Source #
Wrap the callback into a GClosure
.
mk_AuthDomainDigestAuthCallback :: C_AuthDomainDigestAuthCallback -> IO (FunPtr C_AuthDomainDigestAuthCallback) Source #
Generate a function pointer callable from C code, from a C_AuthDomainDigestAuthCallback
.
noAuthDomainDigestAuthCallback :: Maybe AuthDomainDigestAuthCallback Source #
A convenience synonym for
.Nothing
:: Maybe
AuthDomainDigestAuthCallback
noAuthDomainDigestAuthCallback_WithClosures :: Maybe AuthDomainDigestAuthCallback_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
AuthDomainDigestAuthCallback_WithClosures
wrap_AuthDomainDigestAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainDigestAuthCallback)) -> AuthDomainDigestAuthCallback_WithClosures -> C_AuthDomainDigestAuthCallback Source #
Wrap a AuthDomainDigestAuthCallback
into a C_AuthDomainDigestAuthCallback
.
AuthDomainFilter
type AuthDomainFilter Source #
= AuthDomain |
|
-> ServerMessage |
|
-> IO Bool |
The prototype for a AuthDomain
filter.
See [methodauthDomain
.set_filter] for details.
type AuthDomainFilter_WithClosures Source #
= AuthDomain |
|
-> ServerMessage |
|
-> Ptr () |
|
-> IO Bool |
The prototype for a AuthDomain
filter.
See [methodauthDomain
.set_filter] for details.
type C_AuthDomainFilter = Ptr AuthDomain -> Ptr ServerMessage -> Ptr () -> IO CInt Source #
Type for the callback on the (unwrapped) C side.
drop_closures_AuthDomainFilter :: AuthDomainFilter -> AuthDomainFilter_WithClosures Source #
A simple wrapper that ignores the closure arguments.
dynamic_AuthDomainFilter Source #
:: (HasCallStack, MonadIO m, IsAuthDomain a, IsServerMessage b) | |
=> FunPtr C_AuthDomainFilter | |
-> a |
|
-> b |
|
-> Ptr () |
|
-> m Bool |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_AuthDomainFilter :: MonadIO m => AuthDomainFilter -> m (GClosure C_AuthDomainFilter) Source #
Wrap the callback into a GClosure
.
mk_AuthDomainFilter :: C_AuthDomainFilter -> IO (FunPtr C_AuthDomainFilter) Source #
Generate a function pointer callable from C code, from a C_AuthDomainFilter
.
noAuthDomainFilter :: Maybe AuthDomainFilter Source #
A convenience synonym for
.Nothing
:: Maybe
AuthDomainFilter
noAuthDomainFilter_WithClosures :: Maybe AuthDomainFilter_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
AuthDomainFilter_WithClosures
wrap_AuthDomainFilter :: Maybe (Ptr (FunPtr C_AuthDomainFilter)) -> AuthDomainFilter_WithClosures -> C_AuthDomainFilter Source #
Wrap a AuthDomainFilter
into a C_AuthDomainFilter
.
AuthDomainGenericAuthCallback
type AuthDomainGenericAuthCallback Source #
= AuthDomain |
|
-> ServerMessage |
|
-> Text |
|
-> IO Bool |
The prototype for a AuthDomain
generic authentication callback.
The callback should look up the user's password, call
[methodauthDomain
.check_password], and use the return value from that method
as its own return value.
In general, for security reasons, it is preferable to use the
auth-domain-specific auth callbacks (eg,
[callbackauthDomainBasicAuthCallback
] and
[callbackauthDomainDigestAuthCallback
]), because they don't require
keeping a cleartext password database. Most users will use the same
password for many different sites, meaning if any site with a
cleartext password database is compromised, accounts on other
servers might be compromised as well. For many of the cases where
[classserver
] is used, this is not really relevant, but it may still
be worth considering.
type AuthDomainGenericAuthCallback_WithClosures Source #
= AuthDomain |
|
-> ServerMessage |
|
-> Text |
|
-> Ptr () |
|
-> IO Bool |
The prototype for a AuthDomain
generic authentication callback.
The callback should look up the user's password, call
[methodauthDomain
.check_password], and use the return value from that method
as its own return value.
In general, for security reasons, it is preferable to use the
auth-domain-specific auth callbacks (eg,
[callbackauthDomainBasicAuthCallback
] and
[callbackauthDomainDigestAuthCallback
]), because they don't require
keeping a cleartext password database. Most users will use the same
password for many different sites, meaning if any site with a
cleartext password database is compromised, accounts on other
servers might be compromised as well. For many of the cases where
[classserver
] is used, this is not really relevant, but it may still
be worth considering.
type C_AuthDomainGenericAuthCallback = Ptr AuthDomain -> Ptr ServerMessage -> CString -> Ptr () -> IO CInt Source #
Type for the callback on the (unwrapped) C side.
drop_closures_AuthDomainGenericAuthCallback :: AuthDomainGenericAuthCallback -> AuthDomainGenericAuthCallback_WithClosures Source #
A simple wrapper that ignores the closure arguments.
dynamic_AuthDomainGenericAuthCallback Source #
:: (HasCallStack, MonadIO m, IsAuthDomain a, IsServerMessage b) | |
=> FunPtr C_AuthDomainGenericAuthCallback | |
-> a |
|
-> b |
|
-> Text |
|
-> Ptr () |
|
-> m Bool |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_AuthDomainGenericAuthCallback :: MonadIO m => AuthDomainGenericAuthCallback -> m (GClosure C_AuthDomainGenericAuthCallback) Source #
Wrap the callback into a GClosure
.
mk_AuthDomainGenericAuthCallback :: C_AuthDomainGenericAuthCallback -> IO (FunPtr C_AuthDomainGenericAuthCallback) Source #
Generate a function pointer callable from C code, from a C_AuthDomainGenericAuthCallback
.
noAuthDomainGenericAuthCallback :: Maybe AuthDomainGenericAuthCallback Source #
A convenience synonym for
.Nothing
:: Maybe
AuthDomainGenericAuthCallback
noAuthDomainGenericAuthCallback_WithClosures :: Maybe AuthDomainGenericAuthCallback_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
AuthDomainGenericAuthCallback_WithClosures
wrap_AuthDomainGenericAuthCallback :: Maybe (Ptr (FunPtr C_AuthDomainGenericAuthCallback)) -> AuthDomainGenericAuthCallback_WithClosures -> C_AuthDomainGenericAuthCallback Source #
Wrap a AuthDomainGenericAuthCallback
into a C_AuthDomainGenericAuthCallback
.
LoggerFilter
type C_LoggerFilter = Ptr Logger -> Ptr Message -> Ptr () -> IO CUInt Source #
Type for the callback on the (unwrapped) C side.
type LoggerFilter Source #
= Logger |
|
-> Message |
|
-> IO LoggerLogLevel | Returns: a [enum |
The prototype for a logging filter.
The filter callback will be invoked for each request or response, and should
analyze it and return a [enumloggerLogLevel
] value indicating how much of
the message to log.
type LoggerFilter_WithClosures Source #
= Logger |
|
-> Message |
|
-> Ptr () |
|
-> IO LoggerLogLevel | Returns: a [enum |
The prototype for a logging filter.
The filter callback will be invoked for each request or response, and should
analyze it and return a [enumloggerLogLevel
] value indicating how much of
the message to log.
drop_closures_LoggerFilter :: LoggerFilter -> LoggerFilter_WithClosures Source #
A simple wrapper that ignores the closure arguments.
:: (HasCallStack, MonadIO m, IsLogger a, IsMessage b) | |
=> FunPtr C_LoggerFilter | |
-> a |
|
-> b |
|
-> Ptr () |
|
-> m LoggerLogLevel | Returns: a [enum |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_LoggerFilter :: MonadIO m => LoggerFilter -> m (GClosure C_LoggerFilter) Source #
Wrap the callback into a GClosure
.
mk_LoggerFilter :: C_LoggerFilter -> IO (FunPtr C_LoggerFilter) Source #
Generate a function pointer callable from C code, from a C_LoggerFilter
.
noLoggerFilter :: Maybe LoggerFilter Source #
A convenience synonym for
.Nothing
:: Maybe
LoggerFilter
noLoggerFilter_WithClosures :: Maybe LoggerFilter_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
LoggerFilter_WithClosures
wrap_LoggerFilter :: Maybe (Ptr (FunPtr C_LoggerFilter)) -> LoggerFilter_WithClosures -> C_LoggerFilter Source #
Wrap a LoggerFilter
into a C_LoggerFilter
.
LoggerPrinter
type C_LoggerPrinter = Ptr Logger -> CUInt -> Int8 -> CString -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type LoggerPrinter Source #
= Logger |
|
-> LoggerLogLevel |
|
-> Int8 |
|
-> Text |
|
-> IO () |
The prototype for a custom printing callback.
level
indicates what kind of information is being printed. Eg, it
will be LoggerLogLevelHeaders
if data
is header data.
direction
is either '<', '>', or ' ', and data
is the single line
to print; the printer is expected to add a terminating newline.
To get the effect of the default printer, you would do:
c code
printf ("%c %s\n", direction, data);
type LoggerPrinter_WithClosures Source #
= Logger |
|
-> LoggerLogLevel |
|
-> Int8 |
|
-> Text |
|
-> Ptr () |
|
-> IO () |
The prototype for a custom printing callback.
level
indicates what kind of information is being printed. Eg, it
will be LoggerLogLevelHeaders
if data
is header data.
direction
is either '<', '>', or ' ', and data
is the single line
to print; the printer is expected to add a terminating newline.
To get the effect of the default printer, you would do:
c code
printf ("%c %s\n", direction, data);
drop_closures_LoggerPrinter :: LoggerPrinter -> LoggerPrinter_WithClosures Source #
A simple wrapper that ignores the closure arguments.
dynamic_LoggerPrinter Source #
:: (HasCallStack, MonadIO m, IsLogger a) | |
=> FunPtr C_LoggerPrinter | |
-> a |
|
-> LoggerLogLevel |
|
-> Int8 |
|
-> Text |
|
-> Ptr () |
|
-> m () |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_LoggerPrinter :: MonadIO m => LoggerPrinter -> m (GClosure C_LoggerPrinter) Source #
Wrap the callback into a GClosure
.
mk_LoggerPrinter :: C_LoggerPrinter -> IO (FunPtr C_LoggerPrinter) Source #
Generate a function pointer callable from C code, from a C_LoggerPrinter
.
noLoggerPrinter :: Maybe LoggerPrinter Source #
A convenience synonym for
.Nothing
:: Maybe
LoggerPrinter
noLoggerPrinter_WithClosures :: Maybe LoggerPrinter_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
LoggerPrinter_WithClosures
wrap_LoggerPrinter :: Maybe (Ptr (FunPtr C_LoggerPrinter)) -> LoggerPrinter_WithClosures -> C_LoggerPrinter Source #
Wrap a LoggerPrinter
into a C_LoggerPrinter
.
MessageHeadersForeachFunc
type C_MessageHeadersForeachFunc = CString -> CString -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type MessageHeadersForeachFunc Source #
The callback passed to [methodmessageHeaders
.foreach].
type MessageHeadersForeachFunc_WithClosures Source #
= Text |
|
-> Text |
|
-> Ptr () |
|
-> IO () |
The callback passed to [methodmessageHeaders
.foreach].
drop_closures_MessageHeadersForeachFunc :: MessageHeadersForeachFunc -> MessageHeadersForeachFunc_WithClosures Source #
A simple wrapper that ignores the closure arguments.
dynamic_MessageHeadersForeachFunc Source #
:: (HasCallStack, MonadIO m) | |
=> FunPtr C_MessageHeadersForeachFunc | |
-> Text |
|
-> Text |
|
-> Ptr () |
|
-> m () |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_MessageHeadersForeachFunc :: MonadIO m => MessageHeadersForeachFunc -> m (GClosure C_MessageHeadersForeachFunc) Source #
Wrap the callback into a GClosure
.
mk_MessageHeadersForeachFunc :: C_MessageHeadersForeachFunc -> IO (FunPtr C_MessageHeadersForeachFunc) Source #
Generate a function pointer callable from C code, from a C_MessageHeadersForeachFunc
.
noMessageHeadersForeachFunc :: Maybe MessageHeadersForeachFunc Source #
A convenience synonym for
.Nothing
:: Maybe
MessageHeadersForeachFunc
noMessageHeadersForeachFunc_WithClosures :: Maybe MessageHeadersForeachFunc_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
MessageHeadersForeachFunc_WithClosures
wrap_MessageHeadersForeachFunc :: Maybe (Ptr (FunPtr C_MessageHeadersForeachFunc)) -> MessageHeadersForeachFunc_WithClosures -> C_MessageHeadersForeachFunc Source #
Wrap a MessageHeadersForeachFunc
into a C_MessageHeadersForeachFunc
.
ServerCallback
type C_ServerCallback = Ptr Server -> Ptr ServerMessage -> CString -> Ptr (GHashTable CString CString) -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ServerCallback Source #
= Server |
|
-> ServerMessage |
|
-> Text |
|
-> Maybe (Map Text Text) |
|
-> IO () |
A callback used to handle requests to a [classserver
].
path
and query
contain the likewise-named components of the
Request-URI, subject to certain assumptions. By default,
[classserver
] decodes all percent-encoding in the URI path, such that
"/foo%2Fbar"
is treated the same as "/foo/bar"
. If your
server is serving resources in some non-POSIX-filesystem namespace,
you may want to distinguish those as two distinct paths. In that
case, you can set the [propertyserver
:raw-paths] property when creating
the [classserver
], and it will leave those characters undecoded.
query
contains the query component of the Request-URI parsed according to
the rules for HTML form handling. Although this is the only commonly-used
query string format in HTTP, there is nothing that actually requires that
HTTP URIs use that format; if your server needs to use some other format, you
can just ignore query
, and call [methodmessage
.get_uri] and parse the URI's
query field yourself.
See [methodserver
.add_handler] and [methodserver
.add_early_handler]
for details of what handlers can/should do.
type ServerCallback_WithClosures Source #
= Server |
|
-> ServerMessage |
|
-> Text |
|
-> Maybe (Map Text Text) |
|
-> Ptr () |
|
-> IO () |
A callback used to handle requests to a [classserver
].
path
and query
contain the likewise-named components of the
Request-URI, subject to certain assumptions. By default,
[classserver
] decodes all percent-encoding in the URI path, such that
"/foo%2Fbar"
is treated the same as "/foo/bar"
. If your
server is serving resources in some non-POSIX-filesystem namespace,
you may want to distinguish those as two distinct paths. In that
case, you can set the [propertyserver
:raw-paths] property when creating
the [classserver
], and it will leave those characters undecoded.
query
contains the query component of the Request-URI parsed according to
the rules for HTML form handling. Although this is the only commonly-used
query string format in HTTP, there is nothing that actually requires that
HTTP URIs use that format; if your server needs to use some other format, you
can just ignore query
, and call [methodmessage
.get_uri] and parse the URI's
query field yourself.
See [methodserver
.add_handler] and [methodserver
.add_early_handler]
for details of what handlers can/should do.
drop_closures_ServerCallback :: ServerCallback -> ServerCallback_WithClosures Source #
A simple wrapper that ignores the closure arguments.
dynamic_ServerCallback Source #
:: (HasCallStack, MonadIO m, IsServer a, IsServerMessage b) | |
=> FunPtr C_ServerCallback | |
-> a |
|
-> b |
|
-> Text |
|
-> Maybe (Map Text Text) |
|
-> Ptr () |
|
-> m () |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_ServerCallback :: MonadIO m => ServerCallback -> m (GClosure C_ServerCallback) Source #
Wrap the callback into a GClosure
.
mk_ServerCallback :: C_ServerCallback -> IO (FunPtr C_ServerCallback) Source #
Generate a function pointer callable from C code, from a C_ServerCallback
.
noServerCallback :: Maybe ServerCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ServerCallback
noServerCallback_WithClosures :: Maybe ServerCallback_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
ServerCallback_WithClosures
wrap_ServerCallback :: Maybe (Ptr (FunPtr C_ServerCallback)) -> ServerCallback_WithClosures -> C_ServerCallback Source #
Wrap a ServerCallback
into a C_ServerCallback
.
ServerWebsocketCallback
type C_ServerWebsocketCallback = Ptr Server -> Ptr ServerMessage -> CString -> Ptr WebsocketConnection -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ServerWebsocketCallback Source #
= Server |
|
-> ServerMessage |
|
-> Text |
|
-> WebsocketConnection |
|
-> IO () |
A callback used to handle WebSocket requests to a Server
.
The callback will be invoked after sending the handshake response back to the client (and is only invoked if the handshake was successful).
path
contains the path of the Request-URI, subject to the same
rules as [callbackserverCallback
] (qv)
.
type ServerWebsocketCallback_WithClosures Source #
= Server |
|
-> ServerMessage |
|
-> Text |
|
-> WebsocketConnection |
|
-> Ptr () |
|
-> IO () |
A callback used to handle WebSocket requests to a Server
.
The callback will be invoked after sending the handshake response back to the client (and is only invoked if the handshake was successful).
path
contains the path of the Request-URI, subject to the same
rules as [callbackserverCallback
] (qv)
.
drop_closures_ServerWebsocketCallback :: ServerWebsocketCallback -> ServerWebsocketCallback_WithClosures Source #
A simple wrapper that ignores the closure arguments.
dynamic_ServerWebsocketCallback Source #
:: (HasCallStack, MonadIO m, IsServer a, IsServerMessage b, IsWebsocketConnection c) | |
=> FunPtr C_ServerWebsocketCallback | |
-> a |
|
-> b |
|
-> Text |
|
-> c |
|
-> Ptr () |
|
-> m () |
Given a pointer to a foreign C function, wrap it into a function callable from Haskell.
genClosure_ServerWebsocketCallback :: MonadIO m => ServerWebsocketCallback -> m (GClosure C_ServerWebsocketCallback) Source #
Wrap the callback into a GClosure
.
mk_ServerWebsocketCallback :: C_ServerWebsocketCallback -> IO (FunPtr C_ServerWebsocketCallback) Source #
Generate a function pointer callable from C code, from a C_ServerWebsocketCallback
.
noServerWebsocketCallback :: Maybe ServerWebsocketCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ServerWebsocketCallback
noServerWebsocketCallback_WithClosures :: Maybe ServerWebsocketCallback_WithClosures Source #
A convenience synonym for
.Nothing
:: Maybe
ServerWebsocketCallback_WithClosures