util

package
v0.0.0-...-2e7266e Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateAnonID

func GenerateAnonID(phoneNo string) string

GenerateAnonID takes a phone number and generates an ID thats almost guaranteed to be unique.

func HashPassword

func HashPassword(password string) (string, error)

HashPassword takes plaintext password as input and returns its hashed value.

func HealthStatusValueIsAllowed

func HealthStatusValueIsAllowed(risk float64) bool

HealthStatusValueIsAllowed is a utility function to check if a particular value of risk given by user is allowed.

func LoadEnv

func LoadEnv(path string)

LoadEnv takes the path of a .env file and uses it to set environment variables

func LoadEnvFromPath

func LoadEnvFromPath(dirPath string)

LoadEnvFromPath will load the environment variables

func MatchesWithHash

func MatchesWithHash(password, hash string) bool

MatchesWithHash returns true if password matches with hash.

func SendNotification

func SendNotification(fcmKey string, regToken string, n map[string]interface{})

SendNotification sends a notification to a user with a given firebase regToken

Types

This section is empty.

Jump to

Keyboard shortcuts

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