Documentation ¶
Index ¶
- func ConvertInterfaceToSlice(slice interface{}) []interface{}
- func ConvertInterfaceToStringSlice(slice interface{}) []string
- func CreateFile(filePath string, content string) error
- func CreateFolder(dir string) (string, error)
- func DecryptNonce(nonceHash string) (string, error)
- func DeleteFromArray(original, valuesToDelete []string) []string
- func EncryptNonce(nonce string) (string, error)
- func FindDeletedValues(original, updated []string) []string
- func GenerateCodeChallenge() (string, string)
- func GenerateNonce() (string, string, error)
- func GenerateOTP() string
- func GenerateTOTPRecoveryCode() string
- func GetEmailVerificationURL(token, hostname, redirectURI string) string
- func GetForgotPasswordURL(token, redirectURI string) string
- func GetIP(r *http.Request) string
- func GetInviteVerificationURL(verificationURL, token, redirectURI string) string
- func GetOrganization() map[string]interface{}
- func GetPagination(paginatedInput *model.PaginatedInput) *model.Pagination
- func GetUserAgent(r *http.Request) string
- func GinContextFromContext(ctx context.Context) (*gin.Context, error)
- func HandleRedirectORJsonResponse(c *gin.Context, httpResponse int, response map[string]interface{}, ...)
- func ParseDurationInSeconds(s string) (time.Duration, error)
- func RegisterEvent(ctx context.Context, eventName string, authRecipe string, user *models.User) error
- func RemoveDuplicateString(strSlice []string) []string
- func StringSliceContains(s []string, e string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertInterfaceToSlice ¶
func ConvertInterfaceToSlice(slice interface{}) []interface{}
ConvertInterfaceToSlice to convert interface to slice interface
func ConvertInterfaceToStringSlice ¶
func ConvertInterfaceToStringSlice(slice interface{}) []string
ConvertInterfaceToStringSlice to convert interface to string slice
func CreateFile ¶
CreateFile creates a file on given path with given content
func CreateFolder ¶
CreateFolder creates a folder in Current working dir
func DeleteFromArray ¶
DeleteFromArray will delete array from an array
func FindDeletedValues ¶
FindDeletedValues find deleted values between original and updated one
func GenerateCodeChallenge ¶
GenerateCodeChallenge creates PKCE-Code-Challenge and returns the verifier and challenge
func GenerateNonce ¶
GenerateNonce generats random nonce string and returns the nonce string, nonce hash, error
func GenerateTOTPRecoveryCode ¶
func GenerateTOTPRecoveryCode() string
GenerateTOTPRecoveryCode generates a random 16-character recovery code.
func GetEmailVerificationURL ¶
GetEmailVerificationURL to get url for invite email verification
func GetForgotPasswordURL ¶
GetForgotPasswordURL to get url for given token and hostname
func GetInviteVerificationURL ¶
GetInviteVerificationURL to get url for invite email verification
func GetOrganization ¶
func GetOrganization() map[string]interface{}
GetOrganization to get organization object
func GetPagination ¶
func GetPagination(paginatedInput *model.PaginatedInput) *model.Pagination
GetPagination helps getting pagination data from paginated input also returns default limit and offset if pagination data is not present
func GetUserAgent ¶
GetUserAgent helps in getting the user agent from the request
func GinContextFromContext ¶
GinContext to get gin context from context
func HandleRedirectORJsonResponse ¶
func HandleRedirectORJsonResponse(c *gin.Context, httpResponse int, response map[string]interface{}, redirectURL string)
HandleRedirectORJsonResponse handles the response based on redirectURL
func ParseDurationInSeconds ¶
ParseDurationInSeconds parses input s, removes ms/us/ns and returns result duration
func RegisterEvent ¶
func RegisterEvent(ctx context.Context, eventName string, authRecipe string, user *models.User) error
RegisterEvent util to register event TODO change user to user ref
func RemoveDuplicateString ¶
RemoveDuplicateString removes duplicate strings from a string slice
func StringSliceContains ¶
StringSliceContains checks if a string slice contains a particular string
Types ¶
This section is empty.