controller

package
v0.0.0-...-7d84395 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

DB variable is exported to use on the whole project. Connection is set by using driver/connection.

Functions

func CreateTempFile

func CreateTempFile(image []byte) *os.File

CreateTempFile creates temp file by using given byte array.

func GetSecretMessageFromImage

func GetSecretMessageFromImage(image []byte, passphrase string) string

GetSecretMessageFromImage gets secret from image by using DecodeSteganography method.

func IsChanged

func IsChanged(body string, hash string) bool

IsChanged checks if mail is changed.

func IsSignatureReal

func IsSignatureReal(publicKey ed25519.PublicKey, hash []byte, signature []byte) bool

IsSignatureReal checks if mail is signed by the right user..

func LogIn

func LogIn(username string, password string) model.User

LogIn takes username and password. It returns user that match If there is.

func Mails

func Mails(user model.User, take string) []model.Mail

Users can see their mails. It also support 'take' option to limit messages.

func RandomMails

func RandomMails() string

RandomMails creates random mails that contains 20 words.

func SendMail

func SendMail(from model.User, to model.User, body string, keyFromUser string, secretMessage string, passphrase string, watermark string, imagePath string) (bool, model.Mail)

SendMail sends mails from-user to to-user. It also supports signature.

If mail is sent, method will return true and mail that is sent. If could not sent, method will return false and nil.

func Set2faActive

func Set2faActive(user *model.User) bool

Set2faInactive methods remove make 2FA option true for the account

func Set2faInactive

func Set2faInactive(user *model.User) bool

Set2faInactive methods remove make 2FA option false for the account

func SetMailUser

func SetMailUser(mail *model.Mail)

func SingUp

func SingUp(username string, password string) (bool, model.User)

SingUp creates user if there is not already.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL