Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SignMessage ¶
SignMessage signs messages from base64 and return a base64 signature (empty string if the signature can't be generated) The signature contains these elements concatenated: The message (UTF-8 to bytes) The author's public key The author's declared name The eventual messageId, empty if this is an original post
func VerifyFromString ¶
Types ¶
type Message ¶
type Message struct { // Stored and generated ID string `gorm:"primary_key"` CreatedAt time.Time // Stored and given by user DisplayedName string // Name Chosen by author, no restriction but < 50 char AuthorBase64 string // Encoded in URL-safe Base64 Content string SignatureBase64 string // Encoded in URL-safe Base64 MessageID string // Used if the message is a comment to a publication // Only for display on client, computed from known values Correct bool `json:"-" gorm:"-"` ColorPrimary string `json:"-" gorm:"-"` ColorSecondary string `json:"-" gorm:"-"` DisplayedDate string `json:"-" gorm:"-"` Pod string `gorm:"-"` // Not saved in db but tell where it is sent from so remains in JSON }
func CleanMessagesOutFromDB ¶
CleanMessagesOutFromDB get data from DB and do some checks and verifications
func SortByDate ¶
func (Message) VerifyConstraints ¶ added in v0.8.8
VerifyConstraints returns HTTP status code and an error Checks that the messages constraints are inherently met -independently from the database & server.
func (Message) VerifyOwnerShip ¶
Click to show internal directories.
Click to hide internal directories.