str

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultStringIfEmpty

func DefaultStringIfEmpty(str string, defaultString string) string

func GenerateSlug

func GenerateSlug(name string) string

func GenerateUserSlug

func GenerateUserSlug(email string) string

GenerateUserSlug as follows in case user email begins with a digit, 20230123@acme.org the returned user slug is `u2023123_acme_org`, otherwise removes all the non-alpha numeric characters from the provided email and returns an _ separated slug. For eg: "$john-doe@acme.org" returns "johndoe_acme_org". This is used in invitation service to create relations between user email and invitation.

func Slugify

func Slugify(str string, options SlugifyOptions) string

Types

type SlugifyOptions

type SlugifyOptions struct {
	KeepHyphen bool
	KeepColon  bool
	KeepHash   bool
}

Jump to

Keyboard shortcuts

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