Documentation ¶
Index ¶
- func CombineURLPath(p string, ps ...string) (r string)
- func CompareNullableIntsWithNilAsInfinity(a, b *int64) int
- func GetTimeIn(seconds int64) time.Time
- func IPIsIn(ip string, ips []string) bool
- func IPsAreSubSet(ipsA, ipsB []string) bool
- func IntersectSlices(a, b []string) (res []string)
- func IsJWT(token string) bool
- func IsSubSet(a, b []string) bool
- func MinInt(a int, ints ...int) int
- func MinInt64(a int64, ints ...int64) int64
- func NewInt(i int) *int
- func NewInt64(i int64) *int64
- func OR(bools ...bool) bool
- func ORErrors(errs ...error) error
- func RSplitN(s, del string, n int) []string
- func RandASCIIString(n int) string
- func ReplaceStringInSlice(s *[]string, o, n string, caseSensitive bool)
- func SliceUnion(a ...[]string) []string
- func SplitIgnoreEmpty(s, del string) (ret []string)
- func StringInSlice(key string, slice []string) bool
- func StructToStringMap(st interface{}, tag string) map[string]string
- func StructToStringMapUsingJSONTags(st interface{}) map[string]string
- func UniqueSlice(a []string) (unique []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombineURLPath ¶
CombineURLPath combines multiple parts of a url
func CompareNullableIntsWithNilAsInfinity ¶
CompareNullableIntsWithNilAsInfinity compare two *int64 and handles nil as infinity. It returns 0 if both are equal, a positive value if a is greater than b, a negative value is a is less than b
func IPsAreSubSet ¶
IPsAreSubSet checks if all ips of ipsA are contained in ipsB, it will also check ip subnets
func IntersectSlices ¶
IntersectSlices returns the common elements of two slices
func RSplitN ¶ added in v0.3.3
RSplitN splits a string s at the delimiter del into n pieces. Unlike strings.SplitN RSplitN splits the string starting from the right side
func RandASCIIString ¶
RandASCIIString returns a random string consisting of ASCII characters of the given length.
func ReplaceStringInSlice ¶ added in v0.2.0
ReplaceStringInSlice replaces all occurrences of a string in a slice with another string
func SliceUnion ¶
SliceUnion will create a slice of string that contains all strings part of the passed slices
func SplitIgnoreEmpty ¶
SplitIgnoreEmpty splits a string at the specified delimiter without generating empty parts
func StringInSlice ¶
StringInSlice checks if a string is in a slice of strings
func StructToStringMap ¶
StructToStringMap creates a string map from an interface{} using the passed tag name
func StructToStringMapUsingJSONTags ¶
StructToStringMapUsingJSONTags creates a string map from an interface{} using json tags
func UniqueSlice ¶
UniqueSlice will remove all duplicates from the given slice of strings
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package fileutil provides utility functions related to files.
|
Package fileutil provides utility functions related to files. |