Versions in this module Expand all Collapse all v0 v0.1.3 Jul 28, 2023 Changes in this version + const G_ERROR_TEMPLATES + const G_FIELDS + const G_TAG + func ArrayToMap(array []E, f TFunc[E, R, T]) (out map[any]T) + func UnsetGlobals(options ...string) + type Heap struct + func NewHeap(t []E, cmp CMP[E]) *Heap[E] + func (h *Heap[E]) Copy() *Heap[E] + func (h *Heap[E]) Element(index int) (e E, err error) + func (h *Heap[E]) Len() int + func (h *Heap[E]) Pop() (e E) + func (h *Heap[E]) Push(v E) + func (h *Heap[E]) Remove(index int) (e E) + type Info struct + BuildDate string + Compiler string + GitBranch string + GitCommit string + GitTag string + GitTreeState string + GoVersion string + Platform string + Version string + func Version() Info + func (info Info) String() string + type Stack struct + func NewStack() *Stack[E] + func NewStackSize(size int) *Stack[E] + func (s *Stack[E]) Cap() int + func (s *Stack[E]) Copy() *Stack[E] + func (s *Stack[E]) IsEmpty() bool + func (s *Stack[E]) Pop() (e E) + func (s *Stack[E]) Push(e E) + func (s *Stack[E]) Size() int + type TFunc func(E) (R, T) v0.1.2 Apr 24, 2023 Changes in this version + const APPLICATION_JSON + const CONTENT_TYPE + const ERR_OPEN_FILE_FAILED + const ERR_PARAMS_INVALID + const ERR_UNKOWN_TYPE + const ERR_WRITER_CLOSE_FAILED + const ERR_WRITER_FAILED + const ERR_WRITE_FIELD_FAILED + const FORM_ENCODED + const FORM_MULTIPART + func ArrayContains(array []E, key E) bool + func ArrayMax(array ...E) E + func ArrayMin(array ...E) E + func HttpGet(ho *HttpOptions) (*http.Response, error) + func HttpPostFiles(ho *HttpOptions) (*http.Response, error) + func HttpPostForm(ho *HttpOptions) (*http.Response, error) + func HttpPostJSON(ho *HttpOptions) (*http.Response, error) + func IsEmail(email string) bool + func IsEmailRFC(email string) bool + func IsUrl(url string) bool + func MapClear(data map[K]V) + func MapFilter(data map[K]V, f BiFunc[bool, K, V]) map[K]V + func MapKeys(data map[K]V) []K + func MapRange(data map[K]V, f BiFunc[bool, K, V]) + func MapSize(data map[K]V) int + func MapValues(data map[K]V) []V + func ReadResponse(resp *http.Response) (bodyBytes []byte, isGzip bool, err error) + func SetGlobalErrorTemplates(templates map[any]string) + func SetGlobalFields(fields map[string]interface{}) + func SetGlobalTag(globalTag string) + func StringReverse(s string) (string, error) + type Err interface + Detail func() string + DetailText func() string + Error func() string + Export func() ErrDetail + Is func(any) bool + WithCode func(any) Err + WithFields func(map[string]interface{}) Err + WithTag func(string) Err + func ErrorCause(e error) Err + func ErrorT(code any, a ...any) Err + func Errorf(format string, a ...any) Err + type ErrDetail struct + Chains []string + Code any + E string + Fields map[string]interface{} + GlobalFields map[string]interface{} + GlobalTag string + Tag string + type FileUploadInfo struct + FileName string + Filepath string + Name string + type Functions map[string]reflect.Value + func NewFunctions() Functions + func (f Functions) Bind(name string, fn interface{}) (err error) + func (f Functions) Call(name string, params ...interface{}) (result []reflect.Value, err error) + type HttpOptions struct + C *http.Client + Files []FileUploadInfo + Headers map[string]string + Params map[string]string + Url string v0.1.1 Apr 18, 2023 Changes in this version + var ERRNilResponse = errors.New("nil response") + var ERR_BYTES_INVALILD = errors.New("BytesToFloat64 bytes invalid") + var ERR_NEED_NUMERIC = errors.New("ToInt64 need numeric") + var ErrParamsNotAdapted = errors.New("The number of params is not adapted.") + func ArrayMerge(a, b []E, c ...[]E) (data []E) + func ArraySum(data []E) (sum E) + func ArrayUnique(in []E) (out []E) + func BytesToFloat64(bytes []byte) (data float64, err error) + func BytesToReadable(bytes float64, precision ...int) string + func Contains(data []E, key E) bool + func Create(name string) (*os.File, error) + func Dir(fp string) string + func DirsUnder(dirPath string) ([]string, error) + func EnsureDirRW(dataDir string) error + func Ext(fp string) string + func FileMTime(fp string) (int64, error) + func FileSize(fp string) (int64, error) + func FilesUnder(dirPath string) ([]string, error) + func Float64Precision(f float64, precision int, round bool) float64 + func Float64ToBytes(input float64) []byte + func Float64ToStr(num float64, precision int) string + func InsureDir(fp string) error + func IsExist(fp string) bool + func IsFile(fp string) bool + func MapToStruct(obj map[string]interface{}, data interface{}) (interface{}, error) + func Name(fp string) string + func RandomInts(start int, end int, count int) []int + func RealPath(fp string) (string, error) + func Remove(name string) error + func Rename(src string, target string) error + func SearchFile(filename string, paths ...string) (fullPath string, err error) + func SearchFileWithAffix(dirPath, prefix, suffix string) (fullPath string, exist bool) + func SelfDir() string + func SelfPath() string + func StrToFloat64(str string, precision int) float64 + func StrToFloat64Round(str string, precision int, round bool) float64 + func StructToMap(obj interface{}) map[string]interface + func ToInt64(value interface{}) (d int64, err error) + type BiConsumer func(T, U) + type BiFunc func(T, U) R + type CMP BiFunc[int, E, E] + type Call func() + type Comparable interface + CompareTo func(v E) int + type Complex interface + type Consumer func(T) + type EQL BiFunc[bool, E, E] + type Evaluate Func[bool, E] + type Float interface + type Func func(T) R + type Funcs map[string]reflect.Value + func NewFuncs() Funcs + func (f Funcs) Bind(name string, fn interface{}) (err error) + func (f Funcs) Call(name string, params ...interface{}) (result []reflect.Value, err error) + type Integer interface + type Null struct + var Empty Null + type Ordered interface + type Response struct + func ResponseRecorder(resp *http.Response) (r *Response, err error) + func (r *Response) Body() []byte + func (r *Response) Header() http.Header + func (r *Response) Size() int64 + func (r *Response) Status() string + func (r *Response) StatusCode() int + func (r *Response) String() string + func (r *Response) Unmarshal(data interface{}) error + type Signed interface + type Supplier func() R + type Unsigned interface v0.1.0 Jun 3, 2020