mirror of
https://github.com/safing/portbase
synced 2025-09-09 13:55:47 +00:00
Add API client lib
This commit is contained in:
parent
ff4248822b
commit
601b1384d1
5 changed files with 566 additions and 0 deletions
30
api/client/const.go
Normal file
30
api/client/const.go
Normal file
|
@ -0,0 +1,30 @@
|
|||
package client
|
||||
|
||||
// message types
|
||||
const (
|
||||
msgRequestGet = "get"
|
||||
msgRequestQuery = "query"
|
||||
msgRequestSub = "sub"
|
||||
msgRequestQsub = "qsub"
|
||||
msgRequestCreate = "create"
|
||||
msgRequestUpdate = "update"
|
||||
msgRequestInsert = "insert"
|
||||
msgRequestDelete = "delete"
|
||||
|
||||
MsgOk = "ok"
|
||||
MsgError = "error"
|
||||
MsgDone = "done"
|
||||
MsgSuccess = "success"
|
||||
MsgUpdate = "upd"
|
||||
MsgNew = "new"
|
||||
MsgDelete = "del"
|
||||
MsgWarning = "warning"
|
||||
|
||||
MsgOffline = "offline" // special message type for signaling the handler that the connection was lost
|
||||
|
||||
apiSeperator = "|"
|
||||
)
|
||||
|
||||
var (
|
||||
apiSeperatorBytes = []byte(apiSeperator)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue