utils

package
v0.0.0-...-1b1accc Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateQRCode

func GenerateQRCode(content string) ([]byte, error)

GenerateQRCode

func GenerateShortURL

func GenerateShortURL() string

GenerateShortURL generates a short url

func GenerateTrackerImage

func GenerateTrackerImage() []byte

GenerateTrackerImage generates a 1px transparent image which can be used to track emails with a short URL

func GenerateUUID

func GenerateUUID() string

GenerateUUID generates a unique id

func GenerateUUIDWithoutDashes

func GenerateUUIDWithoutDashes() string

GenerateUUIDWithoutDashes generates a unique id without dashes

func GetEnv

func GetEnv(key string) string

GetEnv gets the environment variable

func GetExpireAt

func GetExpireAt(expireIn string) time.Time

GetExpireAt returns the expire at time

func IsValidURL

func IsValidURL(url string) bool

IsValidURL checks if url is valid

func NewUUID

func NewUUID() (uuid string)

NewUUID generates a unique id

func ParseToken

func ParseToken(authorization string) (string, error)

ParseToken parses the token from authorization header

func RandomChars

func RandomChars(length int) string

RandomChars generates a short url URL with length 5, will give 62⁵ = ~916 Million URLs URL with length 6, will give 62⁶ = ~56 Billion URLs URL with length 7, will give 62⁷ = ~3500 Billion URLs

Types

This section is empty.

Jump to

Keyboard shortcuts

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