utils

package
v0.0.0-...-4811c58 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidTeamID = errors.New("invalid teamid")
View Source
var TitleCaser cases.Caser

Functions

func CreateToken

func CreateToken(payload TokenPayload, tokenType TokenType) (string, error)

func GenerateOTP

func GenerateOTP(length int) (string, error)

func GenerateUniqueTeamCode

func GenerateUniqueTeamCode() string

func InitCaser

func InitCaser()

func SendMail

func SendMail(to, subject, body string) error

Types

type TokenPayload

type TokenPayload struct {
	Exp          time.Duration
	Email        string
	Role         string
	TokenVersion int
}

type TokenType

type TokenType int
const (
	ACCESS_TOKEN TokenType = iota
	REFRESH_TOKEN
)

type Validator

type Validator struct {
	Validator *validator.Validate
}

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

Jump to

Keyboard shortcuts

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