utils

package
v0.0.0-...-58c1c1a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateMailer

func AuthenticateMailer()

func CreateCaptcha

func CreateCaptcha() (string, string)

func EndSession

func EndSession(c *gin.Context)

This function deletes the data store about the user from the session storage.

func ExportBallotIdsToFile

func ExportBallotIdsToFile(ballotIds []string, fileName string) error

func ExportSingleVoteBallotIdsToFile

func ExportSingleVoteBallotIdsToFile(ballotIds []models.UsedSingleVoteBallotID, fileName string) error

func GenerateMail

func GenerateMail(recipient *models.MailRecipient, role string) string

Returns a string that represents the mail contents.

func GetRandomAuthCode

func GetRandomAuthCode() string

Function to return a random string to be used as authentication code.

func GetRandomTimeDelay

func GetRandomTimeDelay() time.Duration

Function to get a random time delay after which the vote will be added to the database.

func GetSessionID

func GetSessionID(c *gin.Context) (string, error)

This function returns the identification of the logged in user.

func InitializeRandomSeed

func InitializeRandomSeed()

func SendMailTo

func SendMailTo(recipient *models.MailRecipient, role string) error

func StartSession

func StartSession(c *gin.Context)

This function stores the identification of the logged in user in the encrypted cookie-based session storage.

func VerifyCaptcha

func VerifyCaptcha(id, value string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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