Documentation
¶
Index ¶
- func Base64Decode(data string) string
- func Base64Encode(data string) string
- func FileExist(path string) (bool, error)
- func FileFindAllFileChildren(path, suffix string) ([]string, error)
- func FileIsDir(path string) (bool, error)
- func FolderNotExistMkdir(path string) error
- func IP() (string, error)
- func MD5(bt []byte) string
- func MD5File(r io.Reader) string
- func Max[T NumberGenericity](a, b T) T
- func Min[T NumberGenericity](a, b T) T
- func Now() string
- func Object2Tag(obj any, tag string) (map[string]string, error)
- func PanicFalse(guard bool, format string, params ...any)
- func PanicTrue(guard bool, format string, params ...any)
- func RandString(base string, n int) string
- func SliceContain[T comparable](vs []T, v T) bool
- func SliceDistinct[T comparable](vs ...T) []T
- func SliceMaxNumber[T NumberGenericity](vs []T) T
- func SliceMinNumber[T NumberGenericity](vs []T) T
- func ToJSON(obj any) string
- func UID() string
- type FloatGenericity
- type IntGenericity
- type NumberGenericity
- type Stream
- type StreamArray
- func (s *StreamArray[T]) Do() Stream[T]
- func (s *StreamArray[T]) Filter(f func(v T) bool) Stream[T]
- func (s *StreamArray[T]) ForEach(f func(v T) T)
- func (s *StreamArray[T]) Get() []T
- func (s *StreamArray[T]) Length() int
- func (s *StreamArray[T]) Limit(i uint) Stream[T]
- func (s *StreamArray[T]) Set(vs []T) Stream[T]
- func (s *StreamArray[T]) Skip(i uint) Stream[T]
- type UIntGenericity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileFindAllFileChildren ¶
FileFindAllFileChildren suffix is "" then search the path children all files suffix is not "" then search the path children files suffix is param suffix
func FolderNotExistMkdir ¶
FolderNotExistMkdir check path folder is exist, if not exist then mkdirall the path else os.Stat(path) os.IsNotExist false, then return err, else return nil so used the method then check this err == nil then success.
func Max ¶
func Max[T NumberGenericity](a, b T) T
func Min ¶
func Min[T NumberGenericity](a, b T) T
func RandString ¶
RandString randomly generate a specified length string based on the given string
func SliceContain ¶
func SliceContain[T comparable](vs []T, v T) bool
SliceContain check the v in vs slice
func SliceDistinct ¶
func SliceDistinct[T comparable](vs ...T) []T
SliceDistinct slice remove duplicates
Types ¶
type FloatGenericity ¶
type NumberGenericity ¶
type NumberGenericity interface { IntGenericity | UIntGenericity | FloatGenericity }
type StreamArray ¶
type StreamArray[T any] struct { // contains filtered or unexported fields }
func NewStreamArray ¶
func NewStreamArray[T any](s []T) *StreamArray[T]
func (*StreamArray[T]) Do ¶
func (s *StreamArray[T]) Do() Stream[T]
func (*StreamArray[T]) Filter ¶
func (s *StreamArray[T]) Filter(f func(v T) bool) Stream[T]
func (*StreamArray[T]) ForEach ¶
func (s *StreamArray[T]) ForEach(f func(v T) T)
func (*StreamArray[T]) Get ¶
func (s *StreamArray[T]) Get() []T
func (*StreamArray[T]) Length ¶
func (s *StreamArray[T]) Length() int
func (*StreamArray[T]) Limit ¶
func (s *StreamArray[T]) Limit(i uint) Stream[T]
func (*StreamArray[T]) Set ¶
func (s *StreamArray[T]) Set(vs []T) Stream[T]
func (*StreamArray[T]) Skip ¶
func (s *StreamArray[T]) Skip(i uint) Stream[T]
Click to show internal directories.
Click to hide internal directories.