Documentation
¶
Index ¶
- Constants
- func ABTest(data, salt []byte, groups ...uint64) uint64
- func Between(data string, keys ...string) string
- func ByteSliceToString(b []byte) string
- func CommonString(str string) string
- func EmailDomain(email string) string
- func EmailUserName(email string) string
- func GetShortID() ([]byte, error)
- func GetTinyID() ([]byte, error)
- func GetUniqueID() string
- func HashName(name string) string
- func MaskField(str string, keepUnmaskedFront int, keepUnmaskedEnd int) string
- func NFDLowerString(str string) string
- func RandStringBytes(n int) string
- func SafeGet[T any](ptr *T, defaultValue T) T
- func SanitizeEmail(email string) string
- func SimHash(data []byte) uint64
- func SimHashCompare(val1, val2 uint64) uint8
- func Sort(values []interface{}, comparator comparator.Comparator)
- func SplitBetweenTokens(data string, keys ...string) []string
- func SplitByChunks(s string, chunkSize int) []string
- type SafeList
- type SafeMap
Constants ¶
View Source
const ( EmailTagStart = "+" EmailAt = "@" )
Variables ¶
This section is empty.
Functions ¶
func ByteSliceToString ¶
ByteSliceToString cast given bytes to string, without allocation memory
func CommonString ¶
func EmailDomain ¶
func EmailUserName ¶
func NFDLowerString ¶
func RandStringBytes ¶
func SafeGet ¶
func SafeGet[T any](ptr *T, defaultValue T) T
SafeGet return value of pointer, and return default value if it nil
func SanitizeEmail ¶
func SimHashCompare ¶
func Sort ¶
func Sort(values []interface{}, comparator comparator.Comparator)
Sort sorts values (in-place) with respect to the given comparator.
Uses Go's sort (hybrid of quicksort for large and then insertion sort for smaller slices).
func SplitBetweenTokens ¶
SplitBetweenTokens take string and one or two tokens, and cut everything between two tokens, or between two copies of first token
func SplitByChunks ¶
Types ¶
type SafeList ¶
type SafeList[V any] struct { // contains filtered or unexported fields }
func NewSafeList ¶
type SafeMap ¶
func NewSafeMap ¶
Click to show internal directories.
Click to hide internal directories.