Documentation
¶
Overview ¶
Package gosc is an helper package for Go, written to be user friendly with alias and inspired by Lodash.
Index ¶
- func AllFloat(s []float64, f func(float64) bool) bool
- func AllInt(s []int, f func(int) bool) bool
- func AllString(s []string, f func(string) bool) bool
- func AnyFloat(s []float64, f func(float64) bool) bool
- func AnyInt(s []int, f func(int) bool) bool
- func AnyString(s []string, f func(string) bool) bool
- func ByteToString(b []byte) string
- func Delete(s interface{}, i int)
- func EqSlices(a, b interface{}) bool
- func EveryFloat(s []float64, f func(float64) bool) bool
- func EveryInt(s []int, f func(int) bool) bool
- func EveryString(s []string, f func(string) bool) bool
- func FilterFloat(s []float64, f func(float64) bool) []float64
- func FilterInt(s []int, f func(int) bool) []int
- func FilterString(s []string, f func(string) bool) []string
- func FromBase64(s string) string
- func InSlice(v interface{}, s interface{}) bool
- func Index(s interface{}, t interface{}) int
- func Indexi(s []string, t string) int
- func IsBool(s string) bool
- func IsCreditCard(s string) bool
- func IsEmail(s string) bool
- func IsFloat(s string) bool
- func IsHexColor(s string) bool
- func IsIP(s string) bool
- func IsInt(s string) bool
- func IsJSON(s string) bool
- func IsOnlyAlpha(s string) bool
- func IsOnlyAlphaDigits(s string) bool
- func IsOnlyAlphaNum(s string) bool
- func IsOnlyAlphaNumeric(s string) bool
- func IsOnlyDigits(s string) bool
- func IsOnlyLetters(s string) bool
- func IsOnlyLettersNumbers(s string) bool
- func IsOnlyNumbers(s string) bool
- func IsRGB(s string) bool
- func IsRGBColor(s string) bool
- func IsURL(s string) bool
- func LcFirst(s string) string
- func LowerFirst(s string) string
- func MapFloat(s []float64, f func(float64) float64) []float64
- func MapInt(s []int, f func(int) int) []int
- func MapString(s []string, f func(string) string) []string
- func Rand(min, max int) int
- func RandStr(n int) string
- func RandomString(n int) string
- func ReverseSort(s interface{})
- func ReverseString(s string) string
- func Rsort(s interface{})
- func Rstring(s string) string
- func SliceRand(s interface{}, r interface{})
- func SliceRandF(s []float64) float64
- func SliceRandFloat(s []float64) float64
- func SliceRandI(s []int) int
- func SliceRandInt(s []int) int
- func SliceRandS(s []string) string
- func SliceRandString(s []string) string
- func SomeFloat(s []float64, f func(float64) bool) bool
- func SomeInt(s []int, f func(int) bool) bool
- func SomeString(s []string, f func(string) bool) bool
- func StrRand(n int) string
- func ToBase64(s string) string
- func ToBytes(s string) []byte
- func ToCamel(s string) string
- func ToCamelCase(s string) string
- func ToInt(s string) int
- func ToInt64(s string) int64
- func ToKebab(s string) string
- func ToKebabCase(s string) string
- func ToPascal(s string) string
- func ToPascalCase(s string) string
- func ToSnake(s string) string
- func ToSnakeCase(s string) string
- func ToUint(s string) uint
- func UUID() string
- func UcFirst(s string) string
- func Uniq() string
- func Unique() string
- func UpperFirst(s string) string
- func Utoa(u uint) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllFloat ¶
AllFloat returns true if all of the float64s in the slice satisfy the predicate f
func AllInt ¶
AllInt returns true if all of the ints in the slice satisfy the predicate f
func AllString ¶
AllString returns true if all of the strings in the slice satisfy the predicate f
func AnyFloat ¶
AnyFloat returns true if one of the float64s in the slice satisfies the predicate f
func AnyInt ¶
AnyInt returns true if one of the ints in the slice satisfies the predicate f
func AnyString ¶
AnyString returns true if one of the strings in the slice satisfies the predicate f
func ByteToString ¶
ByteToString converts a bytes slice to a string
func EqSlices ¶
func EqSlices(a, b interface{}) bool
EqSlices returns true if two slices are equal (not in-depth, for that use reflect.DeepEqual)
func EveryFloat ¶
EveryFloat returns true if all of the float64s in the slice satisfy the predicate f
func EveryInt ¶
EveryInt returns true if all of the ints in the slice satisfy the predicate f
func EveryString ¶
EveryString returns true if all of the strings in the slice satisfy the predicate f
func FilterFloat ¶
FilterFloat returns a new slice containing all float64s in the slice that satisfy the predicate f.
func FilterInt ¶
FilterInt returns a new slice containing all ints in the slice that satisfy the predicate f.
func FilterString ¶
FilterString returns a new slice containing all strings in the slice that satisfy the predicate f.
func InSlice ¶
func InSlice(v interface{}, s interface{}) bool
InSlice returns a boolean if the value is in the slice v = value to find s = slice
func Index ¶
func Index(s interface{}, t interface{}) int
Index returns the index of an element in a slice or -1 if not found
func Indexi ¶
Indexi returns the index of a string in a slice or -1 if not found. Case Insentive.
func IsCreditCard ¶
IsCreditCard returns true if the provided string is a valid credit card
func IsEmail ¶
IsEmail returns true if the provided string is a valid email address
func IsHexColor ¶
IsHexColor returns true if the provided string is a valid HEX color
func IsJSON ¶
IsJSON returns true if the provided string is a valid JSON document
func IsOnlyAlphaDigits ¶
IsOnlyAlphaDigits is an alias of IsOnlyAlphaNumeric
func IsOnlyAlphaNum ¶
IsOnlyAlphaNum is an alias of IsOnlyAlphaNumeric
func IsOnlyAlphaNumeric ¶
IsOnlyAlphaNumeric returns true if the provided string is composed only by letters and numbers
func IsOnlyDigits ¶
IsOnlyDigits returns true if the provided string is composed only by numbers
func IsOnlyLetters ¶
IsOnlyLetters returns true if the provided string is composed only by letters
func IsOnlyLettersNumbers ¶
IsOnlyLettersNumbers is an alias of IsOnlyAlphaNumeric
func IsRGBColor ¶
IsRGBColor returns true if the provided string is a valid RGB color
func LcFirst ¶
LcFirst returns a string with the first character lowercased
func MapFloat ¶
MapFloat a new slice containing the results of applying the function f to each float64 in the original slice.
func MapInt ¶
MapInt a new slice containing the results of applying the function f to each int in the original slice.
func MapString ¶
MapString a new slice containing the results of applying the function f to each string in the original slice.
func SliceRand ¶
func SliceRand(s interface{}, r interface{})
SliceRand assign a random value from a string to the "r" arg
func SliceRandFloat ¶
SliceRandFloat returns a random value from a float64 slice
func SliceRandInt ¶
SliceRandInt returns a random value from an int slice
func SliceRandString ¶
SliceRandString returns a random value from a string slice
func SomeFloat ¶
SomeFloat returns true if one of the float64s in the slice satisfies the predicate f
func SomeInt ¶
SomeInt returns true if one of the ints in the slice satisfies the predicate f
func SomeString ¶
SomeString returns true if one of the strings in the slice satisfies the predicate f
func UcFirst ¶
UcFirst returns a string with the first character uppercased
Types ¶
This section is empty.
Source Files
¶
- number.go
- slice.go
- string.go