Documentation ¶
Overview ¶
Package define implements functions separate of project.
Index ¶
- Variables
- func Abs[T constraints.Integer](a T) T
- func ChangeFieldOfName(imodel interface{}, field_name string, value interface{}) error
- func Check(imodel interface{}, field_name string) (*reflect.Value, error)
- func Contains[T comparable](s []T, e T) bool
- func CopyMap[T1, T2 comparable](Map map[T1]T2) map[T1]T2
- func CopyMapAny[T1, T2 comparable](Map map[T1]T2) map[string]any
- func Dict(dict interface{}) fiber.Map
- func ErrorsToStr(errs []error) string
- func GetDecodeFunc(format string) func(io.Reader) (image.Image, error)
- func GetEncodeFunc(format string) func(io.Writer, image.Image) error
- func GetImagesFromRequestBody(body []byte, key ...string) ([]image.Image, []string)
- func GetToday() string
- func GoToStruct(value reflect.Value) (*reflect.Value, error)
- func Hash(data []byte) string
- func ImagesToBytes(images []image.Image, formats []string) [][]byte
- func IndexOf[T comparable](lst []T, x T) int
- func Insert[T constraints.Ordered](a []T, index int, value T) []T
- func Max[T constraints.Ordered](args ...T) T
- func Min[T constraints.Ordered](args ...T) T
- func Pop[T comparable](lst []T, index int) ([]T, T)
- func Pow[T constraints.Integer](a T, b T) float64
- type Set
Constants ¶
This section is empty.
Variables ¶
View Source
var Atoi = func(x string) int { xInt, _ := strconv.Atoi(x); return xInt }
Atoi convet string to int.
View Source
var Itoa = strconv.Itoa
Itoa convet int to string.
View Source
var Itob = func(v int) []byte { b := make([]byte, 8) binary.BigEndian.PutUint64(b, uint64(v)) return b }
Itob convet int to []byte.
View Source
var ParseFloat = func(x string) float64 { xFloat, _ := strconv.ParseFloat(x, 64); return xFloat }
Functions ¶
func Abs ¶
func Abs[T constraints.Integer](a T) T
func ChangeFieldOfName ¶
func CopyMap ¶
func CopyMap[T1, T2 comparable](Map map[T1]T2) map[T1]T2
func CopyMapAny ¶
func CopyMapAny[T1, T2 comparable](Map map[T1]T2) map[string]any
func IndexOf ¶
func IndexOf[T comparable](lst []T, x T) int
func Insert ¶
func Insert[T constraints.Ordered](a []T, index int, value T) []T
func Pop ¶
func Pop[T comparable](lst []T, index int) ([]T, T)
func Pow ¶
func Pow[T constraints.Integer](a T, b T) float64
Types ¶
type Set ¶
type Set[T constraints.Ordered] struct { // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.