services

package
v0.0.0-...-8231afe Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const JWT_SECRET = "asfbgakjl;gawobi;ioragjewgnVENBVRWOB"

Variables

View Source
var Logger = httplog.NewLogger("poll-api")

Functions

func CheckDb

func CheckDb() (error, *sql.DB)

func CheckPasswordValidity

func CheckPasswordValidity(password, hash string) bool

func CloseDbConn

func CloseDbConn() error

func CreateJwtToken

func CreateJwtToken(userId string) string

func CreateUser

func CreateUser(user models.User) (string, error)

func DeletePoll

func DeletePoll(id string) error

func GetAllPollsForUser

func GetAllPollsForUser(userId string) ([]models.Poll, error)

func GetPollById

func GetPollById(pollUuid string) (models.Poll, error)

func GetPort

func GetPort() int

func GetUserByEmail

func GetUserByEmail(email string) (*models.User, error)

func HandleError

func HandleError(err error, w *http.ResponseWriter)

func InsertNewPoll

func InsertNewPoll(poll models.Poll) error

func OpenDbConnection

func OpenDbConnection() error

func ParseJwtToken

func ParseJwtToken(tokenString string) (string, float64)

func UpdatePoll

func UpdatePoll(id string, poll models.Poll) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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