Documentation ¶
Index ¶
Constants ¶
View Source
const MinRankChangeConversationDetails = RankModerator
View Source
const MinRankDeleteConversation = RankAdmin
View Source
const MinRankManageMembers = RankModerator
* Permissions
View Source
const MinRankManageModerators = RankAdmin
View Source
const RankAdmin = 2 // Manages moderators and can delete the conversation
View Source
const RankModerator = 1 // Can remove/add users
View Source
const RankUser = 0
* Ranks
View Source
const TypeGroup = 1
View Source
const TypePrivateMessage = 0
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CertificateClaims ¶
type CertificateClaims struct { Message string `json:"mid"` // Message ID Conversation string `json:"c"` // Conversation ID Sender string `json:"sd"` // Sender ID jwt.RegisteredClaims }
func GetCertificateClaims ¶
func GetCertificateClaims(certificate string) (*CertificateClaims, bool)
Get all claims in a message certificate
type Conversation ¶
type ConversationSpace ¶
type ConversationToken ¶
type ConversationToken struct { ID string `json:"id" gorm:"primaryKey"` Conversation string `json:"conversation" gorm:"not null"` // Conversation ID Activated bool `json:"activated" gorm:"not null"` // Whether the token is activated or not Token string `json:"token" gorm:"not null,unique"` // Long token required to subscribe to the conversation Data string `json:"data" gorm:"not null"` // Encrypted data about the user (account id, username, etc.) Rank uint `json:"rank" gorm:"not null"` LastRead int64 `json:"-" gorm:"not null"` // Last time the user read the conversation Node int64 `json:"node" gorm:"not null"` // Node ID }
type Message ¶
type Message struct { ID string `json:"id" gorm:"primaryKey"` Conversation string `json:"conversation" gorm:"not null"` Certificate string `json:"certificate" gorm:"not null"` Creation int64 `json:"creation"` // Unix timestamp (SET BY THE CLIENT, EXTREMELY IMPORTANT FOR SIGNATURES) Data string `json:"data" gorm:"not null"` // Encrypted data Edited bool `json:"edited" gorm:"not null"` // Edited flag Sender string `json:"sender" gorm:"not null"` // Sender ID (of conversation token) }
type SentConversationToken ¶
Click to show internal directories.
Click to hide internal directories.