databag/net/server/internal/appValues.go

169 lines
4.4 KiB
Go
Raw Normal View History

2022-01-17 05:55:25 +00:00
package databag
2022-07-22 20:55:26 +00:00
//APPTokenSize config for size of random access token
2022-07-22 17:52:13 +00:00
const APPTokenSize = 16
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPBodyLimit config for max size of api body
2022-07-22 17:52:13 +00:00
const APPBodyLimit = 1048576
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPVersion config for current version of api
2022-07-22 23:58:37 +00:00
const APPVersion = "0.1.0"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPCreateExpire config for valid duration of create token
2022-07-22 17:52:13 +00:00
const APPCreateExpire = 86400
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPCreateSize config for size of create token
2022-07-22 17:52:13 +00:00
const APPCreateSize = 16
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPResetExpire config for valid duration of reset token
2022-07-22 17:52:13 +00:00
const APPResetExpire = 86400
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPResetSize config for size of reset token
2022-07-22 17:52:13 +00:00
const APPResetSize = 16
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPConnectExpire config for valid duration of connection message
2022-07-22 17:52:13 +00:00
const APPConnectExpire = 30
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPKeySize config for default key size
2022-07-22 17:52:13 +00:00
const APPKeySize = 4096
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPRSA4096 config for rsa 4096 alg name
2022-07-22 17:52:13 +00:00
const APPRSA4096 = "RSA4096"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPRSA2048 config for rsa 2048 alg name
2022-07-22 17:52:13 +00:00
const APPRSA2048 = "RSA2048"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPSignPKCS1V15 config for pkcsv15 alg name
2022-07-22 17:52:13 +00:00
const APPSignPKCS1V15 = "PKCS1v15"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPSignPSS config for pss alg name
2022-07-22 17:52:13 +00:00
const APPSignPSS = "PSS"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPMsgAuthenticate config for authorize message name
2022-07-22 17:52:13 +00:00
const APPMsgAuthenticate = "authenticate"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPMsgIdentity config for identity message name
2022-07-22 17:52:13 +00:00
const APPMsgIdentity = "identity"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPMsgConnect config for connect message name
2022-07-22 17:52:13 +00:00
const APPMsgConnect = "connect"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPMsgDisconnect config for disconnect message name
2022-07-22 17:52:13 +00:00
const APPMsgDisconnect = "disconnect"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPCardPending config for pending status name
2022-07-22 17:52:13 +00:00
const APPCardPending = "pending"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPCardConfirmed config for confirmed status name
2022-07-22 17:52:13 +00:00
const APPCardConfirmed = "confirmed"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPCardRequested config for requested status name
2022-07-22 17:52:13 +00:00
const APPCardRequested = "requested"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPCardConnecting config for connecting status name
2022-07-22 17:52:13 +00:00
const APPCardConnecting = "connecting"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPCardConnected config for connected status name
2022-07-22 17:52:13 +00:00
const APPCardConnected = "connected"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPNotifyProfile config for notification name for profile
2022-07-22 17:52:13 +00:00
const APPNotifyProfile = "profile"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPNotifyArticle config for notification name for article
2022-07-22 17:52:13 +00:00
const APPNotifyArticle = "article"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPNotifyChannel config for notification name for channel
2022-07-22 17:52:13 +00:00
const APPNotifyChannel = "channel"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPNotifyView config for notification name for view
2022-07-22 17:52:13 +00:00
const APPNotifyView = "view"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTokenAgent config for query param name for self token
2022-07-22 17:52:13 +00:00
const APPTokenAgent = "agent"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTokenContact config for query param name for contact token
2022-07-22 17:52:13 +00:00
const APPTokenContact = "contact"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTokenAttach config for query param name for attach token
2022-07-22 17:52:13 +00:00
const APPTokenAttach = "attach"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTokenCreate config for query param name for create token
2022-07-22 17:52:13 +00:00
const APPTokenCreate = "create"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTokenReset config for query param name for reset token
2022-07-22 17:52:13 +00:00
const APPTokenReset = "reset"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPNotifyBuffer config for size of channel reciving notifications
2022-07-22 17:52:13 +00:00
const APPNotifyBuffer = 4096
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTopicUnconfirmed config for status name for unconfirmed
const APPTopicUnconfirmed = "unconfirmed"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTopicConfirmed config for status name for confirmed
2022-07-22 17:52:13 +00:00
const APPTopicConfirmed = "confirmed"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPAssetReady config for status name for ready
2022-07-22 17:52:13 +00:00
const APPAssetReady = "ready"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPAssetWaiting config for status name for waiting
2022-07-22 17:52:13 +00:00
const APPAssetWaiting = "waiting"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPAssetProcessing config for status name for processing
2022-07-22 17:52:13 +00:00
const APPAssetProcessing = "processing"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPAssetError config for status name for error
2022-07-22 17:52:13 +00:00
const APPAssetError = "error"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTransformComplete config for status name for completed processing
2022-07-22 17:52:13 +00:00
const APPTransformComplete = "complete"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTransformIncomplete config for status name for not complete processing
2022-07-22 17:52:13 +00:00
const APPTransformIncomplete = "incomplete"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPTransformError config for status name for processing error
2022-07-22 17:52:13 +00:00
const APPTransformError = "error"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPQueueAudio config for queue name for audio assets
2022-07-22 17:52:13 +00:00
const APPQueueAudio = "audio"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPQueueVideo config for queue name for video assets
2022-07-22 17:52:13 +00:00
const APPQueueVideo = "video"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPQueuePhoto config for queue name for photo assets
2022-07-22 17:52:13 +00:00
const APPQueuePhoto = "photo"
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPQueueDefault config for queue name for other assets
2022-07-22 17:52:13 +00:00
const APPQueueDefault = ""
2022-07-22 21:42:58 +00:00
2022-07-22 20:55:26 +00:00
//APPDefaultPath config for default path to store assets
2022-07-22 17:52:13 +00:00
const APPDefaultPath = "./asset"
2022-01-20 23:19:26 +00:00
2022-01-21 00:26:59 +00:00
func AppCardStatus(status string) bool {
2022-07-22 19:28:14 +00:00
if status == APPCardPending {
return true
}
if status == APPCardConfirmed {
return true
}
if status == APPCardRequested {
return true
}
if status == APPCardConnecting {
return true
}
if status == APPCardConnected {
return true
}
return false
2022-01-21 00:26:59 +00:00
}
2022-02-19 06:33:13 +00:00
func AppTopicStatus(status string) bool {
2022-07-22 19:28:14 +00:00
if status == APPTopicConfirmed {
return true
}
2022-07-22 20:55:26 +00:00
if status == APPTopicUnconfirmed {
2022-07-22 19:28:14 +00:00
return true
}
return false
2022-02-19 06:33:13 +00:00
}