utils

package
v0.0.0-...-0ca97f1 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckMembership

func CheckMembership(db *mongo.Client) fiber.Handler

func DecrementTestCount

func DecrementTestCount(cfg config.Config, id primitive.ObjectID) error

func GetAllMethods

func GetAllMethods(cfg config.Config) ([]schema.Method, error)

func GetAllModels

func GetAllModels(cfg config.Config) ([]schema.Model, error)

func GetAuthoredReviews

func GetAuthoredReviews(cfg config.Config, reviews []schema.Review, user schema.User) []schema.AuthoredReview

func IncrementTestCount

func IncrementTestCount(cfg config.Config, id primitive.ObjectID) error

func RandomString

func RandomString(n int) string

func SaveMagic

func SaveMagic(client *redis.Client, mail_address string, magic string) error

func SendEmail

func SendEmail(client *courier.Client, to string, template string, data map[string]string) error

func UpdateTestCounts

func UpdateTestCounts(
	cfg config.Config,
	old primitive.ObjectID,
	new primitive.ObjectID) error

func VerifyMagic

func VerifyMagic(client *redis.Client, mail_address string, magic string) error

Types

type HumanDate

type HumanDate struct {
	StartDate string
	EndDate   string
}

func HumanizeDates

func HumanizeDates(tests *[]schema.Test) ([]HumanDate, error)

Jump to

Keyboard shortcuts

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