Documentation
¶
Index ¶
- func Clean(s string) string
- func CleanAndTruncate(s string, max int) string
- func FirstLetter(s string, max int) string
- func FirstToUpper(text string) string
- func IsTrue(value interface{}) bool
- func IsTwitterUrl(twitterUrl string) bool
- func IsUrl(stringUrl string) bool
- func NanoId(length ...int) string
- func NewGoment(args ...interface{}) *goment.PortalnesiaGoment
- func NumberSize(bytes float64, precision int) string
- func ParseUrl(s string) (string, error)
- func SeparateNumber(number int64) string
- func Slug(s string) string
- func TimeAgo(seconds int64) stringdeprecated
- func Truncate(s string, max int) string
- func Ucwords(s string) string
- func ValidateEmail(e string) bool
- type NumberFormatType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanAndTruncate ¶
Clean HTML format and truncate string
func FirstLetter ¶
Parse string to first letter uppercase
Example: "Hello world" => "HM"
If max is less than 1, function return all first letter of strings
func NewGoment ¶ added in v1.0.2
func NewGoment(args ...interface{}) *goment.PortalnesiaGoment
New goment instance
Alias of goment.Must
func ParseUrl ¶
Parse raw URL to clean URL
Example: "https://portalnesia.com/contact" => "portalnesia.com/contact"
func TimeAgo
deprecated
Format second integer to human readable `timeago` format
Example: `11 minutes ago`
Deprecated: use the goment.PortalnesiaGoment.TimeAgo instead
Will be removed in the next minor updates
func Truncate ¶
Truncate string
Example: "lorem ipsum lorem ipsum lorem ipsum" => "lorem ipsum lor..."
Types ¶
type NumberFormatType ¶
func NumberFormatShort ¶
func NumberFormatShort(n int64) NumberFormatType
Format integer to K,M,B,T format
Example: 64768456 => "64.77 M"