strutils

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CharsetNums  = "0123456789"
	CharsetLower = "abcdefghijklmnopqrstuvwxyz"
	CharsetUpper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
)

Variables

This section is empty.

Functions

func GravatarURL

func GravatarURL(email string, size int) string

GravatarURL returns a valid Gravatar URL for the given email id. Size parameter is passed to the URL to make thumbnail of given size.

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail returns true if the given email is valid.

func OneOf

func OneOf(item string, arr []string) bool

func Ptr

func Ptr(s string) *string

Ptr returns the given string as a string-pointer.

func RandStr

func RandStr(n int, charset ...string) string

RandStr returns a random string of length 'n'. Characters are picked from the charset if provided or alphanumeric characters are used.

func SnakeCase

func SnakeCase(input string) string

SnakeCase converts the given string to snake_case version.

Types

This section is empty.

Jump to

Keyboard shortcuts

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