mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-06-07 08:51:59 +00:00
smp server: additional control port commands to monitor server state (#1228)
* smp server: additional control port commands to monitor server state * fix * space
This commit is contained in:
committed by
GitHub
parent
8dd54ced0e
commit
492d2f86bc
@@ -9,6 +9,7 @@ import Simplex.Messaging.Encoding.String
|
||||
import Simplex.Messaging.Protocol (BasicAuth)
|
||||
|
||||
data CPClientRole = CPRNone | CPRUser | CPRAdmin
|
||||
deriving (Eq)
|
||||
|
||||
data ControlProtocol
|
||||
= CPAuth BasicAuth
|
||||
@@ -20,6 +21,7 @@ data ControlProtocol
|
||||
| CPThreads
|
||||
| CPSockets
|
||||
| CPSocketThreads
|
||||
| CPServerInfo
|
||||
| CPDelete ByteString
|
||||
| CPSave
|
||||
| CPHelp
|
||||
@@ -37,6 +39,7 @@ instance StrEncoding ControlProtocol where
|
||||
CPThreads -> "threads"
|
||||
CPSockets -> "sockets"
|
||||
CPSocketThreads -> "socket-threads"
|
||||
CPServerInfo -> "server-info"
|
||||
CPDelete bs -> "delete " <> strEncode bs
|
||||
CPSave -> "save"
|
||||
CPHelp -> "help"
|
||||
@@ -53,6 +56,7 @@ instance StrEncoding ControlProtocol where
|
||||
"threads" -> pure CPThreads
|
||||
"sockets" -> pure CPSockets
|
||||
"socket-threads" -> pure CPSocketThreads
|
||||
"server-info" -> pure CPServerInfo
|
||||
"delete" -> CPDelete <$> (A.space *> strP)
|
||||
"save" -> pure CPSave
|
||||
"help" -> pure CPHelp
|
||||
|
||||
Reference in New Issue
Block a user