Documentation ¶
Index ¶
- func BoolPtr(v bool) *bool
- func Compress(in io.Reader, out io.Writer) error
- func Decompress(in io.Reader, out io.Writer) error
- func Float32Ptr(f float32) *float32
- func Float64Ptr(f float64) *float64
- func GenHash128a(txt []byte) string
- func GenHash64a(txt []byte) string
- func GetInt64(v interface{}) (int64, bool)
- func Int16Ptr(i int16) *int16
- func Int32Ptr(i int32) *int32
- func Int64Ptr(i int64) *int64
- func Int8Ptr(i int8) *int8
- func IntPtr(i int) *int
- func PartialObfuscate(s string) string
- func RandomFromBytes(n int, letters []byte) string
- func RandomNumbers(n int) string
- func RandomString(n int) string
- func StringPtr(s string) *string
- func TimeHash128a() string
- func TimeHash64a() string
- func TrimStruct(v reflect.Value)
- func ULID() string
- func UUID() string
- func Uint16Ptr(u uint16) *uint16
- func Uint32Ptr(u uint32) *uint32
- func Uint64Ptr(u uint64) *uint64
- func Uint8Ptr(u uint8) *uint8
- func UintPtr(u uint) *uint
- func WrapErr(err error, msgs ...string) error
- func XSSSanitizeStruct(v reflect.Value)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Compress ¶
Get bytes provided in `in`, compressed in `out` Uses: "github.com/klauspost/compress/zstd"
func Decompress ¶
Provide bytes pre-compressed using zstd in `in` and get them decompressed in `out` Uses: "github.com/klauspost/compress/zstd"
func Float32Ptr ¶
func Float64Ptr ¶
func RandomFromBytes ¶
Generates a random string of length `n` from characters given in `letters`
func RandomNumbers ¶
Generates a string of length `n` consisting only of characters [0-9]
func RandomString ¶
Generates a random string of length `n` consisting of characters [a-z]
func TrimStruct ¶
Trims all string type and values in string pointer in a struct. Given a struct `s` - accepts reflect.Value(&s)
func ULID ¶
func ULID() string
Generates a ULID as described at: "github.com/oklog/ulid/v2" Panics on failure
func UUID ¶
func UUID() string
Returns a UUID v4 string Panics if failed to generate. Uses `github.com/google/uuid`
func WrapErr ¶
Wraps the given error string with a prefix of Function Name -> [msgs[0] -> msgs[1] -> ... msgs[i]] -> err
func XSSSanitizeStruct ¶
Sanitizes all string and string pointer types in a struct for XSS Given any struct `s` - accepts reflect.Value(&s)
Types ¶
This section is empty.